Jump to content
Sign in to follow this  

Adding new units to C&C Zero Hour

Recommended Posts

Okay I need help with tib edit 2 I just want to add new units I do not care about skins or any of that just how to duplicate a unit and make it trainable in a skirmish battle.

P.S I am pretty confident I can figure the rest out when I make the unit usable.

Any help appreciated

Share this post

Link to post

Well if you intend to make a campaign unit or something else that's in the code buildable, check out this tutorial I made

Share this post

Link to post

For making of new units, you'll need to place them either in an existing INI or make your own for the sake of easier finding if you botch something up.


Let's make a duplicate of an American Humvee for this particular tutorial. We'll place it in a new INI file. In your ZH directory, you'll need to go to the Data folder, then create the following subfolders, the next one contained in the previous, as follows: INI\Object\. Inside it, create a Notepad file and name it ModUnits.ini (note that if the icon doesn't have a gear, then you need to uncheck hiding known extensions in the folder options and delete the .txt extension.)


Okay, let's make some coding to match the Humvee. Open the new "ModUnits.ini" and type this (use copy paste, it's a long one). Basically, this coding is mostly already done, just so you can examine what can be changed or toyed with. Note that the initial name is "AmericaVehicleHumveeClone" not to interfere with the real one. There are some explanations after semicolons in the coding so you can know what this will all mean.


Object AmericaVehicleHumveeClone

 ; *** ART Parameters ***
 SelectPortrait		 = SAHummer_L   ;portrait visible in the command bar at the bottom of the screen
 ButtonImage			= SAHummer	 ; cameo used in Weapons factories

 UpgradeCameo1 = Upgrade_AmericaBattleDrone
 UpgradeCameo2 = Upgrade_AmericaScoutDrone
 UpgradeCameo3 = Upgrade_AmericaHellfireDrone
 UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
 UpgradeCameo5 = Upgrade_AmericaTOWMissile

 Draw = W3DTruckDraw ModuleTag_01
OkToChangeModelColor = Yes  ;if the team colour can be changed

ConditionState = NONE
  Model = AVHUMMER
  Turret = Turret
  ShowSubObject = Turret
  HideSubObject = TurretUp01 Housecolor03 MuzzleFXUP01
  WeaponFireFXBone = PRIMARY Muzzle
  WeaponMuzzleFlash = PRIMARY MuzzleFX

ConditionState = REALLYDAMAGED
  Model = AVHUMMER_d
  Turret = Turret
  ShowSubObject = Turret
  HideSubObject = TurretUp01 Housecolor03 MuzzleFXUP01
  WeaponFireFXBone = PRIMARY Muzzle
  WeaponMuzzleFlash = PRIMARY MuzzleFX

  Model = AVHUMMER
  Turret = TurretUp01
  HideSubObject = Turret MuzzleFX01
  ShowSubObject = TurretUp01 Housecolor03
  WeaponFireFXBone = PRIMARY MuzzleUp
  WeaponMuzzleFlash = PRIMARY MuzzleFXUp
  WeaponFireFXBone = SECONDARY WeaponB
  WeaponLaunchBone = SECONDARY WeaponB
  WeaponFireFXBone = TERTIARY WeaponB
  WeaponLaunchBone = TERTIARY WeaponB

  Model = AVHUMMER_d
  Turret = TurretUp01
  HideSubObject = Turret MuzzleFX01
  ShowSubObject = TurretUp01 Housecolor03
  WeaponFireFXBone = PRIMARY MuzzleUp
  WeaponMuzzleFlash = PRIMARY MuzzleFXUp
  WeaponFireFXBone = SECONDARY WeaponB
  WeaponLaunchBone = SECONDARY WeaponB
  WeaponFireFXBone = TERTIARY WeaponB
  WeaponLaunchBone = TERTIARY WeaponB

TrackMarks = EXTireTrack.tga

Dust = RocketBuggyDust
DirtSpray = RocketBuggyDirtSpray
PowerslideSpray = RocketBuggyDirtPowerSlide

; These parameters are only used if the model has a separate suspension,
; and the locomotor has HasSuspension = Yes.
LeftFrontTireBone = Tire01
RightFrontTireBone = Tire02
LeftRearTireBone = Tire03
RightRearTireBone = Tire04
TireRotationMultiplier = 0.2   ; this * speed = rotation.
PowerslideRotationAddition = 1.25   ; This speed is added to the rotation speed when powersliding.


 ; ***DESIGN parameters ***
 DisplayName		   = OBJECT:Humvee
 Side				  = America
 EditorSorting		 = VEHICLE
 TransportSlotCount	= 3				 ;how many "slots" we take in a transport (0 == not transportable)
Conditions = None
Weapon = PRIMARY HumveeGun
Weapon = SECONDARY HumveeMissileWeaponAirDummy
 WeaponSet    ;this is something we can play with as we wish - you can look up different weapons in the game's INI files (INIZH.big, can be opened with XCC Mixer)
Weapon = PRIMARY HumveeGun	 ; current primary weapon - the gun
Weapon = SECONDARY HumveeMissileWeapon  ; current secondary weapon - the missile
Weapon = TERTIARY HumveeMissileWeaponAir ; current tertiary weapon - the AA missile
PreferredAgainst = TERTIARY	 AIRCRAFT
Conditions	  = None
Armor		   = HumveeArmor	 ;type of armour, various types available in INIZH.big
DamageFX		= TruckDamageFX
 BuildCost	   = 700
 BuildTime	   = 10.0		  ;in seconds	
 VisionRange	 = 150
 ShroudClearingRange = 320
