Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization

Notices

Reply
 
Thread Tools
Old Oct 26, 2005, 07:30 PM   #1
the100thballoon
Emperor
 
the100thballoon's Avatar
 
Join Date: Aug 2003
Posts: 1,239
Xml

Anyone tried to make sense of the XML files yet? I glanced at one of them and its not too confusing, but a tutorial is definately in order. Anyone up to the challenge?
__________________
Aspire to inspire before you expire.
the100thballoon is offline   Reply With Quote
Old Oct 26, 2005, 08:06 PM   #2
WildWeazel
Maker of Worlds
 
WildWeazel's Avatar
 
Join Date: Jul 2003
Location: %CIV3%\Conquests\Scenarios\
Posts: 6,689
Images: 11
Sig. Fourth line. Clicky.
I'll expand and adapt it to cover Civ when I get it. Right now it's more of a basic intro.
WildWeazel is offline   Reply With Quote
Old Oct 26, 2005, 09:06 PM   #3
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 23,546
Ok, here's a quickie:

Think of XML like UBB code, only more structured.

You have: [.b]bold [.u]nested underline[/u] end underline [/b] end bold.
It looks like:

[.b]
[.u]
[/u]
[/b]

XML works the same way. (Look at the source in your browser -- view->source. It looks like HTML too).

You'll see something like:

<units>
<strength>5</strength>
</units>

the <strength>...</strength> field tells the game that it's the strength of the unit. If you change 5 to say, 50, you have one powerful unit!
__________________
"Never trust an Aztec with nukes!" (Civ1 - unknown) | 2nd user of the Ancient Style.
South America (based on El Mencey's Map) | N & S America (based on El Mencey's Map) | C3C Scenario: 7,000 Turns Civ2 Earth for C3C | Old Style Civ3 for C3C | "Future is Wild" map
How to upload multiple files to a post | File Upload | Paint Shop Pro 3.11 shareware (screenshot util - doesn't expire) | Chieftess' Culture Flip Calc | Don't wind up like this AI! | resource icons file To download a patch: Select "Advanced" from the main menu, and go to "Check for Updates". || My Web Journal (yes, it's a "blog")
Chieftess is offline   Reply With Quote
Old Oct 26, 2005, 09:31 PM   #4
Dom Pedro II
Modder For Life
 
Dom Pedro II's Avatar
 
Join Date: Apr 2002
Location: Exit 16, New Jersey
Posts: 6,811
I could maaaybe whip something up.. but I'd rather somebody else did
__________________
Dynamic Unique Units Modcomp : Announcing Dom Pedro II's Civilization 4: Test of Time : Dom Pedro II's Mod Helper for Python Modders and those who would like to be

One night I dreamt of wondrous things. When I awoke, I made a mod.
Dom Pedro II is offline   Reply With Quote
Old Oct 26, 2005, 09:36 PM   #5
WildWeazel
Maker of Worlds
 
WildWeazel's Avatar
 
Join Date: Jul 2003
Location: %CIV3%\Conquests\Scenarios\
Posts: 6,689
Images: 11
I'll take care of it when my game arrives.

@CT (or whoever): I don't suppose it would be legal for somebody to send me a piece of the xml?
WildWeazel is offline   Reply With Quote
Old Oct 27, 2005, 01:23 AM   #6
popewiz
Warlord
 
Join Date: Aug 2005
Posts: 101
Ok, I'll try to help out a little before I go to sleep. First of all, everything we'll be modding will be in the folder marked .../Firaxis Games/Sid Meier's Civilization 4/Assets. From there just open the XML folder and look around. I decided to open up the Units folder and check out the Civ4UnitInfos.xml file. Each unit in the game has a listing just like this:

<UnitClassInfo>
<Type>UNITCLASS_HINDU_MISSIONARY</Type>
<Description>TXT_KEY_UNIT_HINDU_MISSIONARY</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>3</iMaxPlayerInstances>
<DefaultUnit>UNIT_HINDU_MISSIONARY</DefaultUnit>
</UnitClassInfo>

The numbers in between reflect the total number of units of that type allowed in the entire map, for each team, and for each player. -1 means that there is no limit, and any number including 0 places a limit on that type. Try changing the number 3, starting the hindu religion in the game, and you'll see that you'll be able to build that many hindu missionaies. Anyway, I'm off to sleep now very exciting times ahead.
popewiz is offline   Reply With Quote
Old Oct 27, 2005, 02:41 AM   #7
bhiita
King
 
bhiita's Avatar
 
Join Date: Jun 2002
Posts: 886
I don't have the game yet, but try this program out... the best XML edotor I've come across... and it's free! XML Marker


bhiita is offline   Reply With Quote
Old Oct 27, 2005, 04:57 AM   #8
the100thballoon
Emperor
 
the100thballoon's Avatar
 
Join Date: Aug 2003
Posts: 1,239
Notepad2 is also a great program for editing any type of code. Ive done basic work with XML and I know HTML so I'll probably just sit down and mess with it one day (prolly today or tomorow )
__________________
Aspire to inspire before you expire.
the100thballoon is offline   Reply With Quote
Old Oct 27, 2005, 05:25 AM   #9
Flak
vBülletin Förum
 
