logo   login
right
Home Forums Downloads Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Forum Info
Forum Members: 18,537
Total Threads: 8,627
Posts: 94,210

Administrators:
DeeZire, Redemption

There are currently 97 users online.
Partner Links

Free Credit Repair

Learn the Ticket Broker Secrets
Advertisements


Tiberium Wars Editing Discuss any modding related issues to do with Tiberium Wars here.

Reply
 
LinkBack Thread Tools
Old 04-20-2008, 06:19 AM   #1 (permalink)
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  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-20-2008, 02:18 PM   #2 (permalink)
Senior Member
 
CommieDog's Avatar
 
Join Date: Oct 2004
Location: Alaska (Hell Frozen Over)
Posts: 368
Default

I'm not sure if this is the cause of the problem, but I noticed that CanPickDynamicTargets="true" is absent in the TurretAITargetChooserData element.
CommieDog is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-25-2008, 08:01 AM   #3 (permalink)
Junior Member
 
General_Subway's Avatar
 
Join Date: Apr 2007
Location: Dresden, Germany
Posts: 15
Send a message via ICQ to General_Subway
Default

Hello CommieDog!

I've added it, but without success... but thx for yor help!

Greetz
G.S.
General_Subway is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-26-2008, 07:15 PM   #4 (permalink)
Junior Member
 
General_Subway's Avatar
 
Join Date: Apr 2007
Location: Dresden, Germany
Posts: 15
Send a message via ICQ to General_Subway
Exclamation a solution

Greetings!

I've found a possible solution with creating a dummy weapon for aiming. This Dummy is the new primary weapon, the machinegun is second and the launcher third. If now an enemy occurs, the dummy weapon aims to him (align the turret correctly without starting the idle-scan while using secondary weapon) and machinegun (enemy infantry) or launcher (enemy vehicle and structure) do the rest.

The code:

Code:
<ModelConditionState
	ParseCondStateType="PARSE_DEFAULT">
	<Model
		Name="AUJeep" />
        <WeaponLaunchBone
		WeaponSlotID="1"
		WeaponSlotType="PRIMARY_WEAPON"
		BoneName="WEAPON01"/>
	<WeaponFireFXBone
		WeaponSlotID="1"
		WeaponSlotType="SECONDARY_WEAPON"
		BoneName="WEAPON01" />
	<WeaponRecoilBone
		WeaponSlotID="1"
		WeaponSlotType="SECONDARY_WEAPON"
		BoneName="WEAPON01" />
	<WeaponMuzzleFlash
		WeaponSlotID="1"
		WeaponSlotType="SECONDARY_WEAPON"
		BoneName="WEAPON01" />
	<WeaponLaunchBone
		WeaponSlotID="1"
		WeaponSlotType="SECONDARY_WEAPON"
		BoneName="WEAPON01" />
	<WeaponFireFXBone
		WeaponSlotID="1"
		WeaponSlotType="TERTIARY_WEAPON"
		BoneName="WEAPON02" />
	<WeaponLaunchBone
		WeaponSlotID="1"
		WeaponSlotType="TERTIARY_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="AimWeapon" />
                        <Weapon
				Ordering="SECONDARY_WEAPON"
				Template="MachineGun" />
			<Weapon
				Ordering="TERTIARY_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 TERTIARY_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>
The AimWeapon (add to weapon.xml). The AttackRange of all three weapons must be equal to make this working.

Code:
<WeaponTemplate
	id="AimWeapon"
	Name="AimWeapon"
	AttackRange="250.0" 
	WeaponSpeed="999999.0"
	AcceptableAimDelta="1d"
	RadiusDamageAffects="ALLIES ENEMIES NEUTRALS"
	AntiMask="ANTI_GROUND ANTI_AIRBORNE_VEHICLE ANTI_AIRBORNE_INFANTRY"
	CanFireWhileMoving="true"
	ClipSize="1"
	ReAcquireDetailType="PER_CLIP">
		<FiringDuration
				MinSeconds="0.1s"
				MaxSeconds="0.1s" />
		<ClipReloadTime
			MinSeconds="0.2s"
			MaxSeconds="0.2s" />
		<Nuggets>
			
			<SuppressionNugget
				Radius="25.0"
				Suppression="25"
				DurationSeconds="2s">
				
			</SuppressionNugget>
		</Nuggets>
</WeaponTemplate>
Better solutions welcome!

Greetz
G.S.
General_Subway is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:15 PM.


Design By: Miner Skinz.com
Powered by vBulletin® Version 3.7.0 Release Candidate 2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.