Apocalypse232
6 years ago
Hi there, I need help with my Marauders!
Recently, while playing the NProject mod for ZH, I noticed that the Marauder tank's turret is rotating, unlike in the original game, where the tank rotates its entire body to fire at a target if it is not right in front of it. I tried to do the same thing to the Marauders in my mod and I can tell you that the turret is rotating but the downside of this is that the Marauder is not moving at all while coming out of the Arms Dealer, even after selling it off! The tank won't move! It's just frozen and can only fire!

Here is the code from the Nproject mod:


Object Demo_GLATankMarauder

; *** ART Parameters ***
SelectPortrait = SUMarauder_L
ButtonImage = SUMarauder

UpgradeCameo1 = Upgrade_GLAJunkRepair
UpgradeCameo2 = Demo_Upgrade_SuicideBomb
;UpgradeCameo3 = NONE
;UpgradeCameo4 = NONE
;UpgradeCameo5 = NONE

Draw = W3DTankDraw ModuleTag_01
OkToChangeModelColor = Yes

; no crate upgrade
DefaultConditionState
Model = UVMarauder
Turret = Turret
ShowSubObject = Turret
HideSubObject = TurretUp01 TurretUp02
WeaponFireFXBone = PRIMARY BarrelMS
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY BarrelFX
WeaponLaunchBone = PRIMARY BarrelMS
End
ConditionState = REALLYDAMAGED
Model = UVMarauder_D
End
AliasConditionState = RUBBLE

; crate upgrade 1
ConditionState = WEAPONSET_CRATEUPGRADE_ONE
Model = UVMarauder
Turret = TurretUp01
ShowSubObject = TurretUp01
HideSubObject = Turret TurretUp02
WeaponFireFXBone = PRIMARY BarrelUp01MS
WeaponRecoilBone = PRIMARY BarrelUp01
WeaponMuzzleFlash = PRIMARY BarrelUp01FX
WeaponLaunchBone = PRIMARY BarrelUp01MS
End
ConditionState = WEAPONSET_CRATEUPGRADE_ONE REALLYDAMAGED
Model = UVMarauder_D
Turret = TurretUp01
ShowSubObject = TurretUp01
HideSubObject = Turret TurretUp02
WeaponFireFXBone = PRIMARY BarrelUp01MS
WeaponRecoilBone = PRIMARY BarrelUp01
WeaponMuzzleFlash = PRIMARY BarrelUp01FX
WeaponLaunchBone = PRIMARY BarrelUp01MS
End
AliasConditionState = WEAPONSET_CRATEUPGRADE_ONE RUBBLE

; crate upgrade 2
ConditionState = WEAPONSET_CRATEUPGRADE_TWO
Model = UVMarauder
Turret = TurretUp02
ShowSubObject = TurretUp02
HideSubObject = Turret TurretUp01
WeaponFireFXBone = PRIMARY BarrelUp02MS
WeaponRecoilBone = PRIMARY BarrelUp02
WeaponMuzzleFlash = PRIMARY BarrelUp02FX
WeaponLaunchBone = PRIMARY BarrelUp02MS
End
ConditionState = WEAPONSET_CRATEUPGRADE_TWO REALLYDAMAGED
Model = UVMarauder_D
Turret = TurretUp02
ShowSubObject = TurretUp02
HideSubObject = Turret TurretUp01
WeaponFireFXBone = PRIMARY BarrelUp02MS
WeaponRecoilBone = PRIMARY BarrelUp02
WeaponMuzzleFlash = PRIMARY BarrelUp02FX
WeaponLaunchBone = PRIMARY BarrelUp02MS
End
AliasConditionState = WEAPONSET_CRATEUPGRADE_TWO RUBBLE

TreadAnimationRate = 2.0 ; amount of tread texture to move per second
TreadDriveSpeedFraction = 0.3 ; fraction of locomotor speed below which treads stop moving.
TreadPivotSpeedFraction = 0.6 ; fraction of locomotor speed below which we allow pivoting.

TrackMarks = EXTnkTrack.tga

End

; ***DESIGN parameters ***
DisplayName = OBJECT:Marauder
Side = GLADemolitionGeneral
EditorSorting = VEHICLE

Prerequisites
Object = Demo_GLAArmsDealer
Science = SCIENCE_MarauderTank
End

BuildCost = 900
BuildTime = 10.0

TransportSlotCount = 3 ;how many "slots" we take in a transport (0 == not transportable)

VisionRange = 125
ShroudClearingRange = 300

