Jump to content


Tiberian Dawn 'Deploying' Sam site issues


9 replies to this topic

#1 Madin

    Amateur

  • Member
  • 138 posts

Posted 12 December 2010 - 13:34

So I have a Sam site that Deploys in a style similar to the Tiberian Dawn Nod Sam site.
The problem that I'm having is that if it unpacks and does not destroy the target it unpacked for (ie the aircraft gets away), then the Sam site will stay in its deployed state and will not pack up and return underground. If another target comes along and the still deployed Sam site destroys it, then it will pack up.
If the Sam site unpacks for a target and successfully destroys the target, then it will pack up and return underground.

So I'd like to know if there are any settings that I could use to insure that the Sam site packs up if no target is in range, regardless of whether the target it unpacked for is destroyed or not.

#2 Sgt. Rho

    Kerbal Rocket Scientist

  • Project Leader
  • 6870 posts
  • Projects: Scaring Jebediah.

Posted 12 December 2010 - 14:22

The Code. Post it. Ol' Jenkins' Crystal Ball store recalled all Crystal Balls because of malfunctions |8

#3 Destiny

    Forum Nakadashi-er

  • Member Test
  • 3141 posts

Posted 12 December 2010 - 14:45

Say...why don't you find a way to make the whole SAM site pop up an animation?
Posted Image

#4 Sgt. Rho

    Kerbal Rocket Scientist

  • Project Leader
  • 6870 posts
  • Projects: Scaring Jebediah.

Posted 12 December 2010 - 15:20

		<AI>
			<DeployStyleAIUpdate
				id=&#34;ModuleTag_AI&#34;
				AutoAcquireEnemiesWhenIdle=&#34;YES&#34;
				UnpackTime=&#34;1.0s&#34;
				PackTime=&#34;1.0s&#34;
				MustDeployToAttack=&#34;true&#34;>
				<UnitAITargetChooserData
					CheckVisionRange=&#34;false&#34;
					CanPickDynamicTargets=&#34;false&#34;
					RotateToTargetWhenAiming=&#34;false&#34; />
			</DeployStyleAIUpdate>
		</AI>


	<WeaponTemplate 
		id=&#34;NODLaserCannonWeapon&#34;
		Name=&#34;NODLaserCannonWeapon&#34; 
		AttackRange=&#34;350.0&#34; 
		WeaponSpeed=&#34;999999.0&#34; 
		RadiusDamageAffects=&#34;ALLIES ENEMIES NEUTRALS&#34;
		AcceptableAimDelta=&#34;180d&#34;
		FireSound=&#34;NOD_LaserCannon_WeaponFire&#34;
		FireFX=&#34;FX_NODSpitfireFire&#34;
		ReAcquireDetailType=&#34;POST_FIRE&#34;
		RequiredFiringObjectStatus=&#34;DEPLOYED&#34;
		ClipSize=&#34;2&#34;
		ShotsPerBarrel=&#34;1&#34;>
		<FiringDuration
			MinSeconds=&#34;1.1s&#34;
			MaxSeconds=&#34;1.1s&#34; />
		<ClipReloadTime
			MinSeconds=&#34;3.0s&#34;
			MaxSeconds=&#34;3.0s&#34; />
		<Nuggets>
			<ActivateLaserNugget
				Lifetime=&#34;0.8s&#34;
				LaserId=&#34;0&#34;
				HitGroundFX=&#34;FX_NODSpitfireHit&#34;/>
			<DamageNugget 
				Damage=&#34;140.0&#34; 
				Radius=&#34;0.0&#34; 
				DelayTimeSeconds=&#34;0.5s&#34;
				DamageType=&#34;CANNON&#34; 
				DamageFXType=&#34;NOD_LASER&#34; 
				DeathType=&#34;NORMAL&#34;>
				<DamageScalarDetails Scalar= &#34;50%&#34;>
					<Filter
						Rule=&#34;NONE&#34;
						Include=&#34;INFANTRY&#34; />
				</DamageScalarDetails>
			</DamageNugget>
		</Nuggets>
	</WeaponTemplate>