Flak's Avatar
 
Join Date: May 2001
Location: Manchester, England
Posts: 1,523
I'm going to be using Visual SlickEdit. It's nice because it has autoformatting if you setup an xml project. The same with Python. I've been messing around with and it saves a LOT of typing. Can't wait to get my hands (well, editor) on Civ IV, set up a project and just search through all of the code to see what's available.
__________________
I'm addicted to Civ, but I draw the line at "Shell = Civ.exe".

Last edited by Flak; Apr 05, 2006 at 05:08 AM.
Flak is offline   Reply With Quote
Old Oct 27, 2005, 03:25 PM   #10
Dom Pedro II
Modder For Life
 
Dom Pedro II's Avatar
 
Join Date: Apr 2002
Location: Exit 16, New Jersey
Posts: 6,811
Quote:
Originally Posted by popewiz
Ok, I'll try to help out a little before I go to sleep. First of all, everything we'll be modding will be in the folder marked .../Firaxis Games/Sid Meier's Civilization 4/Assets. From there just open the XML folder and look around. I decided to open up the Units folder and check out the Civ4UnitInfos.xml file. Each unit in the game has a listing just like this:

<UnitClassInfo>
<Type>UNITCLASS_HINDU_MISSIONARY</Type>
<Description>TXT_KEY_UNIT_HINDU_MISSIONARY</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>3</iMaxPlayerInstances>
<DefaultUnit>UNIT_HINDU_MISSIONARY</DefaultUnit>
</UnitClassInfo>

The numbers in between reflect the total number of units of that type allowed in the entire map, for each team, and for each player. -1 means that there is no limit, and any number including 0 places a limit on that type. Try changing the number 3, starting the hindu religion in the game, and you'll see that you'll be able to build that many hindu missionaies. Anyway, I'm off to sleep now very exciting times ahead.

Does this determine the number of units that can be constructed at all? or the number of units that are allowed at any one time? So if you build the 3 Hindu Missionaries and then expend two of them, can you build two more?

If this is the case: I smell modified immortals and any other UU that is actually an elite unit that should be limited in the numbers that can be produced.
__________________
Dynamic Unique Units Modcomp : Announcing Dom Pedro II's Civilization 4: Test of Time : Dom Pedro II's Mod Helper for Python Modders and those who would like to be

One night I dreamt of wondrous things. When I awoke, I made a mod.
Dom Pedro II is offline   Reply With Quote
Old Oct 27, 2005, 03:33 PM   #11
WildWeazel
Maker of Worlds
 
WildWeazel's Avatar
 
Join Date: Jul 2003
Location: %CIV3%\Conquests\Scenarios\
Posts: 6,689
Images: 11
I just looked in the xml folder and
those files are huge!

I guess I have my work cut out for me on that tutorial.
WildWeazel is offline   Reply With Quote
Old Oct 27, 2005, 09:07 PM   #12
Zurai
King
 
Zurai's Avatar
 
Join Date: Apr 2004
Posts: 726
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".

They did an excellent job with their naming convention, though, with the only confusion I've had so far being with the Creative and Financial leader traits. 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.
Zurai is offline   Reply With Quote
Old Oct 27, 2005, 09:10 PM   #13
WildWeazel
Maker of Worlds
 
WildWeazel's Avatar
 
