Jump to content


The big deploying turret debate


2 replies to this topic

#1 Madin

    Amateur

  • Member
  • 138 posts

Posted 07 January 2012 - 18:50

I have a TS style deploying laser turret but it does not really work well.

The 2 main issues are:
  • The turret packs up after each kill. This means that for a squad of six infantry, the turret will deploy 6 separate times.
  • The pack up animation does not work. I believe that this is because I am not using the deployAI module.
  • When the model gets damaged, if it is attacking, it will not use the damaged texture but instead use the normal texture. Once it has packed up, it returns to the damaged texture.

Trying to use the deployAI module, the problem I have is that randomly the turret will fail to pack up after killing a target, also it will sometimes fail to unpack. Which makes it quite useless.

Any ideas? The main issue is the fact that the turret packs up after each kill, I have some code below.

Weapon
<WeaponTemplate id="NODLaserCannonWeapon" Name="NODLaserCannonWeapon" AttackRange="350.0" WeaponSpeed="999999.0" RadiusDamageAffects="ALLIES ENEMIES NEUTRALS" AcceptableAimDelta="0d" FireSound="NOD_LaserCannon_WeaponFire" FireFX="FX_NODSpitfireFire" ReAcquireDetailType="POST_FIRE" PreAttackType="PER_POSITION" ClipSize="1">
<PreAttackDelay MinSeconds="0.4s" MaxSeconds="0.4s"/>
<FiringDuration MinSeconds="0.6s" MaxSeconds="0.6s"/>
<ClipReloadTime MinSeconds="0.75s" MaxSeconds="0.75s"/>
<Nuggets>
<ActivateLaserNugget Lifetime="0.4s" LaserId="0" HitGroundFX="FX_NODSpitfireHit"/>
<DamageNugget Damage="100.0" Radius="0.0" DelayTimeSeconds="0.2s" DamageType="GUN" DamageFXType="NOD_LASER" DeathType="NORMAL">
<!--<DamageScalarDetails Scalar="50%" xmlns="uri:ea.com:eala:asset"><Filter Rule="NONE" Include="INFANTRY" /></DamageScalarDetails>
-->
</DamageNugget>
</Nuggets>
</WeaponTemplate>


