Jump to content


Multiple fixed turret code issues


No replies to this topic

#1 Madin

    Amateur

  • Member
  • 138 posts

Posted 05 September 2012 - 17:25

Posted Image

I have an advanced guard tower, that I would like to fire a missile from 3 slots on each of the 4 sides.

How would I go about getting this to work efficiently?

I tried setting up 4 turrets (one for each side), coding it so they do not move.
Setting up 4 different natural turret angles.
And finally having a weapon that could target 45d that was given to each turret.

Relevant Draw code:
  	<scriptedModelDraw id="ModuleTag_Draw" OkToChangeModelColor="true" ExtraPublicBone="Weapon_FXA01 Weapon_FXA02 Weapon_FXA03 Weapon_FXB01 Weapon_FXB02 Weapon_FXB03 Weapon_FXC01 Weapon_FXC02 Weapon_FXC03 Weapon_FXD01 Weapon_FXD02 Weapon_FXD03">
    	<ModelConditionState ParseCondStateType="PARSE_DEFAULT">
      	<Model Name="GB_AGT" />
      	<WeaponFireFXBone WeaponSlotID="1" WeaponSlotType="PRIMARY_WEAPON" BoneName="FX_Weapon" />
      	<WeaponFireFXBone WeaponSlotID="2" WeaponSlotType="PRIMARY_WEAPON" BoneName="FX_Weapon" />
      	<WeaponFireFXBone WeaponSlotID="3" WeaponSlotType="PRIMARY_WEAPON" BoneName="FX_Weapon" />
      	<WeaponFireFXBone WeaponSlotID="4" WeaponSlotType="PRIMARY_WEAPON" BoneName="FX_Weapon" />
      	<WeaponLaunchBone WeaponSlotType="PRIMARY_WEAPON" BoneName="Weapon_FXA" WeaponSlotID="1" />
      	<WeaponLaunchBone WeaponSlotType="PRIMARY_WEAPON" BoneName="Weapon_FXB" WeaponSlotID="2" />
      	<WeaponLaunchBone WeaponSlotType="PRIMARY_WEAPON" BoneName="Weapon_FXC" WeaponSlotID="3" />
      	<WeaponLaunchBone WeaponSlotType="PRIMARY_WEAPON" BoneName="Weapon_FXD" WeaponSlotID="4" />
      	<Turret TurretNameKey="Weapon_FXA02" TurretID="1" TurretArtPitch="40d" />
      	<Turret TurretNameKey="Weapon_FXB02" TurretID="2" TurretArtPitch="40d" />
      	<Turret TurretNameKey="Weapon_FXC02" TurretID="3" TurretArtPitch="40d" />
      	<Turret TurretNameKey="Weapon_FXD02" TurretID="4" TurretArtPitch="40d" />


Relevant WeaponSet Update:
  	<WeaponSetUpdate id="ModuleTag_Weapon01SetUpdate">
    	<WeaponSlotTurret ID="1">
      	<Weapon Ordering="PRIMARY_WEAPON" Template="AGTRocketWeapon" />
      	<TurretSettings MaxDeflectionAntiClockwise="0d" MaxDeflectionClockwise="0d">
        	<TurretAITargetChooserData />
      	</TurretSettings>
    	</WeaponSlotTurret>
  	</WeaponSetUpdate>
  	<WeaponSetUpdate id="ModuleTag_Weapon02SetUpdate">
    	<WeaponSlotTurret ID="2">
      	<Weapon Ordering="PRIMARY_WEAPON" Template="AGTRocketWeapon" />
      	<TurretSettings MaxDeflectionAntiClockwise="0d" MaxDeflectionClockwise="0d" NaturalTurretAngle="270d">
        	<TurretAITargetChooserData />
      	</TurretSettings>
    	</WeaponSlotTurret>
  	</WeaponSetUpdate>
  	<WeaponSetUpdate id="ModuleTag_Weapon03SetUpdate">
    	<WeaponSlotTurret ID="3">
      	<Weapon Ordering="PRIMARY_WEAPON" Template="AGTRocketWeapon" />
      	<TurretSettings MaxDeflectionAntiClockwise="0d" MaxDeflectionClockwise="0d" NaturalTurretAngle="180d">
        	<TurretAITargetChooserData />
      	</TurretSettings>
    	</WeaponSlotTurret>
  	</WeaponSetUpdate>
  	<WeaponSetUpdate id="ModuleTag_Weapon04SetUpdate">
    	<WeaponSlotTurret ID="4">
      	<Weapon Ordering="PRIMARY_WEAPON" Template="AGTRocketWeapon" />
      	<TurretSettings MaxDeflectionAntiClockwise="0d" MaxDeflectionClockwise="0d" NaturalTurretAngle="90d">
        	<TurretAITargetChooserData />
      	</TurretSettings>
    	</WeaponSlotTurret>
  	</WeaponSetUpdate>


Weapon code:
  <WeaponTemplate id="AGTRocketWeapon" Name="AGTRocketWeapon" AttackRange="350.0" WeaponSpeed="200" MinWeaponSpeed="300" MaxWeaponSpeed="310" FireFX="FX_GDIMissileManFire" FireSound="GDI_MissileSoldier_MissileFire" AcceptableAimDelta="45d" PreAttackType="PER_TARGET" ReAcquireDetailType="PER_CLIP" ClipSize="3" AntiMask="ANTI_GROUND ANTI_AIRBORNE_VEHICLE ANTI_AIRBORNE_INFANTRY" CanFireWhileMoving="true" AutoReloadWhenIdleSeconds="2s">
	<PreAttackDelay MinSeconds=".5s" MaxSeconds=".5s" />
	<FiringDuration MinSeconds="1.0s" MaxSeconds="1.2s" />
	<ClipReloadTime MinSeconds="0.8s" MaxSeconds="1.2s" />
	<Nuggets>
  	<ProjectileNugget WarheadTemplate="NODRocketWarhead" ProjectileTemplate="RocketSoldierRocketProjectile"></ProjectileNugget>


What happens with this set-up is that it fires at a target 3 turrets are able to fire at the motionless target. I of course wanted it so that a motionless target can only get hit by the turret whose side it is facing.

What are my best options?

Also I've about having a parse_transition from a firing to a default state, but I am unsure how to do this, any coding tips please?

Covering flap Draw code:
  	<!-- DRAW FLAPS-->
  	<scriptedModelDraw id="ModuleTag_Draw_Flaps" OkToChangeModelColor="true">
    	<ModelConditionState ParseCondStateType="PARSE_DEFAULT">
      	<Model Name="GB_AGTFlaps" />
    	</ModelConditionState>
    	<AnimationState ParseCondStateType="PARSE_NORMAL" ConditionsYes="PREATTACK_A">
      	<Animation AnimationName="GB_AGTFlaps_ATTA" AnimationMode="ONCE" />
    	</AnimationState>
    	<AnimationState ParseCondStateType="PARSE_NORMAL" ConditionsYes="FIRING_OR_RELOADING_A" Flags="START_FRAME_LAST">
      	<Animation AnimationName="GB_AGTFlaps_ATTA" AnimationMode="MANUAL" />
    	</AnimationState>
  	</ScriptedModelDraw>


Thanks for any help!



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users