Join Date: Jul 2003
Location: %CIV3%\Conquests\Scenarios\
Posts: 6,689
Images: 11
Quote:
Originally Posted by Zurai
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".
Hopefullly somebody who is a better programmer than me will make an editor. Until then, I guess Ctrl-F works.
WildWeazel is offline   Reply With Quote
Old Oct 27, 2005, 09:13 PM   #14
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 23,546
Quote:
Originally Posted by Weasel Op
Hopefullly somebody who is a better programmer than me will make an editor. Until then, I guess Ctrl-F works.
You could do it with Python (cross-compatibility, but I think you'd need the python engine). I have .NET, but you need the .NET framework...

I still have Borland C++, but that's quirky.

.NET can do XML though, I've tried it.

I actually find CTRL-F in notepad to work wonders. It's much easier to copy/paste in notepad than using a 3rd party XML tool. (they are out there...)
__________________
"Never trust an Aztec with nukes!" (Civ1 - unknown) | 2nd user of the Ancient Style.
South America (based on El Mencey's Map) | N & S America (based on El Mencey's Map) | C3C Scenario: 7,000 Turns Civ2 Earth for C3C | Old Style Civ3 for C3C | "Future is Wild" map
How to upload multiple files to a post | File Upload | Paint Shop Pro 3.11 shareware (screenshot util - doesn't expire) | Chieftess' Culture Flip Calc | Don't wind up like this AI! | resource icons file To download a patch: Select "Advanced" from the main menu, and go to "Check for Updates". || My Web Journal (yes, it's a "blog")

Last edited by Chieftess; Oct 27, 2005 at 09:16 PM.
Chieftess is offline   Reply With Quote
Old Oct 27, 2005, 09:17 PM   #15
WildWeazel
Maker of Worlds
 
WildWeazel's Avatar
 
Join Date: Jul 2003
Location: %CIV3%\Conquests\Scenarios\
Posts: 6,689
Images: 11
Would it be possible in C? I have a final project coming up and I'm supposed to be deciding what my program is going to do.
WildWeazel is offline   Reply With Quote
Old Oct 27, 2005, 09:28 PM   #16
Zurai
King
 
Zurai's Avatar
 
Join Date: Apr 2004
Posts: 726
Actually I may be able to whip up an XML viewer/editor, but it would be pretty ugly and would only be for specific files most likely. I'm familiar with parsing in XML data, the difficulty is purely in meshing it with an MFC framework (Microsoft Foundation Class - ie C++ equivalent of visual basic). Depending on how difficult it winds up being it may be a while before I get it done - I do have non-Civ tasks to do that take up a lot of my time
Zurai is offline   Reply With Quote
Old Oct 27, 2005, 09:30 PM   #17
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 23,546
You could make a parser even in C...

But, remember, there's so much to look at with the XML, and not one sample unit/building/etc. will do you justice. There could be nested XML code that one object doesn't have. It'll be a fun project if you like structs. (I just wished .NET didn't do away outright with arrays, structs and whatnot.... it's still there in, but in different forms.)
__________________
"Never trust an Aztec with nukes!" (Civ1 - unknown) | 2nd user of the Ancient Style.
South America (based on El Mencey's Map) | N & S America (based on El Mencey's Map) | C3C Scenario: 7,000 Turns Civ2 Earth for C3C | Old Style Civ3 for C3C | "Future is Wild" map
How to upload multiple files to a post | File Upload | Paint Shop Pro 3.11 shareware (screenshot util - doesn't expire) | Chieftess' Culture Flip Calc | Don't wind up like this AI! | resource icons file To download a patch: Select "Advanced" from the main menu, and go to "Check for Updates". || My Web Journal (yes, it's a "blog")
Chieftess is offline   Reply With Quote
Old Oct 27, 2005, 09:37 PM   #18
Zurai
King
 
Zurai's Avatar
 
Join Date: Apr 2004
Posts: 726
The way I was thinking about doing it was pretty brute-force (at least for now). Manually compile a list of all the unit subtags, for example, then make a UnitXML struct and parse in all the units into a linked list or vector of the structs, then allow the user to edit all the fields.

Like I said, very brute force and hard coded and not exactly robust, but it'd be a start and would let you view and edit a single unit at a time.

The earliest I'd be able to even get started working on it is saturday afternoon, though.
Zurai is offline   Reply With Quote
Old Oct 27, 2005, 09:46 PM   #19
Chieftess
Moderator
 
Chieftess's Avatar
 
Join Date: Feb 2002
Location: Baltimore
Posts: 23,546
I've dabbled in XML coding a little bit (so many nodes! ). I'm not too familar with it, but my strategy would be parsing it into a myriad of structures. The problem is making them dynamic... So, it would only be a limited use tool in that most of the stuff you add is rather static. (same as all other types of data)
__________________
"Never trust an Aztec with nukes!" (Civ1 - unknown) | 2nd user of the Ancient Style.
South America (based on El Mencey's Map) | N & S America (based on El Mencey's Map) | C3C Scenario: 7,000 Turns Civ2 Earth for C3C | Old Style Civ3 for C3C | "Future is Wild" map
How to upload multiple files to a post | File Upload | Paint Shop Pro 3.11 shareware (screenshot util - doesn't expire) | Chieftess' Culture Flip Calc | Don't wind up like this AI! | resource icons file To download a patch: Select "Advanced" from the main menu, and go to "Check for Updates". || My Web Journal (yes, it's a "blog")
Chieftess is offline   Reply With Quote
Old Oct 28, 2005, 12:01 AM   #20
popewiz
Warlord
 
Join Date: Aug 2005
Posts: 101
About my earlier post, the numbers tell you how many you can have at any 1 time. So your UU idea would definitely work out.
popewiz is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Xml

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SDK/XML] Problem with new text tag in XML salaminizer Civ4 - SDK/Python 11 Jan 09, 2009 11:34 AM
Help editing XML with MS XML Notepad 2007 Acronym2 Civ4 - Creation & Customization 4 Jun 22, 2008 11:11 PM
XML parse error in CIV4PlotLSystem.xml--FIX largeprimenumbe Civ4 - Technical Support 0 Mar 03, 2007 09:50 AM
CIV IV - XML Breakdown - CIV4BuildingInfos.xml Taranthor Civ4 - Creation & Customization 1 Nov 23, 2005 09:25 AM
XML SOLUTION - Quits On XML initialiazation without any further message laptopsolution Civ4 - Technical Support 3 Oct 30, 2005 03:20 PM


Advertisement

All times are GMT -6. The time now is 08:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR