To all Unit modders

boneys26

BTS Play session tester
Joined
Nov 24, 2005
Messages
839
Location
Coventry, England
Hi guys firstly great job with the units,:goodjob:

Now, As a mod user I have a little request for you guys ( no its not a unit.. but feel free to give us a working cruise missile;) )

My request is that when you make a new unit could you please not include all the other units in the files like in the civ4unitclassinfos.xml could you just have your unit? as its a right pain in the bum when adding more than one unit like i do. I know all i have to do is got to the bottom of the page and copy the last unit but when you have to do it on more than one file and for more than one unit it takes up alot of time.

Also,

when making a new unit could you keep the files as xml or python as I've seen some really good units but they are .nif files and i have no idea how to read/add them in that way (If you know how then Plz tell me :confused: (Ok this one i got now I have to make my own .xml for it )

lol any way just a though as i said keep up the hard work, loving the units :goodjob: :goodjob:
 
The .nif files are the actual unit models, and they have to be in that format for the game to use them. And the .dds files that go with them contain the unit's "skin" (the textures and colors).

Here's a good tutorial for adding units: http://forums.civfanatics.com/showthread.php?t=139721

The only difference when adding new models that you download here is that, using that tutorial's example, you would replace the "warrior.nif" and "warrior_fx.nif" in the CIV4ArtDefines_Units.xml with the .nif file that you downloaded.

So it would look like:

Code:
	<NIF>Art/Units/Terry/SomeUnit.nif</NIF>
	<KFM>Art/Units/Terry/Warrior.kfm</KFM>
	<SHADERNIF>Art/Units/Terry/SomeUnit.nif</SHADERNIF>

You can leave the <KFM> with an origional file, to add a little bit on animation to the new unit.
 
Dual said:
The .nif files are the actual unit models, and they have to be in that format for the game to use them. And the .dds files that go with them contain the unit's "skin" (the textures and colors).

Here's a good tutorial for adding units: http://forums.civfanatics.com/showthread.php?t=139721

The only difference when adding new models that you download here is that, using that tutorial's example, you would replace the "warrior.nif" and "warrior_fx.nif" in the CIV4ArtDefines_Units.xml with the .nif file that you downloaded.

So it would look like:

Code:
	<NIF>Art/Units/Terry/SomeUnit.nif</NIF>
	<KFM>Art/Units/Terry/Warrior.kfm</KFM>
	<SHADERNIF>Art/Units/Terry/SomeUnit.nif</SHADERNIF>

You can leave the <KFM> with an origional file, to add a little bit on animation to the new unit.


nope still can't get my head round it:confused: . can't see why you can just have it as xml like the rest. Could you take a look at the new unit Mi 24 (chopper) and please tell me what I need to do?:sad: I know once I've done it once i'll be able to do it again
 
Yeah, I know it's a little confusing if you're not used to working with these files yet. I'll try to explain the process to you step by step:

But first, I need to clear up some confusion you have about the files. All the units, including the origional ones shipped with the game, have their models stored in .nif files. You just don't see the origional ones, because they are packed away inside the assets.fpk files. The XML just stores the information about how the unit acts in the game, and tells the game where to look for the unit's art files ( .nif [the 3D model], .kfm [the animation], and .dds [the skin] files).

Now to add one of the models you've downloaded, first go into your _Civ4CustomAssets folder, or the folder of a mod you are adding it to. Find the folder _Civ4CustomAssets/Art/Units. Or in a mod, Assets/Art/Units. If it's not there in the mod, create those folders.

Now create a folder there with the name of the unit you are adding. Like "MI_24_HELICOPTER". This folder is where you are going to place the mi24.nif file, along with the two .dds files that goes with it.

Once you've done that, follow the part of that tutorial I linked to titled "PART 2 - Writing in your new unit". You need to alter those XML files it shows by adding an entry for your MI 24 unit. (I'd copy the gunship entries so that you don't have to change as much.) The only thing you need to do different is when you get to the CIV4ArtDefines_Units.xml file.

In that file create your entry, but direct the <NIF> and <SHADERNIF> tags to the folder you created earlier. So it would look like this:

Code:
		<UnitArtInfo>
			<Type>ART_DEF_UNIT_MI_24_HELICOPTER</Type>
			<fScale>0.36</fScale>
			<fInterfaceScale>0.7</fInterfaceScale>
			<NIF>Art/Units/MI_24_HELICOPTER/mi24.nif</NIF>
			<KFM>Art/Units/Gunship/GunShip.kfm</KFM>
			<SHADERNIF>Art/Units/MI_24_HELICOPTER/mi24.nif</SHADERNIF>
			<ShadowDef>
				<ShadowNIF>Art/Units/01_UnitShadows/GunshipShadow.nif</ShadowNIF>
				<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
				<fShadowScale>0.75</fShadowScale>
			</ShadowDef>
			<iDamageStates>4</iDamageStates>
			<fBattleDistance>0.5</fBattleDistance>
			<fRangedDeathTime>0.12</fRangedDeathTime>
			<bActAsRanged>1</bActAsRanged>
			<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
			<AudioRunSounds>
				<AudioRunTypeLoop></AudioRunTypeLoop>
				<AudioRunTypeEnd></AudioRunTypeEnd>
			</AudioRunSounds>
			<SelectionSound>AS3D_UN_GUNSHIP_FORT</SelectionSound>
			<ActionSound>AS3D_UN_GUNSHIP_FORT</ActionSound>
		</UnitArtInfo>

Also notice I removed the sound from the
Code:
	<AudioRunTypeLoop></AudioRunTypeLoop>
	<AudioRunTypeEnd></AudioRunTypeEnd>
tags. There's a bug where those sounds don't work properly with new models. So I just remove the link to the sounds because I find it annoying to listen to.

And that should do it. Try it out, and if you have any more questions just ask. Hope that was helpful, because that took a while to type out. :p
 
Dual said:
if you have any more questions just ask. Hope that was helpful, because that took a while to type out. :p


Lol I will try it now thanks for your time and help :goodjob: I'll let you know how i got on
 
DUAL your a star

Works fine one problem tho, as you can see on the screen shot theres no button for it, its pink no pic how do i do that?
 
Glad you were able to get the unit in there. :)

If you're not particular about the icon, the easiest thing to do would be to just use one of the origional units' icons.

To do that, just open up the CIV4UnitInfos.xml file and find where you added the MI24. Then paste this into the <Button> tag:

Code:
<Button>,Art/Interface/Buttons/Units/Gunship.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,5,10</Button>

That will give the MI24 the Gunship icon.

If you want to make your own icon, go about that and then place the finished .dds file into the Assets/Art/Interface/Buttons/Units folder. Then reference that file in the <Button> tag like above. Except you would leave out the atlas part and the commas. So it would be:

Code:
<Button>Art/Interface/Buttons/Units/MI24_Button.dds</Button>
 
Well thanks to you Dual I have now added more units than i could before and Its alot easier than when i first try'd thanks at least I now know where to start and what I'm looking to change
 
I just got 3dsmax so i can learn that too lmao I thought it would be easyish so far i can make a box lol any way how do i import a civ4 unit so i can play with it changing bits round to teach myself
 
Back
Top Bottom