Object = AmericaWarFactory   ;what do we need to build in order to build this unit
 ExperienceValue = 50 50 100 150   ;Experience point value at each level
 ExperienceRequired = 0 100 150 300  ;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	  = AmericaVehicleHumveeCommandSet    ;the set of command buttons for this unit, be careful with these

 ; *** AUDIO Parameters ***
;these change the way units speak.
 VoiceSelect = HumveeVoiceSelect
 VoiceMove = HumveeVoiceMove
 VoiceGuard = HumveeVoiceMove
 VoiceAttack = HumveeVoiceAttack
 VoiceAttackAir = HumveeVoiceAttackTOW
 SoundMoveStart = HumveeMoveStart
 SoundMoveStartDamaged = HumveeMoveStart
 SoundEnter = HumveeEnter
 SoundExit = HumveeExit

; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
;TurretMoveStart	= NoSound
VoiceCreate		 = HumveeVoiceCreate
TurretMoveLoop	  = TurretMoveLoop
SoundEject		  = PilotSoundEject
VoiceEject		  = PilotVoiceEject
VoiceCrush		  = HumveeVoiceCrush
 ; Required for the W3DTruckDraw module
TruckLandingSound = RocketBuggyLand
TruckPowerslideSound = RocketBuggyPowerslide
VoiceUnload = HumveeVoiceUnload
VoiceEnter = HumveeVoiceMove

 ; *** ENGINEERING Parameters ***
 RadarPriority = UNIT
;change the above only if you intend to make this unit an aircraft or if you need to disable its transport feature

 Body = ActiveBody ModuleTag_02
MaxHealth	   = 240.0
InitialHealth   = 240.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 = 480
SubdualDamageHealRate = 500
SubdualDamageHealAmount = 50
 Behavior = TransportAIUpdate ModuleTag_03
  TurretTurnRate = 180
  RecenterTime = 5000   ; how long to wait during idle before recentering
AutoAcquireEnemiesWhenIdle = Yes
MoodAttackCheckRate		= 250
 Locomotor = SET_NORMAL HumveeLocomotor

 Behavior = PhysicsBehavior ModuleTag_04
Mass = 50.0

 Behavior = TransportContain  ModuleTag_05    ;parameters of the transport feature
PassengersAllowedToFire = Yes
Slots			 = 5
;	EnterSound		  = GarrisonEnter
;	ExitSound		   = GarrisonExit
DamagePercentToUnits = 100% ;10%
AllowInsideKindOf  = INFANTRY
ExitDelay = 250
NumberOfExitPaths = 3 ; 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

 Behavior = ObjectCreationUpgrade ModuleTag_06  ;location of the upgrade
UpgradeObject = OCL_AmericanBattleDrone
TriggeredBy   = Upgrade_AmericaBattleDrone
ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
 Behavior = ObjectCreationUpgrade ModuleTag_07 ;location of the upgrade
UpgradeObject = OCL_AmericanScoutDrone
TriggeredBy   = Upgrade_AmericaScoutDrone
ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
 Behavior = ObjectCreationUpgrade ModuleTag_14 ;location of the upgrade
UpgradeObject = OCL_AmericanHellfireDrone
TriggeredBy   = Upgrade_AmericaHellfireDrone
ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone

 Behavior = ProductionUpdate ModuleTag_08
MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame

 Behavior = WeaponSetUpgrade ModuleTag_09
TriggeredBy = Upgrade_AmericaTOWMissile
 Behavior = ExperienceScalarUpgrade ModuleTag_10
TriggeredBy = Upgrade_AmericaAdvancedTraining
AddXPScalar = 1.0 ;Increases experience gained by an additional 100%

 Behavior = SlowDeathBehavior ModuleTag_11
ProbabilityModifier = 25
DestructionDelay = 1
OCL = INITIAL  OCL_InitialHumveeDebris
FX  = FINAL	FX_BattleMasterExplosionOneFinal
OCL = FINAL	OCL_FinalHumveeDebris

 Behavior = DestroyDie ModuleTag_12  ;animation effects of death

 Behavior = FXListDie ModuleTag_13
DeathFX = FX_CarCrush

 Behavior = CreateCrateDie ModuleTag_CratesChange   ;animation effects of model decay
CrateData = SalvageCrateData
;CrateData = EliteTankCrateData
;CrateData = HeroicTankCrateData

; This is commented out per hotlist request 10/9 ML
;  Behavior = CreateObjectDie ModuleTag_15
;	CreationList = OCL_AmericanRangerDebris01
;	ExemptStatus = HIJACKED
;  End

 Behavior = EjectPilotDie ModuleTag_16
ExemptStatus = HIJACKED
; The following added out per hotlist request 10/9 as above ML
VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
GroundCreationList = OCL_EjectPilotOnGround
AirCreationList = OCL_EjectPilotViaParachute

 Behavior = TransitionDamageFX ModuleTag_17
ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition

 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.

 Geometry = BOX
 GeometryMajorRadius = 14.0
 GeometryMinorRadius = 7.0
 GeometryHeight = 11.5	
 GeometryIsSmall = Yes
 ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length


Save the changes.

After this, look into my previous tutorial to make the unit buildable. If anything breaks, come back here.

Share this post

Link to post

Man thank you so much for helping me I have no way to express my thanks! So you just want me to add the text you posted into and INI file?

Edited by DarkMajor21

Share this post

Link to post

Yes, just to test if it works and play around with it so you can get the hang of it.

Share this post

Link to post

As far as ModUnits.ini is concerned, you're done. Look back to the tutorial about making units buildable (http://forums.cncnz.com/topic/14852-making-unusable-units-playable-in-cc-zh/page__p__188844#entry188844), and where there's AmericaPOWTruck, place AmericaVehicleHumveeClone. Don't touch the command set and the ButtonImage value in CommandButton.ini should be set to SAHummer.

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.