GUIDE: Adding new units

sovarn said:
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://civ4wiki.com/wiki/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.
hey
I'm new to adding units but could you help me with this unpak stuff?, possibly go over it in more detail as this is the only thing that's causing me a problem.
The main problem is that i cant unpak the Art0.fpk using the pak build utility, apart from this the rest of it is fine.

Thanks for the help
 
Apologies for this:
I do not find it easy at all to add anything. Speaking from a viewpoint of modding a lot of Civ3 stuff, I find it to be way too much bother with Civ 4. Wasnt it stated that Civ 4 would be the most moddable version yet?

I have to massively disagree. Is there any program in the works either official or un- that will make the whole process easier?

Let the flames commence:
 
baxman said:
hey
I'm new to adding units but could you help me with this unpak stuff?, possibly go over it in more detail as this is the only thing that's causing me a problem.
The main problem is that i cant unpak the Art0.fpk using the pak build utility, apart from this the rest of it is fine.

Thanks for the help


after patching 1.52 (I believe) the art paks have been broken down to:

Assets0.fpk
Assets1.fpk
Assets2.fpk
Assets3.fpk


unpack those files using the pak build utility


to unpack them hit the "PAK" tab in the pak build utility

then click on "unpack"

find the directory which those above mentioned files are used and unpack them

repeat as necessary


NOTE: I usually unpak them all and search for the specific image I want to modify later


THEREFORE unpak them in a different directory (besides your CIV4 directory) so that you will not get confused and confuse your files with the game :goodjob:




when you edit a image (dds) file replace that file in the path you found it in (but remember to make it in your civ4 folder)

you may have to create new folders in your mod or custom asset respective directories to do this (remember the game still unpaks the folders upon load up ... that's why you have to create folders because those folders only exist when loading the game up.... and the game reads the art files in the mods and custom assets over the unpaked "vanilla" version :crazyeye:



hope that helps ;)
 
Mirv Sheelon said:
Apologies for this:
I do not find it easy at all to add anything. Speaking from a viewpoint of modding a lot of Civ3 stuff, I find it to be way too much bother with Civ 4. Wasnt it stated that Civ 4 would be the most moddable version yet?

I have to massively disagree. Is there any program in the works either official or un- that will make the whole process easier?

Let the flames commence:

well technically CIV4 is MORE moddable because you can mod almost every aspect... AI, scripts, images, characteristics, schema, buildings, units, etc

however it is NOT easier to mod since it is more complex to mod on a more fundemental level .....


if that makes sense... :crazyeye:



there are some programs to make it easier... but they are mixed results...

for basic modders I suggest only modding the XML and some image (dds) files since you can do alot... make new buildings/units/civs/resource/civics without too much complexity

for moderate to advance modders I suggest modding Python (AI process scripts) and SDK files


hope that clarifies things.... ;)


FYI I limited myself to mainly XML stuff :mischief:
 
strategyonly said:
I got the unit in the game but i only want it to me a barbarian unit, how do i do this??


then assign it as a UU in the barbarian CIV in the CIV4CivilizationInfos.xml file


find this
Code:
<Type>CIVILIZATION_BARBARIAN</Type>


and add something like this:


Code:
			<Buildings/>
			<Units>
				<Unit>
					<UnitClassType>UNITCLASS_YOURUNIT</UnitClassType>
					<UnitType>UNIT_YOURUNIT</UnitType>
				</Unit>
			</Units>

Of course remember to add the your unit to the respective files (CIV4UnitInfos.xml and CIV4UnitClassInfos.xml files etc.)


Hope that helps ;)
 
strategyonly said:
Sounds simple enough, (only took a MONTH for an answer), thx Officer Reene for answering this, your a great help, keep up the good work.



yeah well I was trying to motivate you to find the answer yourself....:p

you SHOULD know how to figure out how to MOD XML by now :mischief:


j/k

Ive been busy... trying to sell my house... but I had some time so I figured I answer some questions since I had some time to clear out my >ahem< msg alerts :lol: (which I know it's been a while but there are OTHER experts...more advanced experts... than me here :D )
 
Officer Reene said:
yeah well I was trying to motivate you to find the answer yourself....:p

you SHOULD know how to figure out how to MOD XML by now :mischief:


j/k

Ive been busy... trying to sell my house... but I had some time so I figured I answer some questions since I had some time to clear out my >ahem< msg alerts :lol: (which I know it's been a while but there are OTHER experts...more advanced experts... than me here :D )



UMMM i wonder why they just sit back and dont help the community then, damn mine was a simple answer, guess they dont care anymore about SIMPLE people like me, LOL.:p
 
strategyonly said:
UMMM i wonder why they just sit back and dont help the community then, damn mine was a simple answer, guess they dont care anymore about SIMPLE people like me, LOL.:p





I cant speak for the rest of them...

I can only help when I can...;)
 
I´m trying to delete units from my mod´s unitinfos.xml, but the game gives an error message from civilizations/civilizationinfos.xml, when I deleted ICBM unit. Why it gives an error message from there? :confused:
 
I´m trying to delete units from my mod´s unitinfos.xml, but the game gives an error message from civilizations/civilizationinfos.xml, when I deleted ICBM unit. Why it gives an error message from there? :confused:

it's because the vanilla version adds that unit to the barbarian civs ...

FYI: so the barbs can't make that unit :lol:


so just use your search feature to find "ICBM" and delete that info :goodjob:


that should work


hope that helps ;)
 
OK, thanks for help. I just found it myself, and was about to post it here. Now I can get rid of those units. :goodjob:
 
trying to add new units and have hit a few snags. one, which i dont think will affect play, is how do i get the unit info into the civlopedia? all i have is a pic, the button


you need to edit CIV4GameText_Civilopedia_Units.xml file



and add the info there...

remember you have to define the tagline in CIV4UnitInfos.xml file:
(for Example)

Code:
		<UnitInfo>
			<Class>UNITCLASS_AXEMAN</Class>
			<Type>UNIT_AXEMAN</Type>
			<UniqueNames/>
			<Special>NONE</Special>
			<Capture>NONE</Capture>
			<Combat>UNITCOMBAT_MELEE</Combat>
			<Domain>DOMAIN_LAND</Domain>
			<DefaultUnitAI>UNITAI_COUNTER</DefaultUnitAI>
			<Invisible>NONE</Invisible>
			<SeeInvisible>NONE</SeeInvisible>
			<Description>TXT_KEY_UNIT_AXEMAN</Description>
			[COLOR="Blue"]<Civilopedia>TXT_KEY_UNIT_AXEMAN_PEDIA</Civilopedia>[/COLOR]

and put that tagline in CIV4GameText_Civilopedia_Units.xml file


hope that helps ;)
 
yeah that does help now i know where to look thanks. ill give it a try and see if i cant get it to work :)

well let me know how it goes and I'll try to help if necessary ;)


also you can download a mod... which uses all the stuff you need and see what they did... :D
 
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.
where's this pakbuild utity
 
Back
Top Bottom