Xml

I've got the explanations for most of the XML tags (i'd say about 90%), and will be posting them as soon as I can get my hands on the 'full game' and get them verified.

Until then, if in doubt about any value, just ask :)

The <CommerceChanges> and <ExtraYieldThreshold> tags really need to have descriptive sub-tags instead of repeating themselves (3 repetitions of <iCommerce> and <iExtraYieldThreshold>, respectively). Obviously they're affecting 3 different values (or, actually, since they're both set to 0 0 2, skipping two values and affecting the third...) but the XML doesn't tell you what values they are, and that leads to confusion. The 2's are culture and coins, but what are the 0's? No way to know without messing around with it.

True, but that would make it impossible for us to mod in new Commerce types or Yield types, since we can't create new XML tags. :)

The easy way to find the meaning of the <iCommerce> and <iExtraYieldThresholds> is to open the GameInfo/CIV4CommerceInfos.xml and Terrain/CIV4YieldInfos.xml.

The CommerceInfos.xml file contains three entries: Gold, Research and Culture, and those correspond to the three values of <iCommerce>.

The YieldInfos.xml file also contains three entries: Food, Production and Commerce.


It'll take a while to learn how to navigate these files, but trust me, once you get a bit more familiar with them, everything is going to seem easy as a peach. :)
 
Isak said:
The easy way to find the meaning of the <iCommerce> and <iExtraYieldThresholds> is to open the GameInfo/CIV4CommerceInfos.xml and Terrain/CIV4YieldInfos.xml.

The CommerceInfos.xml file contains three entries: Gold, Research and Culture, and those correspond to the three values of <iCommerce>.

The YieldInfos.xml file also contains three entries: Food, Production and Commerce.

Yep, I realized that after doing a bit more research :) Overall I'm very very impressed with just the XML - I havn't even touched the python yet except a brief glance at the map generation scripts.
 
Zurai said:
Yep, I realized that after doing a bit more research :) Overall I'm very very impressed with just the XML - I havn't even touched the python yet except a brief glance at the map generation scripts.

Yeah, i'm pretty sure it will spell the end of our social lives for years to come :D
 
I'll see if I can throw together a simple xml editor in the next couple of days, the question is should I hardcode the interface or make it completely dynamic?

What I think would really be more helpfull though is an index of all the xml data, there's just so much stuff there and it's hard to find what I want to; for now I've just been browsing through them.
 
Stardog13 said:
What I think would really be more helpfull though is an index of all the xml data, there's just so much stuff there and it's hard to find what I want to; for now I've just been browsing through them.

It's a-comin'

Isak said:
I've got the explanations for most of the XML tags (i'd say about 90%), and will be posting them as soon as I can get my hands on the 'full game' and get them verified.

:)
 
Zurai said:
Yeah, I kinda wish they did one XML file per unit rather than one XML file with all 100+ units. It's a lot to slog through. Same with the buildings and a lot of the other "big systems".
You actually can do this pretty easily. One of the great things about xml is that it is easily manipulated with xsl. You can put every unit/building/tech in to its own file and then use xsl to combine them at the end. If you're clever you can have a big library of stuff and then just pick and choose which ones you want to put in the mod using xsl to do it.

<-- has been doing a lot of work lately with the Apache library.
 
Holy hell I just looked more in depth at the unitinfos XML file... yeah, I'm definitely going to be making that unit xml editor because it's the only way I'll be able to keep all these things straight in my head :crazyeye:

Upside: expect a CIV4UnitInfos.xml editor hopefully by monday evening :D
 
http://www.w3.org/Style/XSL/

Basically it allows you to change the way xml data is displayed.
Here's some short tutorials on it, you can just look through them to see what they can do; I'll try and write a quick on here and upload it.

http://www.w3schools.com/xsl/xsl_templates.asp

Edit:

Ok, here's a quick example; I'm sure there's a better way to do this then by actually changing civ's files but for now this is a good example. If you do try this please work on a copy of the files and not the ones in your civ folder.

-copy Assets\XML\Terrain\CIV4BonusInfos.xml to a different directory
-change the 8th line from
Code:
<Civ4BonusInfos xmlns="x-schema:CIV4TerrainSchema.xml">
to
Code:
<Civ4BonusInfos>
(not sure why the schema is messing it up, haven't used any schemas before with xsl)
-add the following line just before the previous line
Code:
<?xml-stylesheet type="text/xsl" href="BonusInfo.xsl"?>
-download the following file to the same directory as the copy you made and double click on the xml file (not the xsl).
 
Change the extension to .xsl and see above post.

Note that this is a very limited sample as to what you can do with xsl and as I said I'm sure there's a way to do this without directly modifying civ's files; just not sure of how right now.
 

Attachments

You found a way to add a new civilization without overwriting the old ones?
 
I'm still going through with a parser all of the XML files. Because they are intertwined, I'm looking for all the links to say, units, so that you can determine not only "how many" units, etc. but also the relative power (attack/defense) of a unit, links to the graphics, etc.

Very good stuff :)
 
he best XML edotor I've come across... and it's free! XML Marker

Freaking GENIOUS. :) Speeding up my work right and left. Thanks to others here, I should have my first major sets of mods out quick :)
 
Altova also has a free XML Editing Tool. It is the home version of XMLSpy - (I believe the professional version is the tool that Firaxis used for Civ4).

It is way too complex for me - it says it can convert XLM files to XLS files. The Text editor is what I got it for - it is much better that WordPad as there are color schemes. It will also Validate the XML file. You can also view the XML file as an html file.

Anyway, here is the link to the Free Home XMLSpy page. (They do ask for personal info in order to download it - but the app is fully functional and free.) ( I am not associated in any way with ths company.)

http://www.altova.com/download_components.html
 
Weasel Op said:
Isak, any idea when you will get Civ4 and how long it will take you to finish? I know it takes a while to get it in Europe.

I should have it friday, and then it will take me approx. a week to put up short descriptions of each XML file and element. Then I'll make it public and start working on the detailed descriptions of each XML element (as necessary).
 
Back
Top Bottom