IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Turrets And choppers. Can they mix?, Does the jetai update tag break turret logic?
GearsGoAwryMan
post 10 Oct 2016, 23:07
Post #1



Group Icon

Group: Members
Posts: 53
Joined: 17 July 2015
Member No.: 11785



Hello again, after making a helicopter model and insterting it into the game, i ran into a rather weird interaction. normally you can use the aiupdateinterface tag to code turrets on a vehicle or likewise, but doing so on a chopper using refurbished comanche code breaks the code. I also cannot seem to include the extra turrets into the main jetaiupdate tag without again breaking the code. Does the jetai update just break turrets? and if it does, is it possible to somehow replace the jetai update using a locomotor?

Below is the current code for the chopper, in working condition. Some of my attempts at coding in the two extra turrets can be seen in comments.

CODE

;------------------------------------------------------------------------------
Object WestonbirtAmericaRook

; *** ART Parameters ***
SelectPortrait = SACCommanche_L
ButtonImage = SACCommanche

UpgradeCameo1 = Upgrade_AmericaAdvancedTraining
UpgradeCameo2 = Upgrade_AmericaCountermeasures
;UpgradeCameo3 = Upgrade_AmericaCountermeasures
;UpgradeCameo4 = NONE
;UpgradeCameo5 = NONE

Draw = W3DModelDraw ModuleTag_01

DefaultConditionState
Model = WBACH
; HideSubObject = MissileUpgrade
Animation = WBACH.WBACH
AnimationMode = LOOP
WeaponMuzzleFlash = PRIMARY TurretFX03
WeaponFireFXBone = PRIMARY Muzzle01
WeaponMuzzleFlash = SECONDARY TurretFX05
WeaponFireFXBone = SECONDARY Muzzle03
WeaponMuzzleFlash = TERTIARY TurretFX06
WeaponFireFXBone = TERTIARY Muzzle04

; WeaponFireFXBone = SECONDARY Muzzle
; WeaponLaunchBone = SECONDARY Muzzle
End

ConditionState = REALLYDAMAGED
Model = WBACH
Animation = WBACH.WBACH
AnimationMode = LOOP
End

; ConditionState = WEAPONSET_PLAYER_UPGRADE
; ShowSubObject = MissileUpgrade
; Animation = AVComanche.AVComanche
; AnimationMode = LOOP
; WeaponFireFXBone = TERTIARY WeaponB
; WeaponLaunchBone = TERTIARY WeaponB
; End

; ConditionState = WEAPONSET_PLAYER_UPGRADE REALLYDAMAGED
; Model = AVComanche_d
; ShowSubObject = MissileUpgrade
; Animation = AVComanche_d.AVComanche_d
; AnimationMode = LOOP
; WeaponFireFXBone = TERTIARY WeaponB
; WeaponLaunchBone = TERTIARY WeaponB
; End

ConditionState = RUBBLE
Model = WBACH
Animation = WBACH.WBACH
AnimationMode = LOOP
End

ConditionState = RUBBLE SPECIAL_DAMAGED
Model = WBACH
HideSubObject = AVComanche_Prop
End

OkToChangeModelColor = Yes
End

; ***DESIGN parameters ***
DisplayName = OBJECT:Rook
EditorSorting = VEHICLE
Side = WestonbirtAmerica
TransportSlotCount = 0 ;how many "slots" we take in a transport (0 == not transportable)
VisionRange = 200.0
ShroudClearingRange = 600
Prerequisites
Object = WestonbirtAmericaAirfield
End

WeaponSet
Conditions = None
; -----
Weapon = PRIMARY WestonbirtComanche20mmCannonWeapon
PreferredAgainst = PRIMARY INFANTRY
AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
; -----
Weapon = SECONDARY WestonbirtRookTankGun
PreferredAgainst = SECONDARY VEHICLE STRUCTURE
AutoChooseSources = SECONDARY FROM_PLAYER FROM_SCRIPT FROM_AI
; -----
Weapon = TERTIARY WestonbirtRookTankGunDouble
PreferredAgainst = TERTIARY VEHICLE STRUCTURE
AutoChooseSources = TERTIARY FROM_PLAYER FROM_SCRIPT FROM_AI
End
; WeaponSet
; Conditions = PLAYER_UPGRADE
; ; -----
; Weapon = PRIMARY Comanche20mmCannonWeapon
; PreferredAgainst = PRIMARY INFANTRY
; AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
; ; -----
; Weapon = SECONDARY ComancheAntiTankMissileWeapon
; PreferredAgainst = SECONDARY VEHICLE STRUCTURE
; AutoChooseSources = SECONDARY FROM_PLAYER FROM_SCRIPT FROM_AI
; ; -----
; Weapon = TERTIARY ComancheRocketPodWeapon
; AutoChooseSources = TERTIARY NONE
; End
ArmorSet
Conditions = None
Armor = ComancheArmor
DamageFX = None
End
ArmorSet
Conditions = PLAYER_UPGRADE
Armor = CountermeasuresComancheArmor
DamageFX = None
End
BuildCost = 1500
BuildTime = 20 ; in seconds
ExperienceValue = 50 50 100 200 ; Experience point value at each level
ExperienceRequired = 0 100 200 400 ; Experience points needed to gain each level
IsTrainable = Yes ; Can gain experience
CommandSet = WestonbirtAmericaVehicleRookCommandSet

