Jump to content


[Tutorial] Adding A New Unit


No replies to this topic

#1 Chrizz

    E-Studios™ 2012

  • Gold Member
  • 2012 posts
  • Projects: C&C3: Tiberium Icestorm

Posted 19 September 2005 - 12:32

By: Vanguard
Alright guys here’s a very straight forward tutorial on adding a new unit. The files you'll need are ChinaVehicle.ini, AmericaVehicle.ini, CommandButton.ini, CommandSet.ini.

Alright now before you open anything make sure you have all the right folders in the Zero Hour Main Directory.

*Areas within are just for after the tutorial. Once you learn it.
*Areas within are to be added to the existing code.

You need an INI folder in the Data folder. If you are going to use new models and cameos you need an Art folder in the main directory, the Art folder will contain the W3d folder where you put your new w3d files, and then the Texture folder where all your .dds, .tga files are stored so the game can read them. If you don't have the folders in the right area, you'll either not see your new unit in the commandbar menu, this has to do with the inis. Or your unit will be invisible which is a problem with the game finding your W3D folder, or your model will be pink or some other color, and this problem has to do with the game being able to read from your Textures folder. If everything is working you'll see your new side, models, and skins.

Ok now on to business

First open the AmericaVehicle.ini and then paste this into the AmericaVehicle.ini.

;------------------------------------------------------------------------------
Object AmericaTankOverlord

; *** ART Parameters ***
SelectPortrait = SNOverlord_L
ButtonImage = SNOverlord

UpgradeCameo1 = Upgrade_ChinaUraniumShells
UpgradeCameo2 = Upgrade_ChinaNuclearTanks
UpgradeCameo3 = Upgrade_ChinaOverlordBattleBunker
UpgradeCameo4 = Upgrade_ChinaOverlordGattlingCannon
UpgradeCameo5 = Upgrade_ChinaOverlordPropagandaTower


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

ConditionState = RUBBLE
Model = NVOvrlrd_d
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:Overlord
Side = America
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 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 = 2000
BuildTime = 20.0 ;in seconds
VisionRange = 150
ShroudClearingRange = 200
Prerequisites
Object = AmericaWarFactory
Object = AmericaStrategyCenter
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 = ChinaTankOverlordDefaultCommandSet

; *** 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 = 1100.0
InitialHealth = 1100.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

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 = ProductionUpdate ModuleTag_24
MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
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

Behavior = ObjectCreationUpgrade ModuleTag_07
UpgradeObject = OCL_OverlordGattlingCannon
TriggeredBy = Upgrade_ChinaOverlordGattlingCannon
ConflictsWith = Upgrade_ChinaOverlordPropagandaTower Upgrade_ChinaOverlordBattleBunker
End
Behavior = WeaponSetUpgrade ModuleTag_WeaponSetUpgrade01
TriggeredBy = Upgrade_ChinaOverlordGattlingCannon
ConflictsWith = Upgrade_ChinaOverlordPropagandaTower Upgrade_ChinaOverlordBattleBunker
End
Behavior = ObjectCreationUpgrade ModuleTag_08
UpgradeObject = OCL_OverlordPropagandaTower
TriggeredBy = Upgrade_ChinaOverlordPropagandaTower
ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordBattleBunker
End
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
End
Behavior = CommandSetUpgrade ModuleTag_11
CommandSet = ChinaTankOverlordGattlingCannonCommandSet
TriggeredBy = Upgrade_ChinaOverlordGattlingCannon
ConflictsWith = Upgrade_ChinaOverlordPropagandaTower Upgrade_ChinaOverlordBattleBunker
End
Behavior = CommandSetUpgrade ModuleTag_12
CommandSet = ChinaTankOverlordPropagandaTowerCommandSet
TriggeredBy = Upgrade_ChinaOverlordPropagandaTower
ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordBattleBunker
End
Behavior = CommandSetUpgrade ModuleTag_13
CommandSet = ChinaTankOverlordBattleBunkerCommandSet
TriggeredBy = Upgrade_ChinaOverlordBattleBunker
ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordPropagandaTower
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

Now save your work. Now open the ini called CommandSet.ini. Then Paste this into it.

CommandSet AmericaWarFactoryCommandSet
10 = Command_ConstructAmericaTankOverlord
End

Now save your work, and then open CommandButton.ini.

CommandButton Command_ConstructAmericaTankOverlord
Command = UNIT_BUILD
Object = AmericaTankOverlord
TextLabel = CONTROLBAR:ConstructAmericaTankOverlord
ButtonImage = SNOverlord
ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipAmericaBuildOverlord
End

Now save your work. Congratulations, you have just added a new unit.

Edited by Chrizz, 19 September 2005 - 12:34.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users