WeaponSet
Conditions = None
Weapon = PRIMARY REDMarauderTankGun
Weapon = TERTIARY TerroristSuicideNotARealWeapon
AutoChooseSources = TERTIARY NONE
End
WeaponSet
Conditions = CRATEUPGRADE_ONE
Weapon = PRIMARY REDMarauderTankGunUpgradeOne
Weapon = TERTIARY TerroristSuicideNotARealWeapon
AutoChooseSources = TERTIARY NONE
End
WeaponSet
Conditions = CRATEUPGRADE_TWO
Weapon = PRIMARY REDMarauderTankGunUpgradeTwo
Weapon = TERTIARY TerroristSuicideNotARealWeapon
AutoChooseSources = TERTIARY NONE
End

ArmorSet
Conditions = None
Armor = TankArmor
DamageFX = TankDamageFX
End

ExperienceValue = 100 100 200 300 ;Experience point value at each level
ExperienceRequired = 0 200 300 600 ;Experience points needed to gain each level
IsTrainable = Yes ;Can gain experience

CrusherLevel = 2 ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
CrushableLevel = 2 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles

CommandSet = Demo_GLATankMarauderCommandSet

; *** AUDIO Parameters ***
VoiceSelect = MarauderTankVoiceSelect
VoiceMove = MarauderTankVoiceMove
VoiceGuard = MarauderTankVoiceMove
VoiceAttack = MarauderTankVoiceAttack

SoundMoveStart = MarauderTankMoveStart
SoundMoveStartDamaged = MarauderTankMoveStart

UnitSpecificSounds
VoiceCreate = MarauderTankVoiceCreate
VoiceCrush = MarauderTankVoiceCrush
VoiceEnter = MarauderTankVoiceMove
VoiceGarrison = MarauderTankVoiceMove
VoiceSalvage = MarauderTankVoiceSalvage

TurretMoveStart = NoSound
TurretMoveLoop = TurretMoveLoop
End

; *** ENGINEERING Parameters ***
RadarPriority = UNIT
KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS SALVAGER WEAPON_SALVAGER VEHICLE SCORE

Body = ActiveBody ModuleTag_02
MaxHealth = 500.0
InitialHealth = 500.0

; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
SubdualDamageCap = 860
SubdualDamageHealRate = 500
SubdualDamageHealAmount = 50
End

; ===== AI Modules =====
Behavior = AIUpdateInterface ModuleTag_03
Turret
ControlledWeaponSlots = PRIMARY
TurretTurnRate = 80
RecenterTime = 5000 ; how long to wait during idle before recentering
End
AutoAcquireEnemiesWhenIdle = Yes
End

Locomotor = SET_NORMAL MarauderLocomotor

Behavior = PhysicsBehavior ModuleTag_04
Mass = 50.0
End

; ===== Factory and Upgrades =====

; --- Junk Repair
Behavior = AutoHealBehavior ModuleTag_05
HealingAmount = 2
HealingDelay = 1000 ; msec
TriggeredBy = Upgrade_GLAJunkRepair
End

; --- Suicide Upgrade (DemoGeneral)
Behavior = CommandSetUpgrade ModuleTag_24
CommandSet = Demo_GLATankMarauderCommandSetUpgrade
TriggeredBy = Demo_Upgrade_SuicideBomb
End

Behavior = FireWeaponWhenDeadBehavior ModuleTag998
DeathTypes = NONE +SUICIDED +CRUSHED +SPLATTED
DeathWeapon = Demo_SuicideDynamitePackPlusFire
StartsActive = No
TriggeredBy = Demo_Upgrade_SuicideBomb
End
Behavior = FireWeaponWhenDeadBehavior ModuleTag999
DeathTypes = ALL -SUICIDED -CRUSHED -SPLATTED
DeathWeapon = Demo_DestroyedWeapon
StartsActive = No
TriggeredBy = Demo_Upgrade_SuicideBomb
End

; ===== Damage and Death FX =====
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 = TransitionDamageFX ModuleTag_08
ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
End

Behavior = SlowDeathBehavior ModuleTag_06
DeathTypes = ALL -CRUSHED -SPLATTED
DestructionDelay = 1000
DestructionDelayVariance = 300
FX = INITIAL FX_CrusaderCatchFire
OCL = FINAL OCL_MarauderTankDeathEffect
FX = FINAL FX_BattleMasterExplosionOneFinal
End

Behavior = InstantDeathBehavior ModuleTag_09
DeathTypes = NONE +CRUSHED +SPLATTED
OCL = OCL_MarauderTank_CrushEffect
FX = FX_CarCrush
End

Behavior = CreateCrateDie ModuleTag_07
CrateData = SalvageCrateData
End

Behavior = EjectPilotDie ModuleTag_HijackerFix01
DeathTypes = ALL -CRUSHED -SPLATTED
RequiredStatus = HIJACKED
VeterancyLevels = ALL
End
Behavior = FXListDie ModuleTag_HijackerFix02
RequiredStatus = HIJACKED
DeathTypes = ALL -CRUSHED -SPLATTED
DeathFX = FX_HijackerEject
End