The code for a 'deploying' Weapon. Works without problems so far.

#5 Golan

    <Charcoal tiles available>

  • Member Test
  • 3300 posts

Posted 12 December 2010 - 16:42

I'd suggest not to use DeployAI on stationary objects. It doesn't synergize well. Use a delay on the weapon and the ATTACKING ModelCondition instead.
Now go out and procreate. IN THE NAME OF DOOM!

#6 Sgt. Rho

    Kerbal Rocket Scientist

  • Project Leader
  • 6870 posts
  • Projects: Scaring Jebediah.

Posted 12 December 2010 - 16:50

I had no problems with it so far, it works well on the Laser turret.

#7 Madin

    Amateur

  • Member
  • 138 posts

Posted 12 December 2010 - 19:14

View PostDestiny, on 12 Dec 2010, 14:45, said:

Say...why don't you find a way to make the whole SAM site pop up an animation?

It is an animation

View PostGolan, on 12 Dec 2010, 16:42, said:

I'd suggest not to use DeployAI on stationary objects. It doesn't synergize well. Use a delay on the weapon and the ATTACKING ModelCondition instead.


I'll give that a go if all else fails.

Thanks for the code Sgt. Rho!

Edited by Madin, 12 December 2010 - 19:15.


#8 Madin

    Amateur

  • Member
  • 138 posts

Posted 21 January 2011 - 23:14

I guess that if I'm using the 'ATTACKING' model condition, I should be using a different 'AIUpdate', does it matter which one?
The 'DeployUpdate' handles the 'PACKING' animation, which I don't think other 'AIUpdates' do.
Both the 'DEPLOY' and 'ATTACKING' methods of coding a pop-up SAM have a bug were the SAM will occasionally fire without 'DEPLOYING'\'UNPACKING', is there any thoughts on how I can get around this?, has this kind of defeats the purpose of a pop-up SAM!

