Posted by: velosong - Saturday, March 15, 2014 12:47:42 PM
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. [quote] ;------------------------------------------------------------------------------ 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 [color=darkred] PreferredAgainst = PRIMARY AIRCRAFT PreferredAgainst = SECONDARY VEHICLE[/color] 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 [color=darkred] AutoAcquireEnemiesWhenIdle = Yes STEALTHED[/color] OutOfAmmoDamagePerSecond = 10% TakeoffDistForMaxLift = 0% TakeoffPause = 2000 MinHeight = 5 ParkingOffset = 3 ReturnToBaseIdleTime = 3600000 End Locomotor = SET_NORMAL AircraftLocomotor Locomotor = SET_TAXIING BasicJetTaxiLocomotor ....(skip).... [/quote] [quote] ;------------------------------------------------------------------------------ Weapon AAmodeWeapon PrimaryDamage = 0.01 PrimaryDamageRadius = 10.0 RadiusDamageAffects = ALLIES ENEMIES NEUTRALS NOT_SIMILAR [color=darkred] ScatterRadius = 0[/color] 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 [/quote] [quote] Weapon AGmodeWeapon PrimaryDamage = 0.01 PrimaryDamageRadius = 10.0 RadiusDamageAffects = ALLIES ENEMIES NEUTRALS NOT_SIMILAR [color=darkred] ScatterRadius = 0[/color] 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 [/quote]

Posted by: CommieDog - Saturday, March 15, 2014 3:28:44 PM
Try taking a look at the Ranger object.

Posted by: velosong - Saturday, March 15, 2014 11:28:29 PM
[quote]Try taking a look at the Ranger object.[/quote] 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 [quote] ;------------------------------------------------------------------------------ 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 [color=green]AutoChooseSources = PRIMARY FROM_SCRIPT FROM_AI DEFAULT_SWITCH_WEAPON AutoChooseSources = SECONDARY FROM_SCRIPT FROM_AI[/color] [color=darkred]PreferredAgainst = PRIMARY AIRCRAFT PreferredAgainst = SECONDARY VEHICLE[/color] 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).... [color=green] Behavior = LockWeaponCreate ModuleTag_24 ;Prevents indeterminate state plus two unpickable weapons equaling no attack. SlotToLock = PRIMARY End Behavior = CommandButtonHuntUpdate ModuleTag_25 End [/color] 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).... [/quote]