Okay everything is set!
Video Demo:
The Unit:
Code:
;------------------------------------------------------------------------------
Object Extra_TerraformingTank ;Hi! I am tank.
; *** ART Parameters ***
SelectPortrait = SSNukeTank
ButtonImage = SSNukeTank
UpgradeCameo1 = Upgrade_ChinaUraniumShells
UpgradeCameo2 = Upgrade_ChinaNuclearTanks
UpgradeCameo3 = Upgrade_ChinaOverlordBattleBunker
UpgradeCameo4 = Upgrade_ChinaOverlordGattlingCannon
UpgradeCameo5 = Upgrade_ChinaOverlordPropagandaTower
Draw = W3DModelDraw ModuleTag_01
DefaultConditionState ;I need this to be placed on the map.
Model = EX_ModTankT
Turret = Turret
WeaponLaunchBone = PRIMARY WeaponA
WeaponFireFXBone = PRIMARY WeaponA
WeaponLaunchBone = SECONDARY WeaponB
WeaponFireFXBone = SECONDARY WeaponB
End
AliasConditionState = REALLYDAMAGED RUBBLE
ConditionState = RIDER1 ;This is me on the ground.
Model = EX_ModTankF
Animation = EX_ModTankF.EX_ModTankF ;This is me folding up for ground combat.
AnimationMode = ONCE_BACKWARDS
Turret = Turret
WeaponLaunchBone = PRIMARY WeaponA
WeaponFireFXBone = PRIMARY WeaponA
End
AliasConditionState = RIDER1 REALLYDAMAGED RUBBLE
ConditionState = RIDER2 ;This is me flying.
Model = EX_ModTankF
Animation = EX_ModTankF.EX_ModTankF ;This is me deploying for air combat.
AnimationMode = ONCE
Turret = Turret
WeaponLaunchBone = PRIMARY WeaponA
WeaponFireFXBone = PRIMARY WeaponA
End
AliasConditionState = RIDER2 REALLYDAMAGED RUBBLE
End
; ***DESIGN parameters ***
DisplayName = OBJECT:Overlord
Side = China
EditorSorting = VEHICLE
TransportSlotCount = 3 ;how many "slots" we take in a transport (0 == not transportable)
WeaponSet
Conditions = WEAPON_RIDER1
Weapon = PRIMARY RedSkulls_DevastatorWeapon
End
WeaponSet
Conditions = WEAPON_RIDER2
Weapon = PRIMARY RedSkulls_DevastatorWeapon ;You can have different weapons here.
End
ArmorSet
Conditions = None
Armor = FallProofTankArmor ;So it doesn't hurt itself when goes back down the ground
DamageFX = TankDamageFX
End
BuildCost = 800
BuildTime = 8.0 ;in seconds
VisionRange = 150
ShroudClearingRange = 200
Prerequisites
Object = ChinaWarFactory
Object = 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 = Extra_TransformingTankCommandSetOne ;My Default CommandSet
; *** AUDIO Parameters ***
VoiceSelect = OverlordTankVoiceSelect
SoundMoveStart = OverlordTankMoveStart
SoundMoveStartDamaged = OverlordTankMoveStart
VoiceMove = OverlordTankVoiceMove
VoiceGuard = OverlordTankVoiceMove
VoiceAttack = OverlordTankVoiceAttack
UnitSpecificSounds
; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
VoiceCreate = OverlordTankVoiceCreate
TurretMoveStart = NoSound
TurretMoveLoop = OverlordTankTurretMoveLoop
VoiceCrush = OverlordTankVoiceCrush
VoiceEnter = OverlordTankVoiceMove
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 = 900.0
InitialHealth = 900.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 = TransportAIUpdate ModuleTag_03
Turret
TurretTurnRate = 60 ;30 ;15 // turn rate, in degrees per sec
ControlledWeaponSlots = PRIMARY
End
AutoAcquireEnemiesWhenIdle = Yes
End
Behavior = RiderChangeContain ModuleTag_30 ;This is very important.
Rider1 = ModularRiderOne RIDER1 WEAPON_RIDER1 STATUS_RIDER1 Extra_TransformingTankCommandSetOne SET_NORMAL
Rider2 = ModularRiderTwo RIDER2 WEAPON_RIDER2 STATUS_RIDER2 Extra_TransformingTankCommandSetTwo SET_SLUGGISH
Slots = 1
InitialPayload = ModularRiderOne ;So that I don't die as soon as I'm spawned.
ScatterNearbyOnExit = No
HealthRegen%PerSec = 0
DamagePercentToUnits = 100%
BurnedDeathToUnits = No
AllowInsideKindOf = INFANTRY
ExitDelay= 250
NumberOfExitPaths = 1
GoAggressiveOnExit = Yes
DoorOpenTime = 0
End
Behavior = ObjectCreationUpgrade ModuleTag_31 ;Ground Mode
TriggeredBy = CzAM_Default_upgrade_FactoryMode
UpgradeObject = Extra_OCL_ModularRiderOne
End
Behavior = ObjectCreationUpgrade ModuleTag_32 ;Aerial Mode
TriggeredBy = CzAM_Default_upgrade_MoveMode
UpgradeObject = Extra_OCL_ModularRiderTwo
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_MoveMode ;Order matters. Remove the Opposite Upgrade First.
CommandSet = Extra_TransformingTankCommandSetTwo
End
Behavior = CommandSetUpgrade ModuleTag_n2
TriggeredBy = CzAM_Default_upgrade_FactoryMode
RemovesUpgrades = CzAM_Default_upgrade_MoveMode CzAM_Default_upgrade_FactoryMode
CommandSet = Extra_TransformingTankCommandSetOne
End
Behavior = ProductionUpdate ModuleTag_33
End
Locomotor = SET_NORMAL BattleMasterLocomotor
Locomotor = SET_SLUGGISH ComancheLocomotor ;Doesn't necessarily mean slow, but it gives you more movement options to change to.
Behavior = HordeUpdate ModuleTag_devastatorhorde
RubOffRadius = 150 ; if I am this close to a real hordesman, I will get to be an honorary hordesman
UpdateRate = 1000 ; how often to recheck horde status (msec)
Radius = 75 ; how close other units must be to us to count towards our horde-ness (~30 feet or so)
KindOf = VEHICLE ; what KindOf's must match to count towards horde-ness
AlliesOnly = Yes ; do we only count allies towards horde status?
ExactMatch = Yes ; do we only count units of our exact same type towards horde status? (overrides kindof)
Count = 3 ; how many units must be within Radius to grant us horde-ness
Action = HORDE ; when horde-ing, grant us the HORDE bonus
End
Behavior = PhysicsBehavior ModuleTag_14
Mass = 50.0
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
The Upgrades I used, these were originally used for deployable factories in my mod till I dumped the concept-- it re-purposed for this demonstration.
Code:
Upgrade CzAM_Default_upgrade_MoveMode
Type = OBJECT
BuildTime = 0.0 ;unless we want to set a delay between switching forms.
BuildCost = 0 ;now why would we spend money on transforming?
ButtonImage = CzAM_MoveMode
End
Upgrade CzAM_Default_upgrade_FactoryMode
Type = OBJECT
BuildTime = 0.0
BuildCost = 0
ButtonImage = CzAM_FactoryMode
End
Code for ModularRider you make two these.
Code:
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
I'll leave you to figure it out with the comments strewn about.
Important things:
-In the Draw Modules, you must have at least DefaultConditionState or ConditionState = NONE
--Reason: It needs to have model that exists in-game without Conditions and a model to be used by the Editor.
-RiderChangeContain is the method we're using so that things that happened on the unit are passed onto the next form.
--Once more, I say, ReplaceObjectUpgrade was Xenoforce's way but it had problems with saving data between one form to the other.
-CommandSetUpgrade here is NOT used for changing the CommandSet(eventhough I have function the way it supposed to be).
--It is used to remove form change upgrades, since we rely on ObjectCreateUpgrade to supply the passenger(form)
Issues:
-I'm still trying to figure out who remove the 'Unit Lost' audio when changing passengers.
HOPEFULLY, Now HOPEFULLY You can comprehend all of these things.
I'm terrible at explaining these myself.
There could be something done to lessen the ModularRider code though.
Edited by user Wednesday, May 13, 2015 7:43:01 AM(UTC)
| Reason: Not specified