velosong
  • velosong
  • 50.25% (Neutral)
  • Private Topic Starter
12 years ago
Believe me, I`ve read many topics about this isuee here. Some of them give me hints, but the isuee is still there.

There are 2 weapons on an aircraft, the one is Anti-air weapon, the other is Anti-ground weapon. They are switched by command button.
Either one works perfect when exists alone, but once put the AA and AG weapon together, they are not able to distinguish their targets assigned. The aircraft just attack the nearest target, both air and ground. The AA mode and AG mode switching is failed.

Here s my object and weapon. Waitting for help.


;------------------------------------------------------------------------------
Object USAF_E3

; *** ART Parameters ***
SelectPortrait = IMG_E3
...(skip). .
Draw = W3DModelDraw ModuleTag_01
DefaultConditionState
Model =E3
Turret = TurretAA
AltTurret = TurretAG
ShowSubObject = Turret
ShowSubObject = AltTurret
WeaponLaunchBone = PRIMARY Weapon01
WeaponLaunchBone = SECONDARY Weapon02
WeaponLaunchBone = TERTIARY Weapon03
....(skip)....

; *****DESIGN parameters *****
DisplayName = OBJECT:E3
EditorSorting = VEHICLE
Side = USAF
VisionRange = 3000.0
ShroudClearingRange = 320
Prerequisites
Object = USAF_JSOC
End
BuildCost = 6500
BuildTime = 30.0

WeaponSet
Conditions = None
Weapon = PRIMARY AAmodeWeapon
Weapon = SECONDARY AGmodeWeapon
PreferredAgainst = PRIMARY AIRCRAFT
PreferredAgainst = SECONDARY VEHICLE

ShareWeaponReloadTime = Yes
WeaponLockSharedAcrossSets = Yes
End
....(skip)....

; *** ENGINEERING Parameters ***
RadarPriority = UNIT
KindOf = PRELOAD CAN_CAST_REFLECTIONS CAN_ATTACK SELECTABLE VEHICLE SCORE AIRCRAFT ATTACK_NEEDS_LINE_OF_SIGHT
....(skip)....

Behavior = JetAIUpdate ModuleTag_07
Turret
TurretTurnRate = 360
ControlledWeaponSlots = PRIMARY
End
AltTurret
TurretTurnRate = 360
ControlledWeaponSlots = SECONDARY
End
AutoAcquireEnemiesWhenIdle = Yes STEALTHED
OutOfAmmoDamagePerSecond = 10%
TakeoffDistForMaxLift = 0%
TakeoffPause = 2000
MinHeight = 5
ParkingOffset = 3
ReturnToBaseIdleTime = 3600000
End

Locomotor = SET_NORMAL AircraftLocomotor
Locomotor = SET_TAXIING BasicJetTaxiLocomotor
....(skip)....






;------------------------------------------------------------------------------
Weapon AAmodeWeapon
PrimaryDamage = 0.01
PrimaryDamageRadius = 10.0
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS NOT_SIMILAR
ScatterRadius = 0
ScatterRadiusVsInfantry = 10.0
AttackRange = 1700.0
MinimumAttackRange = 5.0
AcceptableAimDelta = 22
DamageType = Laser
DeathType = NORMAL

ProjectileObject = infoObject
WeaponSpeed = 5000
FireSound = infoObjectsound
DelayBetweenShots = 10
ClipSize = 0
ClipReloadTime = 100
AutoReloadsClip = Yes
ProjectileCollidesWith = STRUCTURES

AntiAirborneVehicle = Yes
AntiAirborneInfantry = No
AntiBallisticMissile = Yes
AntiSmallMissile = Yes
AntiProjectile = No
AntiGround = No
RequestAssistRange = 2000
End





Weapon AGmodeWeapon
PrimaryDamage = 0.01
PrimaryDamageRadius = 10.0
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS NOT_SIMILAR
ScatterRadius = 0
ScatterRadiusVsInfantry = 10.0
AttackRange = 1700.0
MinimumAttackRange = 5.0
AcceptableAimDelta = 22
DamageType = Laser
DeathType = NORMAL

ProjectileObject = infoObject
WeaponSpeed = 5000
FireSound = infoObjectsound
DelayBetweenShots = 10
ClipSize = 0
ClipReloadTime = 100
AutoReloadsClip = Yes
ProjectileCollidesWith = STRUCTURES

AntiAirborneVehicle = No
AntiAirborneInfantry = No
AntiBallisticMissile = No
AntiSmallMissile = No
AntiProjectile = No
AntiGround = Yes
End


A BF2 modder excited in CNC Modding
Sponsor
CommieDog
12 years ago
Try taking a look at the Ranger object.
UserPostedImage 
CommieDog: Because someone has to do your dirty work for you
velosong
  • velosong
  • 50.25% (Neutral)
  • Private Topic Starter
12 years ago

Try taking a look at the Ranger object.



I scan the Ranger object. Some suspicious code has been found, but the AA weapon still attack ground units even modified the code as Ranger looks like.

here is my modified code (the green one), also the suspicious codes but seem doesnt work



;------------------------------------------------------------------------------
Object USAF_E3

; *** ART Parameters ***
SelectPortrait = IMG_E3
...(skip). .
Draw = W3DModelDraw ModuleTag_01
DefaultConditionState
Model =E3
Turret = TurretAA
AltTurret = TurretAG
ShowSubObject = Turret
ShowSubObject = AltTurret
WeaponLaunchBone = PRIMARY Weapon01
WeaponLaunchBone = SECONDARY Weapon02
WeaponLaunchBone = TERTIARY Weapon03
....(skip)....

; *****DESIGN parameters *****
DisplayName = OBJECT:E3
EditorSorting = VEHICLE
Side = USAF
VisionRange = 3000.0
ShroudClearingRange = 320
Prerequisites
Object = USAF_JSOC
End
BuildCost = 6500
BuildTime = 30.0

WeaponSet
Conditions = None
Weapon = PRIMARY AAmodeWeapon
Weapon = SECONDARY AGmodeWeapon
AutoChooseSources = PRIMARY FROM_SCRIPT FROM_AI DEFAULT_SWITCH_WEAPON
AutoChooseSources = SECONDARY FROM_SCRIPT FROM_AI

PreferredAgainst = PRIMARY AIRCRAFT
PreferredAgainst = SECONDARY VEHICLE

ShareWeaponReloadTime = Yes
WeaponLockSharedAcrossSets = Yes
End
....(skip)....

; *** ENGINEERING Parameters ***
RadarPriority = UNIT
KindOf = PRELOAD CAN_CAST_REFLECTIONS CAN_ATTACK SELECTABLE VEHICLE SCORE AIRCRAFT ATTACK_NEEDS_LINE_OF_SIGHT
....(skip)....


Behavior = LockWeaponCreate ModuleTag_24
;Prevents indeterminate state plus two unpickable weapons equaling no attack.
SlotToLock = PRIMARY
End
Behavior = CommandButtonHuntUpdate ModuleTag_25
End


Behavior = JetAIUpdate ModuleTag_07
Turret
TurretTurnRate = 360
ControlledWeaponSlots = PRIMARY
End
AltTurret
TurretTurnRate = 360
ControlledWeaponSlots = SECONDARY
End
AutoAcquireEnemiesWhenIdle = Yes STEALTHED
OutOfAmmoDamagePerSecond = 10%
TakeoffDistForMaxLift = 0%
TakeoffPause = 2000
MinHeight = 5
ParkingOffset = 3
ReturnToBaseIdleTime = 3600000
End
....(skip)....



A BF2 modder excited in CNC Modding