GUIDE: Adding new units

You can only change the values which are already in the UnitInfos.xml, and you can't just add other tags in there, they would not work.

If you want totally new abilities, then you'd have to program that in (and that would be then the wrong tutorial for you ;)).
 
Hey I THINK i did everything in the tutorial right but by all the new units showing up as red domes apparently i didnt. anyone else with this problem or know what i can do to fix it?
 
I apologize if this is the wrong place to ask this question. I am trying to change some units stats or values or whatever they are called, and I notice for ROM that instead of using terrain offense and defense, Afforesse used featureattacks and featuredefense, and I just wondered why, and if any problems could be caused going the other way?
 
2nd question. If I want to change a units offense and defense in flatlands, do I have to do this <FeatureAttack><FeatureType>FEATURE_PLAINS</FeatureType>
<iFeatureAttack>50</iFeatureAttack>
</FeatureAttack> for grassland and marsh and tundra separately?
 
Oh, if you prefer terrain or feature related attack/defense values is just a matter of taste and what you want to do, nothing more.

...er...yes, you have to do it separately, but together in the main tag...er...e.g.:
PHP:
			<TerrainAttacks>			
				<TerrainAttack>
					<TerrainType>TERRAIN_TUNDRA</TerrainType>
					<iTerrainAttack>50</iTerrainAttack>
				</TerrainAttack>
				<TerrainAttack>
					<TerrainType>TERRAIN_PLAINS</TerrainType>
					<iTerrainAttack>50</iTerrainAttack>
				</TerrainAttack>
			</TerrainAttacks>
 
Love Civ IV and remember my days tinkering around with modding Civ II. Not much I want to change, except for one thing:

I want to make Mechanized Infantry also require having the Oil resource. But have absolutely no clue on how to do that. I have BtS (3.17) any idea on where I need to look?

Ayeshteni
 
I have no trouble adding new units: they show up in game properly and the button icons all work. However, the green/white/red dot status indicator button that used to appear at the top of every unit's (even unmodded units) flagstaff has disappeared. How to I get that to come back?
 
Where's the Newbie friendly tutorial?... like has absolutely no experience is modding Civ IV because it's modding interface sucks compared to 3's.
 
Hi, Civ4 BTS noob here. Anyone know how I can add artillery type attack to a spy unit? I'm working on a saboteur that can destroy stuff. I'm using the Great Spy assets, but don't have the ability to attack a unit or city. Any hints would be great. Thanks!
 
i am attempting to add a unit from FfH2 to a new mod to do some tinkering, and I get everything to work correctly, except that my marksman just stands there with his arms out at his side all the time in map, and in pedia
 
Hi I realize no one has posted in here in over a year, so sorry if an inconvenience...
Im new to modding civ 4, so far i managed to make a civ, add a tech, all with buttons and text entries. (After much trial and error I might add)

I have followed this tutorial to the word and I keep getting this same error

its in Artdefines_Units it says line 11, 12
<fscale>0.61</fscale>

then in unitclassinfos it says 15,17

<DefaultUnit>UNIT_LION</DefaultUnit>
Then it goes into a whole bunch of errors I'm assuming originating from these two.

very confused as i didnt edit anything in that area???

I pasted everything at the bottom as directed.
please help uploaded the two files in question, tried to get screenshots of errors but print screen button doesnt work.

the content ive attempted to add is the last entry reskined warrior names Brand instead of terry


*******problem solved had the artdefines xml from vanilla in there....******
 

Attachments

  • CIV4ArtDefines_Unit.xml
    86.1 KB · Views: 186
  • CIV4UnitClassInfos.xml
    21.1 KB · Views: 118
Last edited:
UPDATED***

Hello Civ4 lovers. I have previously(3years ago) knew exactly how to add second Unique Units and Buildings to CIV4. Now started to do it again, my unit appears on the map, but i stuck on the part ,,how to assign unit to specific civilization". It seems that you should add units in CIV4CivilizationInfos.xml file under<units> </units> tag, but it keeps crashing and saying file is failed to load, the game keeps on running. All i want to do is to replace a certain unit with my modded one and to assign it to specific civilization. Now it works only with all civilizations. Thank you in advance
 
Last edited:
PART 3 - Referencing and Graphics

Okay now for the more time consuming bit - graphics. (Hopefully someone created that skin for you otherwise this will be easy for those with a nimble digital paintbrush).

For normal units all you have to do is create one button image for your unit. An image will automatically be created to select the unit when it is in a stack.

Create a new .dds image called terry.dds and put it in .../Art/Interface/Buttons/Units/Terry.dds. Note that the Art folder is in the Assets folder. It is different to XML/Arts folder. In other words when you look in your custom assets folder you will see an Art and XML folder.

Somehow either export or edit the .dds file. It should be 64x64 pixels at 200 pixels/inch. They best way is to copy and rename an existing .dds and just edit that picture so you get to keep the blue frame.

PART 4 - Play the game

Now you can play your own unique unit you just put in. Have fun.

NOTE: creating a new Great person or specialist is similar but will require extra changes. It is a bit more complex with more files to edit and a couple of extra buttons.
I may write another guide if people want this.

Now you can add you own units in. Go ahead, you know you want to. You may now commence commenting on how useful this was (or not as the case may be :p ) Any ommissions or mistakes please point it out.

Thanks
Hi, great guide. but I didn't understand how to change unit stats, for example increase the strength of attack or defense or both
 
Top Bottom