Some code:
Draw
<scriptedModelDraw id=&#34;ModuleTag_Draw_Sam&#34; OkToChangeModelColor=&#34;true&#34; ExtraPublicBone=&#34;WeaponFX01 WeaponFX02 WeaponFX03 WeaponFX04 WeaponFX05 WeaponFX06&#34;>
		<ModelConditionState ParseCondStateType=&#34;PARSE_DEFAULT&#34;>
		  <Model Name=&#34;NB_SAMMain_SKN&#34; />
		  <WeaponFireFXBone WeaponSlotID=&#34;1&#34; WeaponSlotType=&#34;PRIMARY_WEAPON&#34; BoneName=&#34;WeaponFX&#34; />
		</ModelConditionState>
		<ModelConditionState ParseCondStateType=&#34;PARSE_NORMAL&#34; ConditionsYes=&#34;STRUCTURE_UNPACKING&#34;>
		  <Model Name=&#34;NB_SAMMain_SKN&#34; />
		</ModelConditionState>
		<ModelConditionState ParseCondStateType=&#34;PARSE_NORMAL&#34; ConditionsYes=&#34;UNPACKING&#34;>
		  <Model Name=&#34;NB_SAMMain_SKN&#34; />
		</ModelConditionState>
		<ModelConditionState ParseCondStateType=&#34;PARSE_NORMAL&#34; ConditionsYes=&#34;PACKING&#34;>
		  <Model Name=&#34;NB_SAMMain_SKN&#34; />
		</ModelConditionState>
		<ModelConditionState ParseCondStateType=&#34;PARSE_NORMAL&#34; ConditionsYes=&#34;DEPLOYED&#34;>
		  <Model Name=&#34;NB_SAMMain_SKN&#34; />
		  <WeaponFireFXBone WeaponSlotID=&#34;1&#34; WeaponSlotType=&#34;PRIMARY_WEAPON&#34; BoneName=&#34;WeaponFX&#34; />
		  <Turret TurretNameKey=&#34;Bone_Turret&#34; TurretPitch=&#34;Bone_Pivot&#34; TurretID=&#34;1&#34; />
		</ModelConditionState>
		<ModelConditionState ParseCondStateType=&#34;PARSE_NORMAL&#34; ConditionsYes=&#34;DAMAGED&#34;>
		  <Model Name=&#34;NB_SAMMain_SKN&#34; />
		  <Texture Original=&#34;NBSamSite&#34; New=&#34;NBSamSiteD&#34; />
		  <Texture Original=&#34;NBSamSite_NRM&#34; New=&#34;NBSamSiteD_NRM&#34; />
		</ModelConditionState>
		<ModelConditionState ParseCondStateType=&#34;PARSE_NORMAL&#34; ConditionsYes=&#34;REALLYDAMAGED&#34;>
		  <Model Name=&#34;NB_SAMMain_SKN&#34; />
		  <Texture Original=&#34;NBSamSite&#34; New=&#34;NBSamSiteD&#34; />
		  <Texture Original=&#34;NBSamSite_NRM&#34; New=&#34;NBSamSiteD_NRM&#34; />
		  <ParticleSysBone BoneName=&#34;Bone_Pivot&#34; FXParticleSystemTemplate=&#34;GDIMammothDamagedSmoke&#34; FollowBone=&#34;true&#34; />
		  <ParticleSysBone BoneName=&#34;Bone_Pivot&#34; FXParticleSystemTemplate=&#34;GDIWTDamagedDist&#34; FollowBone=&#34;true&#34; />
		</ModelConditionState>
		<ModelConditionState ParseCondStateType=&#34;PARSE_NORMAL&#34; ConditionsYes=&#34;DYING&#34;>
		  <Model Name=&#34;NB_SAMMainR&#34; />
		  <ParticleSysBone BoneName=&#34;ROOTTRANSFORM&#34; FXParticleSystemTemplate=&#34;GDIDebrisSmallFire&#34; FollowBone=&#34;true&#34; />
		  <ParticleSysBone BoneName=&#34;ROOTTRANSFORM&#34; FXParticleSystemTemplate=&#34;GDIDebrisSmallFireDistortion&#34; FollowBone=&#34;true&#34; />
		  <ParticleSysBone BoneName=&#34;ROOTTRANSFORM&#34; FXParticleSystemTemplate=&#34;GDIDebrisSmallSmoke&#34; FollowBone=&#34;true&#34; />
		</ModelConditionState>
		<AnimationState ParseCondStateType=&#34;PARSE_NORMAL&#34; ConditionsYes=&#34;STRUCTURE_UNPACKING&#34;>
		  <Animation AnimationName=&#34;NB_SAMMain_AAN&#34; AnimationMode=&#34;ONCE&#34; />
		</AnimationState>
		<AnimationState ParseCondStateType=&#34;PARSE_NORMAL&#34; ConditionsYes=&#34;UNPACKING&#34;>
		  <Animation AnimationName=&#34;NB_SAMMain_DPLY&#34; AnimationMode=&#34;ONCE&#34; AnimationBlendTime=&#34;0&#34; AnimationSpeedFactorMin=&#34;3.0&#34; AnimationSpeedFactorMax=&#34;3.0&#34; />
		</AnimationState>
		<AnimationState ParseCondStateType=&#34;PARSE_NORMAL&#34; ConditionsYes=&#34;PACKING&#34; Flags=&#34;START_FRAME_LAST&#34;>
		  <Animation AnimationName=&#34;NB_SAMMain_DPLY&#34; AnimationMode=&#34;ONCE_BACKWARDS&#34; AnimationBlendTime=&#34;0&#34; AnimationSpeedFactorMin=&#34;1.5&#34; AnimationSpeedFactorMax=&#34;1.5&#34; />
		</AnimationState>
		<AnimationState ParseCondStateType=&#34;PARSE_NORMAL&#34; ConditionsYes=&#34;DEPLOYED&#34; Flags=&#34;START_FRAME_LAST&#34;>
		  <Animation AnimationName=&#34;NB_SAMMain_DPLY&#34; AnimationMode=&#34;MANUAL&#34; />
		</AnimationState>