Geometry = BOX
GeometryMajorRadius = 18.0
GeometryMinorRadius = 11.0
GeometryHeight = 12.0
GeometryIsSmall = Yes

Shadow = SHADOW_VOLUME
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length

End


Here is the code from my mod:


Object Demo_GLATankMarauder

; *** ART Parameters ***
SelectPortrait = SUMarauder_L
ButtonImage = SUMarauder

UpgradeCameo1 = Upgrade_GLAJunkRepair
UpgradeCameo2 = Demo_Upgrade_SuicideBomb
;UpgradeCameo3 = NONE
;UpgradeCameo4 = NONE
;UpgradeCameo5 = NONE

Draw = W3DTankDraw ModuleTag_01
OkToChangeModelColor = Yes

; no crate upgrade
ConditionState = NONE
Model = UVMarauder
Turret = Turret
ShowSubObject = Turret
HideSubObject = TurretUp01 TurretUp02 BarrelFX01 ; Since we are showing one of three turrets, we need to then hide the subobject muzzleflash
WeaponFireFXBone = PRIMARY BarrelMS
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY BarrelFX
WeaponLaunchBone = PRIMARY BarrelMS
End

ConditionState = REALLYDAMAGED
Model = UVMarauder_d
Turret = Turret
ShowSubObject = Turret
HideSubObject = TurretUp01 TurretUp02 BarrelFX01
WeaponFireFXBone = PRIMARY BarrelMS
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY BarrelFX
WeaponLaunchBone = PRIMARY BarrelMS
End

ConditionState = RUBBLE
Model = UVMarauder_d
Turret = Turret
ShowSubObject = Turret
HideSubObject = TurretUp01 TurretUp02 BarrelFX01
WeaponFireFXBone = PRIMARY BarrelMS
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY BarrelFX
WeaponLaunchBone = PRIMARY BarrelMS
End

; crate upgrade 1
ConditionState = WEAPONSET_CRATEUPGRADE_ONE
Model = UVMarauder
Turret = TurretUp01
ShowSubObject = TurretUp01
HideSubObject = Turret TurretUp02 BarrelUp01FX01
WeaponFireFXBone = PRIMARY BarrelUp01MS
WeaponRecoilBone = PRIMARY BarrelUp01
WeaponMuzzleFlash = PRIMARY BarrelUp01FX
WeaponLaunchBone = PRIMARY BarrelUp01MS
End

ConditionState = REALLYDAMAGED WEAPONSET_CRATEUPGRADE_ONE
Model = UVMarauder_d
Turret = TurretUp01
ShowSubObject = TurretUp01
HideSubObject = Turret TurretUp02 BarrelUp01FX01
WeaponFireFXBone = PRIMARY BarrelUp01MS
WeaponRecoilBone = PRIMARY BarrelUp01
WeaponMuzzleFlash = PRIMARY BarrelUp01FX
WeaponLaunchBone = PRIMARY BarrelUp01MS
End

ConditionState = RUBBLE WEAPONSET_CRATEUPGRADE_ONE
Model = UVMarauder_d
Turret = TurretUp01
ShowSubObject = TurretUp01
HideSubObject = Turret TurretUp02 BarrelUp01FX01
WeaponFireFXBone = PRIMARY BarrelUp01MS
WeaponRecoilBone = PRIMARY BarrelUp01
WeaponMuzzleFlash = PRIMARY BarrelUp01FX
WeaponLaunchBone = PRIMARY BarrelUp01MS
End

; crate upgrade 2
ConditionState = WEAPONSET_CRATEUPGRADE_TWO
Model = UVMarauder
Turret = TurretUp02
ShowSubObject = TurretUp02
HideSubObject = Turret TurretUp01 BarrelUp02FX01 BarrelUp02FX02
WeaponFireFXBone = PRIMARY BarrelUp02MS
WeaponRecoilBone = PRIMARY BarrelUp02
WeaponMuzzleFlash = PRIMARY BarrelUp02FX
WeaponLaunchBone = PRIMARY BarrelUp02MS
End

ConditionState = REALLYDAMAGED WEAPONSET_CRATEUPGRADE_TWO
Model = UVMarauder_d
Turret = TurretUp02
ShowSubObject = TurretUp02
HideSubObject = Turret TurretUp01 BarrelUp02FX01 BarrelUp02FX02
WeaponFireFXBone = PRIMARY BarrelUp02MS
WeaponRecoilBone = PRIMARY BarrelUp02
WeaponMuzzleFlash = PRIMARY BarrelUp02FX
WeaponLaunchBone = PRIMARY BarrelUp02MS
End

