How will Civ IV use XML?

TastySheriff

Chieftain
Joined
Oct 2, 2005
Messages
93
<snip> I want to get a look at the xml files that i will be modding soon. Ive never worked in XML so it should be an enlightening experience for me. I also want to try to get a head start on designing a tool to swap mods in and out. So if uve seen one or have one, id like to know what it looks like.

Piracy is wrong! capitalism!

Moderator Action: You can ask about XML without asking for pirated versions, or leaked files. I'm editing this thread to remove references of piracy.
 
if you would like to look at XML formated files. take a trip over to www.w3schools.com

You can even go through some XML tutorials
 
At least you can say that you have pre-order the game. Don't let piracy kill the sequels of the game!!!! (That is a message aimed to all posters ;) )

I am with Hopper, just wait two weeks, that is nothing compared to what we have already waited. Ahhh... I just remember when civrules posted the firsts screenies, It seem so long ago....
 
Here is some xml for you:

<unit name="warrior">
<movement>1</movement>
<attack>1</attack>
<defense>1</defense>
<cost>10</cost>
</unit>

<unit name="settler">
<movement>1</movement>
<attack>0</attack>
<defense>0</defense>
<cost>20</cost>
</unit>

:cool:
 
Dont forget the top level element.

in a file named Units.xml

<units>
viz said:
<unit name="warrior">
<movement>1</movement>
<attack>1</attack>
<defense>1</defense>
<cost>10</cost>
</unit>

<unit name="settler">
<movement>1</movement>
<attack>0</attack>
<defense>0</defense>
<cost>20</cost>
</unit>
</units>
 
Thanks viz and weak, that looks like itll be a breeze.

Im sure XML has some sort of comment escape sequence, but do the files come with comments in them to identify different sections or anything?

oh and for the non-believers i preordered the game a week ago and ive cleared a weekend and stocked up on Dr Pepper and coffee for the arrival. Im freaking excited.
 
<!-- this is an XML comment -->

as far as how much Civ4 is commented we dont know.
 
I wasn't aware there was ANY Civ IV leaks of anything out yet except screenshots, videos, and some previews. That's the most leaking I've seen. I mean, Civ IV isn't having a Half-Life 2-like leak crisis.
 
Jecrell said:
I wasn't aware there was ANY Civ IV leaks of anything out yet except screenshots, videos, and some previews. That's the most leaking I've seen. I mean, Civ IV isn't having a Half-Life 2-like leak crisis.

these aren't leaks. they are just structured XML data based on known units. :D
 
Jecrell said:
I wasn't aware there was ANY Civ IV leaks of anything out yet except screenshots, videos, and some previews. That's the most leaking I've seen. I mean, Civ IV isn't having a Half-Life 2-like leak crisis.

I haven't even seen any leaked screenshots, just official preview screenshots (the difference being they were authorized).
 
To clarify. This is just what the files could look like. They don't necessarily have this structure.
 
@TastySheriff: Will you mod civ 4 before playing it first? I will play a few games first myself before modding.

Settler movement is 2 btw ;).

Aks K
 
ok, well thanks for the idea, I hope that its just that simple. Thatll make the tool o so easy to write (at least when it comes to editing the xml data).

I think itll take someone with more python experience than i have to be able to package python edits, unless you can mod them with seprate files and link to those new files with xml. Any thoughts?
 
Aks K said:
Settler movement is 2 btw ;)
:p

TastySheriff said:
ok, well thanks for the idea, I hope that its just that simple. Thatll make the tool o so easy to write (at least when it comes to editing the xml data).

I think itll take someone with more python experience than i have to be able to package python edits, unless you can mod them with seprate files and link to those new files with xml. Any thoughts?
If you want to learn python, I suggest starting here http://www.python.org/ :) . XML is simply a data container, you can change the data that the game uses via the xml files, in order to change the actual features you will need to dive into coding with python.
 
viz said:
<unit name="warrior">
<movement>1</movement>
<attack>1</attack>
<defense>1</defense>
<cost>10</cost>
</unit>

<unit name="settler">
<movement>1</movement>
<attack>0</attack>
<defense>0</defense>
<cost>20</cost>
</unit>

Another possible (but less likely to be used) structure of the XML is this :

<units>
<unit name="warrior" movement="1" attack="1" defence="1" cost="10"/>
<unit name="settler" movement="1" attack="0" defence="0" cost="20"/>
</units>
 
XML is very easy to use and most of the time it's not even need to be commented as the tags almost coments themselfs, if ya get what I mean.

I say: Don't worry about the xml - thay will be a piece of cake. But for Python there's a bit more advanced programming requiered or am I wrong?
 
The main thing about scripting that you will find invaluable is to know about object referencing - particularly when it comes to referencing the XML data.
 
evil_linus said:
But for Python there's a bit more advanced programming requiered or am I wrong?


Yes, but Python is one of the easiest languages to learn. Look at the sticky thread obove here for much more info of head on over to www.python.org for more than you want to know about it.
 
warpstorm said:
Yes, but Python is one of the easiest languages to learn. Look at the sticky thread obove here for much more info of head on over to www.python.org for more than you want to know about it.


Easy to learn maybe. But probably not easy to master by people who have not programmed before. :)

I can forsee hundreds of posts from people asking why their python program does not do what they intended.

Maybe Thunderfall should consider having a forum dedicated to python and XML queries and questions only once Civ4 is released. So as not to frighten away those only interested in playing the game.
 
Top Bottom