Laser turret Draw
<scriptedModelDraw id="ModuleTag_Draw_Sam" OkToChangeModelColor="true" ExtraPublicBone="WeaponFX01 WeaponFX02 WeaponFX03 WeaponFX04 WeaponFX05 WeaponFX06">
    	<ModelConditionState ParseCondStateType="PARSE_DEFAULT">
      	<Model Name="NBTSLaser" />
      	<WeaponFireFXBone WeaponSlotID="1" WeaponSlotType="PRIMARY_WEAPON" BoneName="FX_Weapon" />
      	<WeaponLaunchBone WeaponSlotID="1" WeaponSlotType="PRIMARY_WEAPON" BoneName="FX_Weapon" />
      	<Turret TurretNameKey="Turret" TurretPitch="Turret_Pitch" TurretID="1" />
    	</ModelConditionState>
    	<ModelConditionState ParseCondStateType="PARSE_NORMAL" ConditionsYes="STRUCTURE_UNPACKING">
      	<Model Name="NBTSLaser_A" />
    	</ModelConditionState>
    	<ModelConditionState ParseCondStateType="PARSE_NORMAL" ConditionsYes="UNPACKING">
      	<Model Name="NBTSLaser" />
    	</ModelConditionState>
    	<ModelConditionState ParseCondStateType="PARSE_NORMAL" ConditionsYes="PACKING">
      	<Model Name="NBTSLaser" />
    	</ModelConditionState>
    	<ModelConditionState ParseCondStateType="PARSE_NORMAL" ConditionsYes="ATTACKING">
      	<Model Name="NBTSLaser" />
    	</ModelConditionState>
    	<ModelConditionState ParseCondStateType="PARSE_NORMAL" ConditionsYes="DAMAGED ">
      	<Model Name="NBTSLaser" />
      	<Texture Original="NBSamSite" New="NBSamSiteD" />
      	<Texture Original="NBSamSite_NRM" New="NBSamSiteD_NRM" />
    	</ModelConditionState>
    	<ModelConditionState ParseCondStateType="PARSE_NORMAL" ConditionsYes="REALLYDAMAGED">
      	<Model Name="NBTSLaser" />
      	<Texture Original="NBSamSite" New="NBSamSiteD" />
      	<Texture Original="NBSamSite_NRM" New="NBSamSiteD_NRM" />
      	<ParticleSysBone BoneName="Bone_Pivot" FXParticleSystemTemplate="GDIMammothDamagedSmoke" FollowBone="true" />
      	<ParticleSysBone BoneName="Bone_Pivot" FXParticleSystemTemplate="GDIWTDamagedDist" FollowBone="true" />
    	</ModelConditionState>
    	<ModelConditionState ParseCondStateType="PARSE_NORMAL" ConditionsYes="DYING">
      	<Model Name="NB_SAMMainR" />
      	<ParticleSysBone BoneName="ROOTTRANSFORM" FXParticleSystemTemplate="GDIDebrisSmallFire" FollowBone="true" />
      	<ParticleSysBone BoneName="ROOTTRANSFORM" FXParticleSystemTemplate="GDIDebrisSmallFireDistortion" FollowBone="true" />
      	<ParticleSysBone BoneName="ROOTTRANSFORM" FXParticleSystemTemplate="GDIDebrisSmallSmoke" FollowBone="true" />
    	</ModelConditionState>
    	<AnimationState ParseCondStateType="PARSE_DEFAULT">
      	<Animation AnimationName="NBTSLaser_DPLY" AnimationMode="MANUAL" Flags="START_FRAME_FIRST" />
    	</AnimationState>
    	<AnimationState ParseCondStateType="PARSE_NORMAL" ConditionsYes="STRUCTURE_UNPACKING">
      	<Animation AnimationName="NBTSLaser_AAN" AnimationMode="ONCE" />
    	</AnimationState>
    	<AnimationState ParseCondStateType="PARSE_NORMAL" ConditionsYes="UNPACKING">
      	<Animation AnimationName="NBTSLaser_DPLY" AnimationMode="ONCE" AnimationBlendTime="0" AnimationSpeedFactorMin="1.0" AnimationSpeedFactorMax="1.0" />
    	</AnimationState>
    	<AnimationState ParseCondStateType="PARSE_NORMAL" ConditionsYes="PACKING" Flags="START_FRAME_LAST">
      	<Animation AnimationName="NBTSLaser_DPLY" AnimationMode="ONCE_BACKWARDS" AnimationBlendTime="0" AnimationSpeedFactorMin="0.5" AnimationSpeedFactorMax="0.5" />
    	</AnimationState>
    	<AnimationState ParseCondStateType="PARSE_NORMAL" ConditionsYes="ATTACKING" Flags="START_FRAME_LAST">
      	<Animation AnimationName="NBTSLaser_DPLY" AnimationMode="MANUAL" />
    	</AnimationState>
  	</ScriptedModelDraw>


Any help is appreciated!

Edited by Madin, 07 January 2012 - 21:40.


#2 Golan

    <Charcoal tiles available>

  • Member Test
  • 3300 posts

Posted 09 January 2012 - 10:56

AFAIK the deployAI does not work with stationary objects. deployAI is constructed around toggling between mobile and immobile states which is not possible for always immobile objects.
I've been using transition states to do the TSR Laser. When going from Idle (PARSE_DEFAULT) to Attacking (PARSE_NORMAL:ATTACKING) it will trigger a Transition state (PARSE_TRANSITION) playing the unpack animation. There's a similar state for the other direction. With this solution, you need to give the Laser a preattackdelay long enough to cover unpacking, however. This can cause timing glitches but works smoothly most of the time.
You could try improving this by first using a dummy weapon to go from idle->attacking, then enable the actual weapon (via status or LUA upgrade). Dunno how you could properly disable it while packing, seeing how it often tends to pop back up if an enemy approaches while it's packing.
Now go out and procreate. IN THE NAME OF DOOM!

#3 Madin

    Amateur

  • Member
  • 138 posts

Posted 12 January 2012 - 13:36

Thanks for the information.
Trying to get pop-ups to work smoothly is bizarrely difficult. I'll try your suggested methods at a future date.



2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users