['Question] ResourceBonuses?

The_guy

Elephantary School.
Joined
Nov 23, 2010
Messages
64
Location
Holland.
For my first mod project (proudproudproud) I'm in favor of adding a few new resourcebonuses to the game. But.
I couldn't find the resourcebonus infos in the BTS files, so I started digging in the Civ4vanilla files, where I found in terrain one neat file containing all resources and properties. Happy as I was, I cloned (working on a XML-editing program made by someone..?) the gems and changed it to the diamond resource with proper properties. I reloaded my mod, and tadaah: an error, which cost my holding Enter for a minut. The game loaded, but without resources, meaning: Tanks required no oil, swordsmen without iron, no bonus in health for deers+supermarket. But what file should I change, and what file should I use to get into adding a resource?

Yet, thanks.
 
No, I'm afraid I deleted it, since it's a minor change, and it crashed, so I considered redoing it.
Anyway, I was trying to load my game with just a regular version of the civ4bonusinfos.xml attached in the terrain folder.

I got this error (the same as I got earlier):

Failed Loading XML file xml\Terrain/CIV4BonusInfos.xml
[.\FXml.cpp:133] Error parsing XML File -
{tab} File: {tab} xml\Terrain/CIV4BonusInfos.xml
{tab} Reason: {tab} Inhoud van element is ongeldig {means: content of component is invalid}
volgens DTD/Schema.
Wordt verwacht {means: Is expected} (x-schema:CIV4TerrainSchema.xml)iAIObjective

{tab}Line: {tab} 25,13
{tab}Source:

<iHealth>0</iHealth>
followed by errors of all stuff consuming resources (enter for around a minute)
and loading without resources as described in my first post.
What I got from the error isn't much but I tried to add the Schema file of Civ4. I can't find that, but I added the BonusClass file from civ4 and loaded the game.
The same as above applied.
Tired, I added the TerrainSchema file from vanilla, and loaded the game.
Guess what happened.

So what did other modders do to add resources? If I know how they did this, I can mimic them.
 
Almost every change in the game will require several XMLs to be edited. In the case of changing a resource, I would start with: Sid Meier's Civilization 4\Beyond the Sword\Mods\XXXXX\Assets\XML\Terrain\CIV4BonusInfos.xml. This will list all the types or resources in the mod.

Then go to: Sid Meier's Civilization 4\Beyond the Sword\Mods\XXXXX\Assets\XML\Terrain\CIV4ImprovementInfos.xml. This file lists how the Resource is improved.

You may also want to go to: \Sid Meier's Civilization 4\Beyond the Sword\Mods\XXXXX\Assets\XML\Units\CIV4BuildInfos.xml. This file controls what units can affect the resource -- such as building a farm on mine.

If you change a graphic look, you will need to do it here:Sid Meier's Civilization 4\Beyond the Sword\Mods\XXXX\Assets\XML\Art\ CIV4ArtDefines_Bonus.xml.

XXXX = Your Mod.

Another big thing is to change as little as possible -- syntax is crucial in the game and consistency is required. Everything is case sensitive, so if you have diamonds, Diamonds, and DIAMONDS; that represents three different kinds of gems -- keep everything in the same case. You should see a pattern from within the pre-existing XML.

It appears daunting at first but as long as you go slowly and make notes, it is fairly simple. In my mod I have added a total of 60 Bonus Resources.

Good Luck
 
Almost every change in the game will require several XMLs to be edited. In the case of changing a resource, I would start with: Sid Meier's Civilization 4\Beyond the Sword\Mods\XXXXX\Assets\XML\Terrain\CIV4BonusInfos.xml. This will list all the types or resources in the mod.

Then go to: Sid Meier's Civilization 4\Beyond the Sword\Mods\XXXXX\Assets\XML\Terrain\CIV4ImprovementInfos.xml. This file lists how the Resource is improved.

You may also want to go to: \Sid Meier's Civilization 4\Beyond the Sword\Mods\XXXXX\Assets\XML\Units\CIV4BuildInfos.xml. This file controls what units can affect the resource -- such as building a farm on mine.

If you change a graphic look, you will need to do it here:Sid Meier's Civilization 4\Beyond the Sword\Mods\XXXX\Assets\XML\Art\ CIV4ArtDefines_Bonus.xml.

XXXX = Your Mod.

Another big thing is to change as little as possible -- syntax is crucial in the game and consistency is required. Everything is case sensitive, so if you have diamonds, Diamonds, and DIAMONDS; that represents three different kinds of gems -- keep everything in the same case. You should see a pattern from within the pre-existing XML.

It appears daunting at first but as long as you go slowly and make notes, it is fairly simple. In my mod I have added a total of 60 Bonus Resources.

Good Luck

Yes, I know about the last 2 things, I added my own improvement. But as stated above, I can't find the SidMeier'sCivilization4\BeyondtheSword\Mods\XXXXX\Assets\XML\Terrain\CIV4BonusInfos.xml file, so I can't edit it. Importing it from vanilla evolves into a big error.
Oh, and I've played your mod. I like it.
 
I got this error (the same as I got earlier):
...

Found the problem: The syntax (=schema) for this file have slightly changed from vanilla to Warlords (Added a iAIObjective element, which appears in the error). Take the Civ4BonusInfos.xml from warlords and you should be fine.
 
Found the problem: The syntax (=schema) for this file have slightly changed from vanilla to Warlords (Added a iAIObjective element, which appears in the error). Take the Civ4BonusInfos.xml from warlords and you should be fine.
Thanks a lot. Never played Warlords (jumped in civ while BtS was out), so I didn't come up with a solution like this. My mod can now move on. :woohoo:
 
Or borrow from mine -- you might need to edit out some other stuff, but I have allot of the XMLs in my Mod's folder.

I think I'll maybe use some buildings and promotions but mainly artworks from other mods. I'm not worthless in artwork, i just can't do it. :cry:
 
Top Bottom