How do you edit or add buildings/wonders?

seady

Prince
Joined
Aug 30, 2006
Messages
582
Location
Sydney
I was playing warlords and noticed the AI always built the great wall really early and so it only enclosed a tiny space, thus making it useless except for blocking other people from getting it. Certainly not a great wall if it wraps a single city!!! The trouble is, that the AI doesn't care about the strategic value of a large area covered by this unusual wonder.

I thought about the real great wall, and how long it took to build.

"...
The Great Wall of China is a Chinese fortification built from the 3rd century BC until the beginning of the 17th century... "

2000 years in the making! No wonder it was so huge. In the game it always seems to be built in a few hundred years and it is so small it is pointless, since it's value depends on having a large empire first, which is very difference from stonehenge say which grows as you do (until calender, but maybe the great wall should be obsolete with gunpowder or rifling).

I wanted to alter it slightly to triple the cost of building it or add other requirements but i couldn't find a single how-to edit or add buildings/wonders. I'm not a programmer or an artist but i could get by with civ3 doing this.

Can anyone give me some advice?
 
Ok first off if you know any XML this will be a huge help.
If you do Just go into your Firaxis Games/Civilization4/Warlords/Assets/XML/Buildings folder then right click on the Civ4BuildingInfos.xml file and head down to "Copy" you will eventually copy this to your MyMod folder but not yet. This will be located at Civilization4/Warlords/Mods/

Now in your mods folder you want to create a new folder with your own mod name. I would call it New Great Wall or somthing like that. Inside there you're going to want to create the whole new assets folder, so the first folder you want to create is "assets" then in that folder you want to create XML, then inside XML you want to create Buildings. Then once your inside "Buildings" then you can paste your file there and edit it.


If you don't know any XML I can help a bit with this.



Ok so you open the file I just told you. (In your mods folder) To edit it you should use Notepad or someother XML reading program like Notepad, Me I use Notepad++ which is a freeware program that can be used for a lot of different codes.

Ok, so we start out in this file and you'll see a whole load of organized code. This is XML. What you want to do is find the Great Wall of china. Where is this? well it's a big file so it may take a while in Notepad to find, but if you have some other program that uses a Find command use it. In Notepad++ it's ctrl+f for that command. The great wall of china is way down near the bottom if you don't have that command.

Ok, so we've found it. And you will see a bunch of <BuildingClass>BUILDING_CLASS_GREAT_WALL</BuildingClass> What this is, is it's a tag. when you see a tag, there should be a <BuildingClass> to start it. (It doesn't have to be "BuildingClass" I'm just using it as an example.) and </BuildingClass> to end it. Notice the "/ " that tells the computer the tag is over. You need that. But you don't really need to know that really.

Ok so what you want to edit is what is inside those Tags. When writing inside the tags, it is Case sensitive. And EVERYTHING is in capitol letters. You must do this.

Ok just clarifing that. Now for what you want. If you just want to raise the Cost of it. You will scroll down to <iCost> </iCost> (Just for clarifing. The I stands for Intiger It means that you will place a number like 256 in there and that will be the Cost. If there is a <bCost> </bCost> the B will stand for Boolean which means it will be either a 1 [yes] or a 0 [no]).

This is where you want to increase the number. To whatever you want.
There are many other commands here and the Civ4BuildingsInfos.xml is one of the more flexible files and you can do quite a bit of experimenting for yourself.

Most of the stuff is self-explainitory for instance <iMilitaryProductionModifier> or <iWorkerSpeedModifier>.

If you're stuck you can always scroll up and check the format of other buildings your looking to "recreate" their abilities.
Also http://civ4wiki.com/wiki/index.php/XML_files will help quite a bit for any XML editing your doing. Don't forget about the search button. There are tons of Tuts on Civfanatics that can help you out like they did me when I was starting out editing and modding.

If you want to edit the text files and other stuff, then thats what it's for. If your just starting out I would suggest just doing the basic stuff in the Infos.xml files (Like UnitInfos.xml and BuildingInfos.xml) But I wouldn't go into more files because the more you edit one file. The more files you'll have to edit because everything has a reference.

For example If I change the name of my <Civilopedia> </Civilopedia> entry I would have to "Copy""Paste" a whole new Civilopedia file and make a new entry in there..etc.

But once you get the hang of it you'll be having a great time being able to make your little tweaks here or there.