ConditionState = RUBBLE WEAPONSET_CRATEUPGRADE_TWO
Model = UVMarauder_d
Turret = TurretUp02
ShowSubObject = TurretUp02
HideSubObject = Turret TurretUp01 BarrelUp02FX01 BarrelUp02FX02
WeaponFireFXBone = PRIMARY BarrelUp02MS
WeaponRecoilBone = PRIMARY BarrelUp02
WeaponMuzzleFlash = PRIMARY BarrelUp02FX
WeaponLaunchBone = PRIMARY BarrelUp02MS
End

TrackMarks = EXTnkTrack.tga
TreadAnimationRate = 2.0; amount of tread texture to move per second
TreadDriveSpeedFraction = 0.3 ; fraction of locomotor speed below which treads stop moving.
TreadPivotSpeedFraction = 0.6 ; fraction of locomotor speed below which we allow pivoting.

End

; ***DESIGN parameters ***
DisplayName = OBJECT:Marauder
Side = GLADemolitionGeneral
EditorSorting = VEHICLE
TransportSlotCount = 3 ;how many "slots" we take in a transport (0 == not transportable)
WeaponSet
Conditions = None
Weapon = PRIMARY REDMarauderTankGun
Weapon = TERTIARY TerroristSuicideNotARealWeapon
AutoChooseSources = TERTIARY None
End
WeaponSet
Conditions = CRATEUPGRADE_ONE
Weapon = PRIMARY REDMarauderTankGunUpgradeOne
Weapon = TERTIARY TerroristSuicideNotARealWeapon
AutoChooseSources = TERTIARY None

End
WeaponSet
Conditions = CRATEUPGRADE_TWO
Weapon = PRIMARY REDMarauderTankGunUpgradeTwo
Weapon = TERTIARY TerroristSuicideNotARealWeapon
AutoChooseSources = TERTIARY None
End
ArmorSet
Conditions = None
Armor = TankArmor
DamageFX = TankDamageFX
End
BuildCost = 900
BuildTime = 10.0 ;in seconds
VisionRange = 125
ShroudClearingRange = 300
Prerequisites
Object = Demo_GLAArmsDealer
Science = SCIENCE_MarauderTank
End

ExperienceValue = 100 100 200 300 ;Experience point value at each level
ExperienceRequired = 0 200 300 600 ;Experience points needed to gain each level
IsTrainable = Yes ;Can gain experience
CrusherLevel = 2 ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
CrushableLevel = 2 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles
CommandSet = Demo_GLATankMarauderCommandSet

; *** AUDIO Parameters ***
VoiceSelect = MarauderTankVoiceSelect
VoiceMove = MarauderTankVoiceMove
VoiceGuard = MarauderTankVoiceMove
VoiceAttack = MarauderTankVoiceAttack
SoundMoveStart = MarauderTankMoveStart
SoundMoveStartDamaged = MarauderTankMoveStart

UnitSpecificSounds
; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
VoiceCreate = MarauderTankVoiceCreate
TurretMoveStart = NoSound
TurretMoveLoop = TurretMoveLoop
VoiceSalvage = MarauderTankVoiceSalvage
VoiceCrush = MarauderTankVoiceCrush
VoiceEnter = MarauderTankVoiceMove
End

; *** ENGINEERING Parameters ***
RadarPriority = UNIT
KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS SALVAGER WEAPON_SALVAGER VEHICLE SCORE

Body = ActiveBody ModuleTag_02
MaxHealth = 500.0
InitialHealth = 500.0

; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
SubdualDamageCap = 860
SubdualDamageHealRate = 500
SubdualDamageHealAmount = 50
End

Behavior = AIUpdateInterface ModuleTag_03
AutoAcquireEnemiesWhenIdle = Yes
End
Locomotor = SET_NORMAL MarauderLocomotor
Behavior = PhysicsBehavior ModuleTag_04
Mass = 50.0
End
Behavior = AutoHealBehavior ModuleTag_05
HealingAmount = 2
HealingDelay = 1000 ; msec
TriggeredBy = Upgrade_GLAJunkRepair
End

; Catch fire, and explode death
Behavior = SlowDeathBehavior ModuleTag_06
DeathTypes = ALL -CRUSHED -SPLATTED
ProbabilityModifier = 50
DestructionDelay = 1000
DestructionDelayVariance = 300
FX = INITIAL FX_CrusaderCatchFire
OCL = FINAL OCL_MarauderTankDeathEffect
FX = FINAL FX_BattleMasterExplosionOneFinal
End

Behavior = AIUpdateInterface ModuleTag_25
Turret
ControlledWeaponSlots = PRIMARY
TurretTurnRate = 80
RecenterTime = 5000 ; how long to wait during idle before recentering
End
AutoAcquireEnemiesWhenIdle = Yes
End

Behavior = CreateCrateDie ModuleTag_07
CrateData = SalvageCrateData
;CrateData = EliteTankCrateData
;CrateData = HeroicTankCrateData
End