AI Update
<AI>
	  <DeployStyleAIUpdate id=&#34;ModuleTag_AI&#34; AutoAcquireEnemiesWhenIdle=&#34;YES&#34; UnpackTime=&#34;0.2s&#34; PackTime=&#34;0.2s&#34; TurretsMustCenterBeforePacking=&#34;true&#34; MustDeployToAttack=&#34;true&#34;>
		<UnitAITargetChooserData CheckVisionRange=&#34;false&#34; CanPickDynamicTargets=&#34;false&#34; RotateToTargetWhenAiming=&#34;true&#34; />
	  </DeployStyleAIUpdate>
	</AI>


Weapon
<WeaponTemplate id=&#34;NODSamSiteWeapon&#34; Name=&#34;NODSamSiteWeapon&#34; AttackRange=&#34;500.0&#34; WeaponSpeed=&#34;350&#34; RadiusDamageAffects=&#34;ALLIES ENEMIES NEUTRALS&#34; AcceptableAimDelta=&#34;10d&#34; FireSound=&#34;NOD_RocketBunkerHub_RocketLaunch&#34; FireFX=&#34;FX_NODMilitantMissileFire&#34; ClipSize=&#34;6&#34; ProjectileCollidesWith=&#34;ALLIES ENEMIES NEUTRAL STRUCTURES WALLS&#34; ReAcquireDetailType=&#34;PER_SHOT&#34; AntiMask=&#34;ANTI_AIRBORNE_VEHICLE ANTI_AIRBORNE_INFANTRY&#34; PreAttackType=&#34;PER_TARGET&#34;>
	<!--WeaponPrefireType=&#34;PER_BURST&#34;-->
	<!--<PreAttackDelay MinSeconds=&#34;2.0s&#34; MaxSeconds=&#34;2.0s&#34; xmlns=&#34;uri&#58;ea.com&#58;eala&#58;asset&#34; />-->
	<FiringDuration MinSeconds=&#34;2.0s&#34; MaxSeconds=&#34;2.0s&#34; />
	<ClipReloadTime MinSeconds=&#34;0.2s&#34; MaxSeconds=&#34;0.2s&#34; />
	<Nuggets>
	  <ProjectileNugget WarheadTemplate=&#34;NODSamSiteWeaponWarhead&#34; ProjectileTemplate=&#34;NODSamSiteWeaponProjectile&#34; />
	  <SuppressionNugget Radius=&#34;50.0&#34; Suppression=&#34;50&#34; DurationSeconds=&#34;2s&#34; />
	  <AttributeModifierNugget PartitionFilterTestType=&#34;SPHERE&#34; AttributeModifierOwnerName=&#34;Modifier_SamSiteWeaponFiring&#34; />
	</Nuggets>
	<ScatterRadiusVsType Radius=&#34;30.0&#34;>
	  <Filter Rule=&#34;NONE&#34; Include=&#34;INFANTRY&#34; />
	</ScatterRadiusVsType>
  </WeaponTemplate>


#9 Sgt. Rho

    Kerbal Rocket Scientist

  • Project Leader
  • 6870 posts
  • Projects: Scaring Jebediah.

Posted 23 January 2011 - 12:17

It seems to me as if you missed this line:

RequiredFiringObjectStatus=&#34;DEPLOYED&#34;


#10 Madin

    Amateur

  • Member
  • 138 posts

Posted 24 January 2011 - 03:32

If I add that line it never deploys to fire at all!
If people have got it working without bugs, then it must be an issue with the way my model is coded.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users