Hope this helped.
Splinter13.
 
Thanks for your advice! A decade ago I knew HTML and this stuff is sort of the same except for the case sensitivity (and apparently indentation has to be exact... ergh!) Between that and your posting i have figured out how to modify the great wall successfully! Even made it faster with iron and copper. One tiny step for mankind, one giant leap for me. :)

I then got ambitious and tried that tank factory you worked on. A lot of this seemed a straight copy/paste job but then \TankFactory\Assets\XML\Text had filenames that didn't correspond properly to those in the mod i was playing with. I did my best but got a pink icon in my main screen (bit fuzzy because i was working late on it and i just got up). I figured that meant something wasn't linking to the artwork correctly and it was just showing the mask.

I clicked on it and CTD. Darn, i was hoping for some sort of error message. I've tried to get a text listing of the directories but sheesh the command prompt in xp is dated! (Can't cope with long filenames, what's with that! Ah well, maybe vista will be better. ) I was mucking about in a copy of "Amra's Modpack v2" if you know it.

This is a screenshot of my Warlords\Mods\fiddling Amra's Modpack v2\Assets\XML\Text directory. I think this is where i went astray because i wasn't certain where to copy and paste the entries from your text directory to. What mapped to where? Or was i missing the point?

I found the tank factory entry in each of the files below:

CIV4GameText_Warlords_Civilopedia_WW2_Buildings.xml

CIV4GameText_Warlords_WW2_Objects.xml

CIV4GameText_Warlords_WW2_Strategy.xml

I figured:

1) Amra_GameTextInfos_Pedia_Buildings.xml matched CIV4GameText_Warlords_Civilopedia_WW2_Buildings.xml,

2) CIV4GameText_Warlords_WW2_Objects.xml matched
Amra_GameTextInfos_Buildings.xml

3) CIV4GameText_Warlords_WW2_Strategy.xml matched with ????
"<TEXT>
<Tag>TXT_KEY_BUILDING_TANK_FACTORY_STRATEGY</Tag>
<English>This Building gives a +2 exp bonus for every tank build in a city with this building.</English>
</TEXT>"

I couldn't find anything similar to that in the amra mod and i don't know how in windows to search through a group of text files for a string matching "<Tag>TXT_KEY_BUILDING_" which i am guessing is the best strategy for locating where this goes.

I'm lost. I think i understand how to edit an existing building now to an extent but adding in a new one created by someone else seems overwhelming.

I've just noticed a difference in CIV4ArtDefines_Building.xml

You have <Button>,Art/Interface/Buttons/Buildings/Factory.dds,Art/Interface/Buttons/Buildings_Atlas.dds,7,2</Button>
I had <Button>Art/Interface/Buttons/Buildings/Factory.dds,Art/Interface/Buttons/Buildings_Atlas.dds,7,2</Button>
I think i must have edited that comma out because it seemed to be a syntax error: is it important? I'm going to try with the "," back in, but i'm still vague about "<TEXT>
<Tag>TXT_KEY_BUILDING_TANK_FACTORY_STRATEGY</Tag>
<English>This Building gives a +2 exp bonus for every tank build in a city with this building.</English>
</TEXT>"

If you have survived reading this far, you deserve much karma for your next life.:goodjob:
 
Arrrrgh I must have put in that "<TEXT>
<Tag>TXT_KEY_BUILDING_TANK_FACTORY_STRATEGY</Tag>
<English>This Building gives a +2 exp bonus for every tank build in a city with this building.</English>
</TEXT>" in the right place because as soon as i added that darn comma, it seemd to work correctly! I don't remember doing it, and i can't find where i put the tag. :blush:

Is there documentation somewhere on why "<Button>Art/" is used sometimes and "<Button>,Art/" is used elsewhere? I can't yet see a pattern.

Thanks again for your help!
[edit] This was answered here by Ploeperpengel and i apologise for not googling properly. :hammer2:

"<Button>,Art/Interface/Buttons/TechTree/Mysticism.dds,Art/Interface/Buttons/TechTree_Atlas.dds,4,11</Button>
It's only one file. The first .dds is the name of the button. The "," before the Art/Interface... tells the game to use an atlasmap. The second part tells the game which atlasmap to use and on what coordinate it finds the button."
[/edit]
 
Back
Top Bottom