Behavior = TransitionDamageFX ModuleTag_08
ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
End

; A crushing defeat
Behavior = FXListDie ModuleTag_09
DeathTypes = NONE +CRUSHED +SPLATTED
DeathFX = FX_CarCrush
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 = SlowDeathBehavior ModuleTag_Death_22
DeathTypes = NONE +SUICIDED +EXPLODED
SinkDelay = 3000
SinkRate = 0.5 ; in Dist/Sec
DestructionDelay = 8000
FX = INITIAL FX_TerroristExplode
FlingForce = 8
FlingForceVariance = 3
FlingPitch = 60
FlingPitchVariance = 10
End

Behavior = FireWeaponWhenDeadBehavior ModuleTag998
DeathWeapon = Demo_SuicideDynamitePackPlusFire
StartsActive = No
TriggeredBy = Demo_Upgrade_SuicideBomb
DeathTypes = NONE +SUICIDED
End;

Behavior = FireWeaponWhenDeadBehavior ModuleTag999
DeathWeapon = Demo_DestroyedWeapon
StartsActive = No
TriggeredBy = Demo_Upgrade_SuicideBomb
DeathTypes = ALL -SUICIDED
End

Behavior = CommandSetUpgrade ModuleTag_24
CommandSet = Demo_GLATankMarauderCommandSetUpgrade
TriggeredBy = Demo_Upgrade_SuicideBomb
End

Geometry = BOX
GeometryMajorRadius = 17.0
GeometryMinorRadius = 10.0
GeometryHeight = 9.5
GeometryIsSmall = Yes
Shadow = SHADOW_VOLUME
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length

End


I hope someone can figure out what's wrong and DM me😉
Thanks
Sponsor
SkyMix_RMT
6 years ago
You forgot to add the Locomotor.
Check out:
My Music  (Techno/House/Experimental)
My Website  (GeneralsCentral)
My Youtube Channel  (Inactive)
World Builder Community Discord 
evulant
6 years ago


You forgot to add the Locomotor.

Originally Posted by: SkyMix_RMT 



Behavior = AIUpdateInterface ModuleTag_03
AutoAcquireEnemiesWhenIdle = Yes
End
Locomotor = SET_NORMAL MarauderLocomotor

Originally Posted by: apocalypse232 




Isn't the real problem that he added another AIUpdateInterface right after the locomotor?

Behavior = AIUpdateInterface ModuleTag_25
Turret
ControlledWeaponSlots = PRIMARY
TurretTurnRate = 80
RecenterTime = 5000 ; how long to wait during idle before recentering
End
AutoAcquireEnemiesWhenIdle = Yes
End


IIRC, no object should have more than one AI interface anyway, and it should always come before Locomotors. Also the second even has a TurretTurnRate set which would allow the Marauder to turn its turret which is clearly not intended.
Apocalypse232
6 years ago
So what's the solution for the problem? I need a direct answer please!
SkyMix_RMT
6 years ago
Thanks for the heads up Evulant, I was on the phone and didn't check hard enough.

So what's the solution for the problem? I need a direct answer please!

Originally Posted by: apocalypse232 



As Evulant said, Locomotors always come after AIUpdateInterface. Also, you have 2 AIUpdateInterfaces that do the same thing, remove this one:

""
Behavior = AIUpdateInterface ModuleTag_03
AutoAcquireEnemiesWhenIdle = Yes
End
""



Check out:
My Music  (Techno/House/Experimental)
My Website  (GeneralsCentral)
My Youtube Channel  (Inactive)
World Builder Community Discord 
Apocalypse232
6 years ago
Thanks for your help, I have another issue but this time its General Kwai's Emperor Tank. It's not auto-repairing itself from its own propaganda tower! Even after purchasing the Subliminal Messaging upgrade. All I wanted was to make its propaganda tower get upgraded when I purchased the Subliminal Messaging upgrade because originally that doesn't happen!
To make it even more clear, I've attached a picture that you can check out.

Here is the code for Emperor Tank from my mod:


Object Tank_ChinaTankEmperor

; *** ART Parameters ***
SelectPortrait = SNEmpTank_L
ButtonImage = SNEmpTank

UpgradeCameo1 = Upgrade_ChinaUraniumShells
UpgradeCameo2 = Upgrade_ChinaNuclearTanks
UpgradeCameo3 = Tank_Upgrade_ChinaTankAutoLoader
UpgradeCameo4 = Upgrade_ChinaOverlordGattlingCannon
UpgradeCameo5 = Upgrade_ChinaSubliminalMessaging

