GUIDE: Adding new units

How to add your own custom units

Beware that at the moment no one can create an actual new model but only new units with their own unique skins and/or stats. This can be added in very easily. This guide also doesn't cover changing unit stats, for that go to :http://modiki.civfanatics.com/index.php/Civ4UnitInfos for a list of tags and what they mean.

In our example we will be creating a new unit using the Warrior model with a new skin. This unit will be called Terry. Use common sense where applicable and tell me if something is wrong/missing or you just plain can't understand it.

To prepare, go to your customs assets folder or create a new mod. All files in the following guide will use the assets folder as the root. So if i say create a new folder, this folder will be created in the assets folder.

PART 1 - Getting ready

First of all you must unpak the Art0.fpk file using the PakBuild Utility to get the unit. Since new models can't be created you will have to use an existing one. Copy the whole ...arts/units/warrior folder from the unpaked .fpk file and paste it in your assets folder (either of your mod or the custom one) keeping the file structure.

Rename the folder to Terry but keep all the files inside intact i.e. do not touch them otherwise your game will crash and do funny stuff with you RAM. Get the new skin if you have one and replace it over the warrior_128.dds. The new skin has to take this name (in this example).

Next copy over your .../assets/xml/units/CIV4UnitClassInfos.xml and CIV4UnitInfos.xml to your assets folder using the same file structure.
Copy the .../assets/xml/text/CIV4GameText_Strategy.xml, CIV4GameTextInfos_Objects.xml and CIV4GameText_Civililopedia_Units.xml to your new assets folder - again keeping the file structure.
Copy the .../assets/xml/art/CIV4ArtDefines_Unit.xml over.

Now you should be ready.
since only today I started reading about civ 4 mods since I come from civ 3, I can't figure out how to insert one or more units in the game and how to associate them with a certain civilization. I'm Italian and I use google translate to write on the forum
 
since only today I started reading about civ 4 mods since I come from civ 3, I can't figure out how to insert one or more units in the game and how to associate them with a certain civilization. I'm Italian and I use google translate to write on the forum

Is there someplace in particular you are having trouble? To add a unit, you need artwork files: a button and a model. You also need four XML files: the ArtDefines, the GameText, the UnitClassInfos, and the UnitInfo. To make the unit a UU for a civilization, you also need a CivilizationInfos file.
 
Is there someplace in particular you are having trouble? To add a unit, you need artwork files: a button and a model. You also need four XML files: the ArtDefines, the GameText, the UnitClassInfos, and the UnitInfo. To make the unit a UU for a civilization, you also need a CivilizationInfos file.
thanks
 
Hello, civ compatriots. Im a civilization enjoyer since i was a child, but im starting to just edit now. I could edit some leaders and civs at will, but once i went to realism invictus, i started to have some dificulties in editing, i followed the steps i searched in the forums and i could not find a way to add a unique unit in RI. I tried to add BOPE to Brazil, just for the fun of it, i copied the USMC template, changed to Brazil_BOPE in the files: unique unite, unit class, civilizations info, derivatives civilizations info and artdefines unit files. I made it just like the USMC, but it says that it doesnt recongize unit class, therefore, it doesnt load any unit of the game. Any help is very welcoming, ive wasted 12 hours, and dont know what the heck is missing.
 

Attachments

  • CIV4ArtDefines_Unit.xml
    4.1 MB · Views: 4
  • CIV4CivilizationInfos.xml
    921.3 KB · Views: 2
  • TR_Unique_Units_CIV4UnitInfos.xml
    896.7 KB · Views: 5
Hello, civ compatriots. Im a civilization enjoyer since i was a child, but im starting to just edit now. I could edit some leaders and civs at will, but once i went to realism invictus, i started to have some dificulties in editing, i followed the steps i searched in the forums and i could not find a way to add a unique unit in RI. I tried to add BOPE to Brazil, just for the fun of it, i copied the USMC template, changed to Brazil_BOPE in the files: unique unite, unit class, civilizations info, derivatives civilizations info and artdefines unit files. I made it just like the USMC, but it says that it doesnt recongize unit class, therefore, it doesnt load any unit of the game. Any help is very welcoming, ive wasted 12 hours, and dont know what the heck is missing.

I think your problem may be that you have UNITCLASS_UNITCLASS_BRAZIL_ONLY where you should have just UNITCLASS_BRAZIL_ONLY in the TR_Unique_Units file. Try that and see if it has an effect.
 
Top Bottom