Meet Crator:
He has 3 different weaponsets.
Weaponset 1 - Machinegun
Weaponset 2 - Grenade Launcher, Special Grenade A(machinegun), Special Grenade B(bombs)
Weaponset 3 - Sword, Sword Wave, Sword Slam(not in the video)
His entire object code:
Show Spoiler
;--------------------------------------------------------------
Object Cutezome_Crator ;Campaign-only unit.
; *** ART Parameters ***
SelectPortrait = CzAM_CZ_CRATOR
ButtonImage = CzAM_CZ_CRATOR
;UpgradeCameo1 = Upgrade_GLAJunkRepair
;UpgradeCameo2 = NONE
;UpgradeCameo3 = NONE
;UpgradeCameo4 = NONE
;UpgradeCameo5 = NONE
Draw = W3DTruckDraw ModuleTag_01
OkToChangeModelColor = Yes
;Default
DefaultConditionState
Model = CZCRTR_I1
AnimationMode = MANUAL
WeaponLaunchBone = PRIMARY WEAPONA
End
;Undeployed
ConditionState = RIDER1
Model = CZCRTR_I1
Animation = CZCRTR_I1.CZCRTR_I1
Animation = CZCRTR_I2.CZCRTR_I2
Animation = CZCRTR_I3.CZCRTR_I3
AnimationMode = ONCE
End
AliasConditionState = RIDER1 REALLYDAMAGED
AliasConditionState = RIDER2
AliasConditionState = RIDER2 REALLYDAMAGED
AliasConditionState = RIDER3
AliasConditionState = RIDER3 REALLYDAMAGED
ConditionState = RIDER1 MOVING
Model = CZCRTR_W
Animation = CZCRTR_W.CZCRTR_W
AnimationMode = LOOP
End
AliasConditionState = REALLYDAMAGED RIDER1 MOVING
AliasConditionState = RIDER2 MOVING
AliasConditionState = REALLYDAMAGED RIDER2 MOVING
ConditionState = RIDER3 MOVING
Model = CZCRTR_W2
Animation = CZCRTR_W2.CZCRTR_W2
AnimationMode = LOOP
End
AliasConditionState = REALLYDAMAGED RIDER3 MOVING
;Using Small Arms
ConditionState = RIDER1 USING_WEAPON_A
Model = CZCRTR_A1
Animation = CZCRTR_A1.CZCRTR_A1
AnimationMode = LOOP
WeaponLaunchBone = PRIMARY WEAPONA
End
AliasConditionState = REALLYDAMAGED RIDER1 USING_WEAPON_A
;Using Grenades/Cannon
ConditionState = RIDER2 USING_WEAPON_A
Model = CZCRTR_A2
Animation = CZCRTR_A1.CZCRTR_A1
AnimationMode = LOOP
WeaponLaunchBone = PRIMARY WEAPONA
WeaponLaunchBone = SECONDARY WEAPONA
WeaponLaunchBone = TERTIARY WEAPONA
End
AliasConditionState = REALLYDAMAGED RIDER2 USING_WEAPON_A
AliasConditionState = RIDER2 USING_WEAPON_B
AliasConditionState = REALLYDAMAGED RIDER2 USING_WEAPON_B
AliasConditionState = RIDER2 USING_WEAPON_C
AliasConditionState = REALLYDAMAGED RIDER2 USING_WEAPON_C
;Using Sword
ConditionState = RIDER3 USING_WEAPON_A
Model = CZCRTR_A31
Animation = CZCRTR_A31.CZCRTR_A31
ParticleSysBone = Box11 CratorSwordTrail
AnimationMode = ONCE
Flags = START_FRAME_FIRST RESTART_ANIM_WHEN_COMPLETE
WeaponLaunchBone = PRIMARY WEAPONA
End
AliasConditionState = REALLYDAMAGED RIDER3 USING_WEAPON_A
ConditionState = RIDER3 USING_WEAPON_B
Model = CZCRTR_A32 ;NOT A33???
Animation = CZCRTR_A32.CZCRTR_A32
ParticleSysBone = Box11 CratorSwordTrail
AnimationMode = ONCE
Flags = START_FRAME_FIRST RESTART_ANIM_WHEN_COMPLETE
WeaponLaunchBone = SECONDARY WEAPONA
End
AliasConditionState = REALLYDAMAGED RIDER3 USING_WEAPON_B
ConditionState = RIDER3 USING_WEAPON_C
Model = CZCRTR_A34
Animation = CZCRTR_A34.CZCRTR_A34
ParticleSysBone = Box11 CratorSwordTrail
AnimationMode = ONCE
Flags = START_FRAME_FIRST RESTART_ANIM_WHEN_COMPLETE
WeaponLaunchBone = TERTIARY WEAPONA
End
AliasConditionState = REALLYDAMAGED RIDER3 USING_WEAPON_C
ParticlesAttachedToAnimatedBones = Yes
End
; ***DESIGN parameters ***
DisplayName = OBJECT:CombatBike
Side = RedSkulls
EditorSorting = INFANTRY
TransportSlotCount = 1 ;how many "slots" we take in a transport (0 == not transportable)
WeaponSet
Conditions = NONE
Weapon = PRIMARY Cutezome_CratorSMGWeapon
End
WeaponSet
Conditions = WEAPON_RIDER1
Weapon = PRIMARY Cutezome_CratorSMGWeapon
End
WeaponSet
Conditions = WEAPON_RIDER2
Weapon = PRIMARY Cutezome_CratorCannonWeapon
Weapon = SECONDARY Cutezome_CratorGunMIRVWeapon
PreferredAgainst = SECONDARY NONE
AutoChooseSources = SECONDARY NONE
Weapon = TERTIARY Cutezome_CratorExplosiveMIRVWeapon
PreferredAgainst = TERTIARY NONE
AutoChooseSources = TERTIARY NONE
End
WeaponSet
Conditions = WEAPON_RIDER3
Weapon = PRIMARY Cutezome_CratorLightsaberWeapon
Weapon = SECONDARY Cutezome_CratorSwordWaveWeapon
PreferredAgainst = SECONDARY NONE
AutoChooseSources = SECONDARY NONE
Weapon = TERTIARY Cutezome_CratorSwordPlantWeapon
PreferredAgainst = TERTIARY NONE
AutoChooseSources = TERTIARY NONE
End
ArmorSet
Conditions = None
Armor = CratorArmor
DamageFX = TankDamageFX
End
BuildCost = 0
BuildTime = 1.0 ;in seconds
VisionRange = 240
ShroudClearingRange = 300
ExperienceValue = 50 50 100 150 ;Experience point value at each level
ExperienceRequired = 0 200 400 800 ;Experience points needed to gain each level
IsTrainable = No ;Set to No, it's glitchy as all heck.
;CrusherLevel = 2 ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
CrushableLevel = 0 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles
;CommandSet = GLAVehicleCombatBikeCommandSet ****COMMANDSET is overwritten in RiderChangeContain!
; *** AUDIO Parameters ***
VoiceSelect = CZ_CratorClick
VoiceMove = CZ_CratorMove
VoiceAttack = CZ_CratorAttack
;SoundMoveStart = CombatBikeMoveStart
;SoundMoveStartDamaged = CombatBikeMoveStart
VoiceGuard = CZ_CratorMove
VoiceFear = CZ_CratorDying
;SoundEnter = CombatCycleSwitchRider
UnitSpecificSounds
; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
VoiceCreate = CZ_CratorSword
TurretMoveStart = CZ_CratorSMG
TurretMoveLoop = CZ_CratorCannon
; Required for the W3DTruckDraw module
TruckLandingSound = RocketBuggyLand
TruckPowerslideSound = CombatBikeMoveStart
VoiceCrush = CZ_CratorClick
;VoiceEnter = CombatCycleVoiceMove
End
; *** ENGINEERING Parameters ***
RadarPriority = UNIT
KindOf = PRELOAD SELECTABLE CAN_ATTACK DONT_AUTO_CRUSH_INFANTRY ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS SALVAGER SCORE EMP_HARDENED HERO
Body = ActiveBody ModuleTag_02
MaxHealth = 1100
InitialHealth = 1100
; 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 = 200
SubdualDamageHealRate = 500
SubdualDamageHealAmount = 50
End
Behavior = AIUpdateInterface ModuleTag_03
;Turret
;TurretTurnRate = 0 ; turn rate, in degrees per sec
;NaturalTurretAngle = 0
;ControlledWeaponSlots = PRIMARY SECONDARY
;End
AutoAcquireEnemiesWhenIdle = No
End
Locomotor = SET_NORMAL CratorLocomotor
Locomotor = SET_SLUGGISH CratorMeleeLocomotor
Behavior = PhysicsBehavior ModuleTag_04
Mass = 15.0
End
; --- begin Death modules ---
Behavior = SlowDeathBehavior ModuleTag_Death01
DeathTypes = ALL -CRUSHED -SPLATTED -EXPLODED -BURNED -POISONED -POISONED_BETA -POISONED_GAMMA
SinkDelay = 3000
SinkRate = 0.5 ; in Dist/Sec
DestructionDelay = 8000
FX = INITIAL FX_RedGuardDie
End
Behavior = SlowDeathBehavior ModuleTag_Death02
DeathTypes = NONE +CRUSHED +SPLATTED
SinkDelay = 3000
SinkRate = 0.5 ; in Dist/Sec
DestructionDelay = 8000
FX = INITIAL FX_GIDieCrushed
End
Behavior = SlowDeathBehavior ModuleTag_Death03
DeathTypes = NONE +EXPLODED
SinkDelay = 3000
SinkRate = 0.5 ; in Dist/Sec
DestructionDelay = 8000
FX = INITIAL FX_RedGuardDie
FlingForce = 8
FlingForceVariance = 3
FlingPitch = 60
FlingPitchVariance = 10
End
Behavior = SlowDeathBehavior ModuleTag_Death04
DeathTypes = NONE +BURNED
DestructionDelay = 0
FX = INITIAL FX_DieByFireChina
OCL = INITIAL OCL_FlamingInfantry
End
Behavior = SlowDeathBehavior ModuleTag_Death05
DeathTypes = NONE +POISONED
DestructionDelay = 0
FX = INITIAL FX_DieByToxinChina
OCL = INITIAL OCL_ToxicInfantry
End
Behavior = SlowDeathBehavior ModuleTag_Death06 ; don't forget to give it a new, unique module tag
DeathTypes = NONE +POISONED_BETA
DestructionDelay = 0
FX = INITIAL FX_DieByToxinChina
OCL = INITIAL OCL_ToxicInfantryBeta ;you'll have to create this OCL and make it use the blue guys instead of green ones
End
Behavior = SlowDeathBehavior ModuleTag_Death07
DeathTypes = NONE +POISONED_GAMMA
DestructionDelay = 0
FX = INITIAL FX_DieByToxinChina
OCL = INITIAL OCL_ToxicInfantryGamma
End
; A crushing defeat
Behavior = FXListDie ModuleTag_12
DeathTypes = NONE +CRUSHED +SPLATTED
End
Behavior = RiderChangeContain ModuleTag_16
;A list of each valid rider that is allowed to ride this object. Each rider is
;assigned a modelcondition state, a weaponset flag, an object status bit, and
;a commandset override. The actual object is hidden inside the container so the
;visible rider is fluff. Also riders are deleted (not killed) when the bike is
;destroyed, so all deaths must be OCLs on the bike.
Rider1 = ModularRiderOne RIDER1 WEAPON_RIDER1 STATUS_RIDER1 CZ_CratorCommandSetOne SET_NORMAL
Rider2 = ModularRiderTwo RIDER2 WEAPON_RIDER2 STATUS_RIDER2 CZ_CratorCommandSetTwo SET_SLUGGISH
Rider3 = ModularRiderThree RIDER3 WEAPON_RIDER3 STATUS_RIDER3 CZ_CratorCommandSetThree SET_SLUGGISH
ScuttleDelay = 1500
ScuttleStatus = TOPPLED
;Standard TransportContain stuff
Slots = 1
InitialPayload = ModularRiderOne 1
ScatterNearbyOnExit = No
HealthRegen%PerSec = 0
DamagePercentToUnits = 100% ; This module will Delete the rider on death, but we need to kill him as well so he doesn't pick up the bike's salvage crate.
BurnedDeathToUnits = No ; And no Burned death.
AllowInsideKindOf = INFANTRY
ExitDelay = 250
NumberOfExitPaths = 1 ; Defaults to 1. Set 0 to not use ExitStart/ExitEnd, set higher than 1 to use ExitStart01-nn/ExitEnd01-nn
GoAggressiveOnExit = Yes ; AI Will tell people to set their mood to Aggressive on exiting
DoorOpenTime = 0
End
Behavior = ObjectCreationUpgrade ModuleTag_31 ;Machinegun
TriggeredBy = CzAM_Default_upgrade_FactoryMode
UpgradeObject = Extra_OCL_ModularRiderOne
End
Behavior = ObjectCreationUpgrade ModuleTag_32 ;Grenades
TriggeredBy = CzAM_Default_upgrade_MoveMode
UpgradeObject = Extra_OCL_ModularRiderTwo
End
Behavior = ObjectCreationUpgrade ModuleTag_34 ;Sword
TriggeredBy = CzAM_Default_upgrade_ModeThree
UpgradeObject = Extra_OCL_ModularRiderThree
End
Behavior = CommandSetUpgrade ModuleTag_n1 ;This is important. You have remove both upgrades by when upgrading to different forms, because otherwise it upgrades will get stuck and you can't change forms
TriggeredBy = CzAM_Default_upgrade_MoveMode
RemovesUpgrades = CzAM_Default_upgrade_FactoryMode CzAM_Default_upgrade_ModeThree CzAM_Default_upgrade_MoveMode ;Order matters. Remove the Opposite Upgrade First.
CommandSet = CZ_CratorCommandSetTwo
End
Behavior = CommandSetUpgrade ModuleTag_n2
TriggeredBy = CzAM_Default_upgrade_FactoryMode
RemovesUpgrades = CzAM_Default_upgrade_MoveMode CzAM_Default_upgrade_ModeThree CzAM_Default_upgrade_FactoryMode
CommandSet = CZ_CratorCommandSetOne
End
Behavior = CommandSetUpgrade ModuleTag_n3
TriggeredBy = CzAM_Default_upgrade_ModeThree
RemovesUpgrades = CzAM_Default_upgrade_MoveMode CzAM_Default_upgrade_FactoryMode CzAM_Default_upgrade_ModeThree
CommandSet = CZ_CratorCommandSetThree
End
Behavior = ProductionUpdate ModuleTag_33
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 = AutoHealBehavior ModuleTag_43
HealingAmount = 100
HealingDelay = 1000
StartsActive = Yes
End
Behavior = StealthUpdate ModuleTag_44
StealthDelay = 1000
PulseFrequency = 2000
ForbiddenStatus = IS_FIRING_WEAPON
OrderIdleEnemiesToAttackMeUponReveal = Yes
InnateStealth = Yes
End
;Behavior = LockWeaponCreate ModuleTag_46
;SlotToLock = PRIMARY
;End
ClientUpdate = AnimatedParticleSysBoneClientUpdate ModuleTag_45
;kek
End
Scale = 0.8
Geometry = BOX
GeometryMajorRadius = 2.0
GeometryMinorRadius = 2.0
GeometryHeight = 7.5
GeometryIsSmall = Yes
Shadow = SHADOW_VOLUME
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length
End
To break it down:
Here's a small part of the Art code
ConditionState = RIDER1
Model = CZCRTR_I1
Animation = CZCRTR_I1.CZCRTR_I1
Animation = CZCRTR_I2.CZCRTR_I2
Animation = CZCRTR_I3.CZCRTR_I3
AnimationMode = ONCE
End
Note the ConditionState 'RIDER1' you can have up to 'RIDER8' for this.
Essentially this a "mode" of the unit.
You can have stuff like 'RIDER1 MOVING' to have animations for moving WHILE in RIDER1.
You may different animations for when you're in RIDER2, RIDER3, etc.
Though if you want them to be the same you could always AliasConditionState it.
Here's the weaponsets
WeaponSet
Conditions = WEAPON_RIDER1
Weapon = PRIMARY Cutezome_CratorSMGWeapon
End
WeaponSet
Conditions = WEAPON_RIDER2
Weapon = PRIMARY Cutezome_CratorCannonWeapon
Weapon = SECONDARY Cutezome_CratorGunMIRVWeapon
PreferredAgainst = SECONDARY NONE
AutoChooseSources = SECONDARY NONE
Weapon = TERTIARY Cutezome_CratorExplosiveMIRVWeapon
PreferredAgainst = TERTIARY NONE
AutoChooseSources = TERTIARY NONE
End
you can have up to WEAPON_RIDER8 and stuff like that. I DO NOT know if you can do the same with ArmorSets though since the Conditions parameter asks for a StatusBitType and WEAPON_RIDERN is a StatusBitType, do this at your own risk, I HAVE NOT TESTED THIS.
Locomotors
Locomotor = SET_NORMAL CratorLocomotor
Locomotor = SET_SLUGGISH CratorMeleeLocomotor
Sadly, there's no SET_RIDERN for defining locomotors. So just gather Locomotor definitions that you'll probably never use on the unit-- like SET_SUPERSONIC or SET_SLUGGISH.
And now for the most important module:
Behavior = RiderChangeContain ModuleTag_16
;A list of each valid rider that is allowed to ride this object. Each rider is
;assigned a modelcondition state, a weaponset flag, an object status bit, and
;a commandset override. The actual object is hidden inside the container so the
;visible rider is fluff. Also riders are deleted (not killed) when the bike is
;destroyed, so all deaths must be OCLs on the bike.
Rider1 = ModularRiderOne RIDER1 WEAPON_RIDER1 STATUS_RIDER1 CZ_CratorCommandSetOne SET_NORMAL
Rider2 = ModularRiderTwo RIDER2 WEAPON_RIDER2 STATUS_RIDER2 CZ_CratorCommandSetTwo SET_SLUGGISH
Rider3 = ModularRiderThree RIDER3 WEAPON_RIDER3 STATUS_RIDER3 CZ_CratorCommandSetThree SET_SLUGGISH
ScuttleDelay = 1500
ScuttleStatus = TOPPLED
;Standard TransportContain stuff
Slots = 1
InitialPayload = ModularRiderOne 1
ScatterNearbyOnExit = No
HealthRegen%PerSec = 0
DamagePercentToUnits = 100%
BurnedDeathToUnits = No
AllowInsideKindOf = INFANTRY
ExitDelay = 250
NumberOfExitPaths = 1
GoAggressiveOnExit = Yes
DoorOpenTime = 0
End
So this unit is a Combat Bike, it HAS to have a rider. And if you remember how the combat bike works in ZH is that it changes apparance depending on what GLA Infantry is inside.
Essentially, Riders ModularRiderOne, ModularRiderTwo and, ModularRiderThree are imaginary objects riding inside the unit representing what weaponset is Crator using... This unit contains a button that replaces the rider(will explain later), if a rider overlaps the previous one, the previous one is ejected out of the unit. And since the ModularRiders imaginary objects without any model, I just have them with a DeletionUpdate with a Lifetime of 1.
Replacing Riders, Changing Commandset, and Removing Temporary Upgrades
Behavior = ObjectCreationUpgrade ModuleTag_31 ;Machinegun
TriggeredBy = CzAM_Default_upgrade_FactoryMode
UpgradeObject = Extra_OCL_ModularRiderOne
End
Behavior = ObjectCreationUpgrade ModuleTag_32 ;Grenades
TriggeredBy = CzAM_Default_upgrade_MoveMode
UpgradeObject = Extra_OCL_ModularRiderTwo
End
Behavior = ObjectCreationUpgrade ModuleTag_34 ;Sword
TriggeredBy = CzAM_Default_upgrade_ModeThree
UpgradeObject = Extra_OCL_ModularRiderThree
End
Behavior = CommandSetUpgrade ModuleTag_n1 ;This is important. You have remove both upgrades by when upgrading to different forms, because otherwise it upgrades will get stuck and you can't change forms
TriggeredBy = CzAM_Default_upgrade_MoveMode
RemovesUpgrades = CzAM_Default_upgrade_FactoryMode CzAM_Default_upgrade_ModeThree CzAM_Default_upgrade_MoveMode ;Order matters. Remove the Opposite Upgrade First.
CommandSet = CZ_CratorCommandSetTwo
End
Behavior = CommandSetUpgrade ModuleTag_n2
TriggeredBy = CzAM_Default_upgrade_FactoryMode
RemovesUpgrades = CzAM_Default_upgrade_MoveMode CzAM_Default_upgrade_ModeThree CzAM_Default_upgrade_FactoryMode
CommandSet = CZ_CratorCommandSetOne
End
Behavior = CommandSetUpgrade ModuleTag_n3
TriggeredBy = CzAM_Default_upgrade_ModeThree
RemovesUpgrades = CzAM_Default_upgrade_MoveMode CzAM_Default_upgrade_FactoryMode CzAM_Default_upgrade_ModeThree
CommandSet = CZ_CratorCommandSetThree
End
Changing the Commandset here is redundant since RiderChangeContain already does that, but it is just here for the RemoveUpgrades parameter.
Also this bit of code is important:
Behavior = ProductionUpdate ModuleTag_33
End
What is a ModularRider?
;---------------------------------------------
Object ModularRiderOne ;For Mode-chaning units. Mode One.
Draw = W3DModelDraw ModuleTag_01
DefaultConditionState
Model = NONE
End
End
; ***DESIGN parameters ***
DisplayName = OBJECT:Rebel
EditorSorting = SYSTEM
TransportSlotCount = 1 ;how many "slots" we take in a transport (0 == not transportable)
ArmorSet
Conditions = None
Armor = InvulnerableArmor
DamageFX = InfantryDamageFX
End
VisionRange = 150
ShroudClearingRange = 300
Prerequisites
Object = GLABarracks
End
BuildCost = 75
BuildTime = 2.5 ;in seconds
ExperienceValue = 15 15 30 40 ;Experience point value at each level
ExperienceRequired = 0 40 60 120 ;Experience points needed to gain each level
IsTrainable = No ;Can gain experience
CrushableLevel = 0 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles
CommandSet = GLAInfantryRebelCommandSet
; *** ENGINEERING Parameters ***
;RadarPriority = UNIT
KindOf = INFANTRY
Body = ActiveBody ModuleTag_02
MaxHealth = 120.0
InitialHealth = 120.0
End
Behavior = AIUpdateInterface ModuleTag_03
AutoAcquireEnemiesWhenIdle = Yes
End
Locomotor = SET_NORMAL BasicHumanLocomotor
Behavior = PhysicsBehavior ModuleTag_05
Mass = 5.0
End
Behavior = LifetimeUpdate ModuleTag_KILL
MinLifetime = 0
MaxLifetime = 0
End
Scale = 0.8
Geometry = CYLINDER
GeometryMajorRadius = 10.0
GeometryMinorRadius = 10.0
GeometryHeight = 12.0
GeometryIsSmall = Yes
Shadow = SHADOW_DECAL
ShadowSizeX = 14;
ShadowSizeY = 14;
ShadowTexture = ShadowI;
BuildCompletion = APPEARS_AT_RALLY_POINT
End