Draw = W3DOverlordTankDraw ModuleTag_01
ConditionState = NONE
Model = NVOvrlrdT
Animation = NVOvrlrdT.NVOvrlrdT
AnimationMode = LOOP
Turret = Turret01
WeaponFireFXBone = PRIMARY Muzzle
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY MuzzleFX
WeaponLaunchBone = PRIMARY Muzzle
End
ConditionState = REALLYDAMAGED
Model = NVOvrlrdT_D
Animation = NVOvrlrdT_D.NVOvrlrdT_D
AnimationMode = LOOP
Turret = Turret01
WeaponFireFXBone = PRIMARY Muzzle
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY MuzzleFX
WeaponLaunchBone = PRIMARY Muzzle
End

ConditionState = RUBBLE
Model = NVOvrlrdT_D1
Turret = Turret01
WeaponFireFXBone = PRIMARY Muzzle
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY MuzzleFX
WeaponLaunchBone = PRIMARY Muzzle
End

TrackMarks = EXTnkTrack.tga
OkToChangeModelColor = Yes
TreadAnimationRate = 2.0; amount of tread texture to move per second
TreadDriveSpeedFraction = 0.3 ; fraction of locomotor speed below which treads stop moving.
TreadPivotSpeedFraction = 0.6 ; fraction of locomotor speed below which we allow pivoting.
End

; ***DESIGN parameters ***
DisplayName = OBJECT:Tank_Overlord
Side = ChinaTankGeneral
EditorSorting = VEHICLE
TransportSlotCount = 3 ;how many "slots" we take in a transport (0 == not transportable)

WeaponSet
Conditions = None
Weapon = PRIMARY OverlordTankGun
End
WeaponSet
Conditions = PLAYER_UPGRADE
Weapon = PRIMARY Tank_OverlordTankGun
Weapon = SECONDARY GattlingBuildingGunAirDummy ;Dummy weapon that allows manual targeting of air units outside range
;gattling cannon upgrade has been made.
End
ArmorSet
Conditions = None
Armor = TankArmor
DamageFX = TankDamageFX
End
BuildCost = 1900
BuildTime = 18.0 ;in seconds
VisionRange = 150
ShroudClearingRange = 200

Prerequisites
Object = Tank_ChinaWarFactory
Object = Tank_ChinaPropagandaCenter
End

ExperienceValue = 200 200 400 600 ;Experience point value at each level
ExperienceRequired = 0 400 600 1200 ;Experience points needed to gain each level
IsTrainable = Yes ;Can gain experience
CrusherLevel = 3 ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
CrushableLevel = 3 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles
CommandSet = Tank_ChinaTankEmperorDefaultCommandSet

; *** AUDIO Parameters ***
VoiceSelect = EmperorTankVoiceSelect
SoundMoveStart = OverlordTankMoveStart
SoundMoveStartDamaged = OverlordTankMoveStart
VoiceMove = EmperorTankVoiceMove
VoiceGuard = EmperorTankVoiceMove
VoiceAttack = OverlordTankVoiceAttack

UnitSpecificSounds
; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
VoiceCreate = OverlordTankVoiceCreate
TurretMoveStart = NoSound
TurretMoveLoop = OverlordTankTurretMoveLoop
VoiceCrush = OverlordTankVoiceCrush
VoiceEnter = EmperorTankVoiceMove
VoiceUnload = OverlordTankVoiceUnload
End

; *** ENGINEERING Parameters ***
RadarPriority = UNIT
KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE HUGE_VEHICLE

Body = ActiveBody ModuleTag_02
MaxHealth = 1200.0
InitialHealth = 1200.0

; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
SubdualDamageCap = 2200
SubdualDamageHealRate = 500
SubdualDamageHealAmount = 50
End

Behavior = VeterancyGainCreate ModuleTag_23
StartingLevel = VETERAN
End


Behavior = TransportAIUpdate ModuleTag_03
Turret
TurretTurnRate = 60 ;30 ;15 // turn rate, in degrees per sec
ControlledWeaponSlots = PRIMARY
End
AutoAcquireEnemiesWhenIdle = Yes
End

Locomotor = SET_NORMAL OverlordLocomotor
Locomotor = SET_NORMAL_UPGRADED NuclearOverlordLocomotor

Behavior = FireWeaponWhenDeadBehavior ModuleTag_04
DeathWeapon = NuclearTankDeathWeapon
StartsActive = No ; turned on by upgrade
TriggeredBy = Upgrade_ChinaNuclearTanks
End

Behavior = LocomotorSetUpgrade ModuleTag_05
TriggeredBy = Upgrade_ChinaNuclearTanks
End

Behavior = WeaponSetUpgrade ModuleTag_28
TriggeredBy = Tank_Upgrade_ChinaTankAutoLoader
End

Behavior = OverlordContain ModuleTag_06 ; Like Transport, but when full, passes transport queries along to first passenger (redirects like tunnel)
Slots = 1
DamagePercentToUnits = 100%
AllowInsideKindOf = PORTABLE_STRUCTURE
PassengersAllowedToFire = Yes
PassengersInTurret = Yes ; My passengers ride in my turret, that's where the Firepoint bones are
ExperienceSinkForRider = Yes ; I get the Exp for things my turret friend kills
End