; *** AUDIO Parameters ***
VoiceSelect = ComancheVoiceSelect
VoiceMove = ComancheVoiceMove
VoiceGuard = ComancheVoiceMove
VoiceAttack = ComancheVoiceAttack
SoundAmbient = ComancheAmbientLoop
SoundAmbientRubble = NoSound
UnitSpecificSounds
; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
VoiceCreate = ComancheVoiceCreate
SoundEject = PilotSoundEject
VoiceEject = PilotVoiceEject
Afterburner = RaptorAfterburner
VoiceGarrison = ComancheVoiceMove
TurretMoveStart = NoSound
TurretMoveLoop = NoSound
VoiceFireRocketPods = ComancheVoiceAttackRocket
End


; *** ENGINEERING Parameters ***
RadarPriority = UNIT
KindOf = PRELOAD CAN_CAST_REFLECTIONS CAN_ATTACK SELECTABLE VEHICLE SCORE AIRCRAFT PRODUCED_AT_HELIPAD

; Behavior = WeaponSetUpgrade ModuleTag_02
; TriggeredBy = Upgrade_ComancheRocketPods
; End
Behavior = ExperienceScalarUpgrade ModuleTag_03
TriggeredBy = Upgrade_AmericaAdvancedTraining
AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
End

Body = ActiveBody ModuleTag_04
MaxHealth = 220.0
InitialHealth = 220.0
End

Behavior = FXListDie ModuleTag_05
DeathFX = FX_ComancheStartDeath
End

Behavior = JetAIUpdate ModuleTag_06
MinHeight = 5
NeedsRunway = No
KeepsParkingSpaceWhenAirborne = No
AutoAcquireEnemiesWhenIdle = Yes
; note that comanches do not return to base when idle

; this is a bit of a trick... normally, units cannot move-and-fire at
; the same time. we need the comanche to be able to. so we give it
; a "turret" (invisible) and put the two main weapons on it, but with
; no turn rate. voila!
Turret
TurretTurnRate = 0 ; this "turret" does not turn
TurretPitchRate = 0 ; nor does it pitch
ControlledWeaponSlots = PRIMARY
End

; Turret
; ControlledWeaponSlots = SECONDARY
; TurretTurnRate = 180 // turn rate, in degrees per sec
; TurretPitchRate = 180
; AllowsPitch = Yes
; ;NaturalTurretPitch = 45
; AcceptableAimDelta = 90
; End

; Turret
; ControlledWeaponSlots = TERTIARY
; TurretTurnRate = 180 // turn rate, in degrees per sec
; TurretPitchRate = 180
; AllowsPitch = Yes
; ;NaturalTurretPitch = 45
; AcceptableAimDelta = -90
; End
End
Locomotor = SET_NORMAL ComancheLocomotor
Locomotor = SET_TAXIING BasicHelicopterTaxiLocomotor

