View Single Post
Old 04-20-2008, 06:19 AM   #1 (permalink)
General_Subway
Junior Member
 
General_Subway's Avatar
 
Join Date: Apr 2007
Location: Dresden, Germany
Posts: 15
Send a message via ICQ to General_Subway
Question "Two weapons in one turret"-Problem

Hi!

I've created a unit with a machine gun and a missile launcher in one turret. The machine gun is the primary weapon and used against infantry, the launcher is the secondary weapon and used to destroy vehicles and structures. The problem: It works fine when the primary weapon is used, if the missile launcher is firing, the turret starts with the "idle scan" animation. That looks really ugly...

The code parts (only relevant parts):

Code:
<ModelConditionState
	ParseCondStateType="PARSE_DEFAULT">
	<Model
		Name="AUJeep" />
	<WeaponFireFXBone
                WeaponSlotID="1"
                WeaponSlotType="PRIMARY_WEAPON"
                BoneName="WEAPON01" />
	<WeaponRecoilBone
                WeaponSlotID="1"
                WeaponSlotType="PRIMARY_WEAPON"
                BoneName="WEAPON01" />
	<WeaponMuzzleFlash
		WeaponSlotID="1"
		WeaponSlotType="PRIMARY_WEAPON"	
             	BoneName="WEAPON01" />
	<WeaponLaunchBone
		WeaponSlotID="1"
		WeaponSlotType="PRIMARY_WEAPON"	
             	BoneName="WEAPON01" />
	<WeaponFireFXBone
		WeaponSlotID="1"
		WeaponSlotType="SECONDARY_WEAPON"
		BoneName="WEAPON02" />
	<WeaponLaunchBone
		WeaponSlotID="1"
		WeaponSlotType="SECONDARY_WEAPON"
		BoneName="WEAPON02"/>
	<Turret
		TurretNameKey="Turret"
		TurretPitch="Barrel"
		TurretID="1" />
</ModelConditionState>
<!--.......-->
<!--other unit stuff-->
<!--.......-->
<Behaviors>
	<WeaponSetUpdate
		id="ModuleTag_WeaponSetUpdate">
		<WeaponSlotTurret
                        ID="1"
                        AllowInterleavedFiring="true"
                        InterleavedStyle="INTERLEAVE_FIRST_AVAILABLE"
                        WeaponChoiceCriteria="PREFER_MOST_DAMAGE">
		<Weapon
			Ordering="PRIMARY_WEAPON"
			Template="MachineGun" />
		<Weapon
			Ordering="SECONDARY_WEAPON"
			Template="MissileLauncher" />
		<TurretSettings
			TurretTurnRate="200"
			TurretPitchRate="200"
			AllowsPitch="true"
			MinimumPitch="-15d"
			MinIdleScanTime="1.0s"
			MaxIdleScanTime="5.0s"
			MinIdleScanAngle="0.0"
			MaxIdleScanAngle="90.0"
                        ControlledWeaponSlots="PRIMARY_WEAPON SECONDARY_WEAPON">
                       <TurretAITargetChooserData
                            CanAcquireDynamicIfAssignedOutOfRange="true" />
                       </TurretSettings>
	          </WeaponSlotTurret>
</WeaponSetUpdate>
<!--other Behaviors-->
</Behaviors>
<AI>
	<AIUpdate
		id="ModuleTag_AI"
		AutoAcquireEnemiesWhenIdle="YES">
               <UnitAITargetChooserData
                      SympathyRange="100.0"
                      RotateToTargetWhenAiming="false" />
        </AIUpdate>
</AI>
Which code parts must be changed to avoid the turret's idle animation while using the secondary weapon?

Greets
G.S.
General_Subway is offline   Reply With Quote