; Prop Tower is intrinsic. Plus, GrantUpgradeCreates on units crash savegames if the unit is Elite.
; Behavior = GrantUpgradeCreate ModuleTag_22
; UpgradeToGrant = Upgrade_ChinaOverlordPropagandaTower
; ExemptStatus = UNDER_CONSTRUCTION
; End

Behavior = ObjectCreationUpgrade ModuleTag_07
UpgradeObject = OCL_OverlordGattlingCannon
TriggeredBy = Upgrade_ChinaOverlordGattlingCannon
;ConflictsWith = Upgrade_ChinaOverlordBattleBunker
End
Behavior = WeaponSetUpgrade ModuleTag_WeaponSetUpgrade01
TriggeredBy = Upgrade_ChinaOverlordGattlingCannon
;ConflictsWith = Upgrade_ChinaOverlordBattleBunker
End

;Propaganda tower is an innate ability without using art or subobjects.
;Behavior = ObjectCreationUpgrade ModuleTag_08
; UpgradeObject = OCL_EmperorPropagandaTower
; TriggeredBy = Upgrade_ChinaOverlordPropagandaTower
; ConflictsWith = Upgrade_ChinaOverlordBattleBunker
;End

; Doesn't get this upgrade!
; Behavior = ObjectCreationUpgrade ModuleTag_09
; UpgradeObject = OCL_OverlordBattleBunker
; TriggeredBy = Upgrade_ChinaOverlordBattleBunker
; ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordPropagandaTower
; End

Behavior = ProductionUpdate ModuleTag_10
; MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
MaxQueueEntries = 2; Propaganda model is hacked to not show up.
End
Behavior = CommandSetUpgrade ModuleTag_11
CommandSet = Tank_ChinaTankOverlordGattlingCannonCommandSet
TriggeredBy = Upgrade_ChinaOverlordGattlingCannon
ConflictsWith = Upgrade_ChinaOverlordPropagandaTower Upgrade_ChinaOverlordBattleBunker
End
;Behavior = CommandSetUpgrade ModuleTag_12
; CommandSet = Tank_ChinaTankOverlordPropagandaTowerCommandSet
;TriggeredBy = Upgrade_ChinaOverlordPropagandaTower
;ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordBattleBunker
;End
; Behavior = CommandSetUpgrade ModuleTag_13
; CommandSet = Tank_ChinaTankOverlordBattleBunkerCommandSet
; TriggeredBy = Upgrade_ChinaOverlordBattleBunker
; ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordPropagandaTower
; End

Behavior = PhysicsBehavior ModuleTag_14
Mass = 50.0
End

Behavior = PropagandaTowerBehavior ModuleTag_19
Radius = 150.0
DelayBetweenUpdates = 2000 ; in milliseconds
HealPercentEachSecond = 1% ; get this % of max health every second
PulseFX = FX_OverlordPropagandaTowerPropagandaPulse ;plays as often as DelayBetweenUpdates
UpgradeRequired = Upgrade_ChinaSubliminalMessaging
UpgradedHealPercentEachSecond = 2% ; get this % of max health every second
UpgradedPulseFX = FX_OverlordPropagandaTowerSubliminalPulse ;plays as often as DelayBetweenUpdates

End


; Smoke for a bit then explode
; Behavior = SlowDeathBehavior
;; ProbabilityModifier = 25
; DestructionDelay = 1500
; DestructionDelayVariance = 500
; FX = INITIAL FX_OverlordSmoke
; OCL = FINAL OCL_ChinaTankOverlordDebris
; FX = FINAL FX_GenericTankDeathExplosion
; End

; Catch fire, and explode death
; Behavior = SlowDeathBehavior
;; ProbabilityModifier = 25
; DestructionDelay = 2000
; DestructionDelayVariance = 300
; FX = INITIAL FX_CrusaderCatchFire
; OCL = FINAL OCL_ChinaTankOverlordDebris
; FX = FINAL FX_GenericTankDeathExplosion
; End

; Just explode death
Behavior = SlowDeathBehavior ModuleTag_16
ProbabilityModifier = 25
DestructionDelay = 200
DestructionDelayVariance = 100
OCL = FINAL OCL_ChinaTankOverlordDebris
FX = FINAL FX_OverlordExplosionOneFinal
End
Behavior = CreateCrateDie ModuleTag_17
CrateData = SalvageCrateData
;CrateData = EliteTankCrateData
;CrateData = HeroicTankCrateData
End

Behavior = TransitionDamageFX ModuleTag_18
ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_OverlordDamageTransition
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