Behavior = PhysicsBehavior ModuleTag_07
Mass = 50.0
End
Behavior = HelicopterSlowDeathBehavior ModuleTag_08
DestructionDelay = 99999999 ; the destruction delay
SpiralOrbitTurnRate = 140.0 ; in degrees per second, bigger # = tighter spiral
SpiralOrbitForwardSpeed = 350.0 ; bigger # = larger spiral
SpiralOrbitForwardSpeedDamping = .9999 ; smaller #'s = slow down faster
MaxBraking = 190 ; max braking we can use during death spiral (lower num = wilder spiral)
SoundDeathLoop = ComancheDamagedLoop
MinSelfSpin = 100 ; in degrees per second
MaxSelfSpin = 300 ; in degrees per second
SelfSpinUpdateDelay = 100 ; in milliseconds
SelfSpinUpdateAmount = 10 ; in degrees
FallHowFast = 12.0% ; fraction of gravity, lower = take longer to fall
MinBladeFlyOffDelay = 1500 ; in milliseconds
MaxBladeFlyOffDelay = 1500 ; in milliseconds
AttachParticle = SootySmokeTrail
AttachParticleBone = Propeller02
BladeObjectName = ComancheBlades
BladeBoneName = Propeller01
; Most things that eject pilots do so immediately upon death,
; via use of EjectPilotDie, but Helicopters are a special case...
; they need to do so after their blades are ejected.
OCLEjectPilot = OCL_EjectPilotViaParachute
FXBlade = FX_HelicopterBladeExplosion
OCLBlade = OCL_HelicopterBladeExplosion
FXHitGround = FX_HelicopterHitGround
OCLHitGround = OCL_HelicopterHitGround
FXFinalBlowUp = FX_GroundedHelicopterBlowUp
OCLFinalBlowUp = OCL_GroundedHelicopterBlowUp
DelayFromGroundToFinalDeath = 1500
FinalRubbleObject = ComancheRubbleHull
End

Behavior = TransitionDamageFX ModuleTag_09
ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuousDown
ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_ComancheDamageTransition
End

Behavior = ArmorUpgrade ModuleTag_Armor01
TriggeredBy = Upgrade_AmericaCountermeasures
End

Behavior = CountermeasuresBehavior ModuleTag_10
TriggeredBy = Upgrade_AmericaCountermeasures
FlareTemplateName = CountermeasureFlare
FlareBoneBaseName = Flare ; Name of the base flare bone (Flare01, Flare02, Flare03)
VolleySize = 2 ; Number of flares launched per volley (requires bones)
VolleyArcAngle = 60.0 ; Max angle of flare relative to forward direction (with VolleySize of 1, flare will always goes straight back).
VolleyVelocityFactor = 2.0 ; Shoots out flares at a stronger velocity with a higher value.
DelayBetweenVolleys = 1000 ; Time between flare volleys
NumberOfVolleys = 3 ; Number of times the volleys will fire before reloading
ReloadTime = 4000 ; After all volleys launched, then reloading must occur. If 0, then reloading occurs at airstrip only.
EvasionRate = 30% ; With active flares, the specified percentage will be diverted.
ReactionLaunchLatency = 0 ; Reaction between getting shot at and the firing of the first volley of countermeasures.
MissileDecoyDelay = 200 ; A reported missile that has been determined to hit a decoy will wait this long before acquiring countermeasures.
End

Behavior = FlammableUpdate ModuleTag_21
AflameDuration = 5000 ; If I catch fire, I'll burn for this long...
AflameDamageAmount = 3 ; taking this much damage...
AflameDamageDelay = 500 ; this often.
End

; Behavior = AIUpdateInterface ModuleTag_03
; Turret
; ControlledWeaponSlots = SECONDARY
; TurretTurnRate = 180 // turn rate, in degrees per sec
; TurretPitchRate = 180
; AllowsPitch = Yes
; ;NaturalTurretPitch = 45
; AcceptableAimDelta = 90
; End



; AutoAcquireEnemiesWhenIdle = Yes
; MoodAttackCheckRate = 500 ; default is 2000
; End

; Behavior = AIUpdateInterface ModuleTag_2
; Turret
; ControlledWeaponSlots = TERTIARY
; TurretTurnRate = 180 // turn rate, in degrees per sec
; TurretPitchRate = 180
; AllowsPitch = Yes
; ; NaturalTurretPitch = 45
; AcceptableAimDelta = -90
; End

; AutoAcquireEnemiesWhenIdle = Yes
; MoodAttackCheckRate = 500 ; default is 2000
; End









Geometry = BOX
GeometryMajorRadius = 20.0
GeometryMinorRadius = 3.0
GeometryHeight = 25.0
GeometryIsSmall = No
Shadow = SHADOW_VOLUME
ShadowSizeX = 89 ; minimum elevation angle above horizon. Used to limit shadow length

End




(PS: I have been trying to get the main comanche machinegun to alternate fire between two barrels like the overlord tank, but i don't seem to have managed that. Last i heard the overlord had very specific requirements and a load of weird interactions. does anyone know how you can designate that behavior between the different barrels for the different weapons?)
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 16 April 2024 - 21:05