Geometry = BOX
GeometryMajorRadius = 26.0
GeometryMinorRadius = 13.0
GeometryHeight = 15.0
GeometryIsSmall = No
Shadow = SHADOW_VOLUME
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length

End


Here is the code for its propaganda tower:


Object Tank_ChinaTankOverlordPropagandaTower

; *** ART Parameters ***
SelectPortrait = SNPropSpeaker_L
ButtonImage = SNPropSpeaker

UpgradeCameo1 = Upgrade_Nationalism
UpgradeCameo2 = Upgrade_ChinaUraniumShells
UpgradeCameo3 = Upgrade_ChinaNuclearTanks
;UpgradeCameo4 = NONE
UpgradeCameo5 = Upgrade_ChinaOverlordPropagandaTower

Draw = W3DDependencyModelDraw ModuleTag_01
OkToChangeModelColor = Yes
AttachToBoneInContainer = FIREPOINT01

ConditionState = NONE
Model = NVOvrlrd_S
Animation = NVOvrlrd_S.NVOvrlrd_S
AnimationMode = LOOP
End
ConditionState = REALLYDAMAGED
Model = NVOvrlrd_SD
ParticleSysBone = Smoke01 SmolderingSmoke
ParticleSysBone = Smoke02 SmolderingSmoke
ParticleSysBone = Flame01 SmolderingFire
ParticleSysBone = Flame01 SmolderingFlameCore
ParticleSysBone = Spark01 LiveWireSparks
End
; night
ConditionState = NIGHT
Model = NVOvrlrd_S
Animation = NVOvrlrd_S.NVOvrlrd_S
AnimationMode = LOOP
End
End

PlacementViewAngle = -45

; ***DESIGN parameters ***
Side = ChinaTankGeneral
EditorSorting = SYSTEM
TransportSlotCount = 1

ArmorSet
Conditions = None
Armor = InvulnerableAllArmor ; We can't be hurt on the field. We share damage from the Overlord with his damage module
End
VisionRange = 200

; *** AUDIO Parameters ***
UnitSpecificSounds
TurretMoveStart = NoSound
TurretMoveLoop = NoSound ;TurretMoveLoop
End

; *** ENGINEERING Parameters ***
KindOf = PRELOAD PORTABLE_STRUCTURE CAN_ATTACK CLICK_THROUGH IGNORED_IN_GUI
Body = StructureBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.0
End

Behavior = AIUpdateInterface ModuleTag_03
;
End

Behavior = VeterancyGainCreate ModuleTag_06
StartingLevel = VETERAN
End


Behavior = PropagandaTowerBehavior ModuleTag_04
Radius = 150.0
DelayBetweenUpdates = 2000 ; in milliseconds
HealPercentEachSecond = 1% ; get this % of max health every second
PulseFX = FX_OverlordPropagandaTowerPropagandaPulse ;plays as often as DelayBetweenUpdates
UpgradeRequired = Upgrade_ChinaSubliminalMessaging
UpgradedHealPercentEachSecond = 2% ; get this % of max health every second
UpgradedPulseFX = FX_OverlordPropagandaTowerSubliminalPulse ;plays as often as DelayBetweenUpdates

End

Behavior = DestroyDie ModuleTag_05
;
End

Geometry = BOX
GeometryMajorRadius = 6.0
GeometryMinorRadius = 6.0
GeometryHeight = 10.0
GeometryIsSmall = No
Shadow = SHADOW_VOLUME
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length

End

I hope someone helps me out!
Thanks in advance.   Emperor Tank.png (2,697kb) downloaded 36 time(s).
evulant
6 years ago
You forgot

AffectsSelf = Yes ; Needs this since Tower is not seperate object for Emperor


in the PropagandaTowerBehavior for the Emperor.



Object Tank_ChinaTankEmperor
[...]

Behavior = PropagandaTowerBehavior ModuleTag_19
Radius = 150.0
DelayBetweenUpdates = 2000 ; in milliseconds
HealPercentEachSecond = 1% ; get this % of max health every second
PulseFX = FX_OverlordPropagandaTowerPropagandaPulse ;plays as often as DelayBetweenUpdates
UpgradeRequired = Upgrade_ChinaSubliminalMessaging
UpgradedHealPercentEachSecond = 2% ; get this % of max health every second
UpgradedPulseFX = FX_OverlordPropagandaTowerSubliminalPulse ;plays as often as DelayBetweenUpdates

End
[...]

Originally Posted by: apocalypse232 



The Emperor Overlord doesn't use the Tank General's Propaganda Tower object (Tank_ChinaTankOverlordPropagandaTower) unlike the vanilla Overlord (which uses ChinaTankOverlordPropagandaTower). EA probably just forgot to remove the object as it isn't used anywhere, so its PropagandaTowerBehavior is irrelevant.