| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
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. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Emperor
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. |
|
|
|
|
|
#2 |
|
Maker of Worlds
|
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.
__________________
Civilization + Minecraft = CIVCRAFT 2.0 ![]() Don't have Conquests? Let me help you out. MOD | FOLD | BLOG | TWEET |
|
|
|
|
|
#3 |
|
Moderator
![]() 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")
|
|
|
|
|
|
#4 |
|
Modder For Life
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 beOne night I dreamt of wondrous things. When I awoke, I made a mod. |
|
|
|
|
|
#5 |
|
Maker of Worlds
|
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?
__________________
Civilization + Minecraft = CIVCRAFT 2.0 ![]() Don't have Conquests? Let me help you out. MOD | FOLD | BLOG | TWEET |
|
|
|
|
|
#6 |
|
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. |
|
|
|
|
|
#7 |
|
King
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
|
|
|
|
|
|
#8 |
|
Emperor
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. |
|
|
|
|
|
#9 |
|
vBülletin Förum
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. |
|
|
|
|
|
#10 | |
|
Modder For Life
Join Date: Apr 2002
Location: Exit 16, New Jersey
Posts: 6,811
|
Quote:
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 beOne night I dreamt of wondrous things. When I awoke, I made a mod. |
|
|
|
|
|
|
#11 |
|
Maker of Worlds
|
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.
__________________
Civilization + Minecraft = CIVCRAFT 2.0 ![]() Don't have Conquests? Let me help you out. MOD | FOLD | BLOG | TWEET |
|
|
|
|
|
#12 |
|
King
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. |
|
|
|
|
|
#13 | |
|
Maker of Worlds
|
Quote:
__________________
Civilization + Minecraft = CIVCRAFT 2.0 ![]() Don't have Conquests? Let me help you out. MOD | FOLD | BLOG | TWEET |
|
|
|
|
|
|
#14 | |
|
Moderator
![]() Join Date: Feb 2002
Location: Baltimore
Posts: 23,546
|
Quote:
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. |
|
|
|
|
|
|
#15 |
|
Maker of Worlds
|
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.
__________________
Civilization + Minecraft = CIVCRAFT 2.0 ![]() Don't have Conquests? Let me help you out. MOD | FOLD | BLOG | TWEET |
|
|
|
|
|
#16 |
|
King
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
|
|
|
|
|
|
#17 |
|
Moderator
![]() 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")
|
|
|
|
|
|
#18 |
|
King
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. |
|
|
|
|
|
#19 |
|
Moderator
![]() 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")
|
|
|
|
|
|
#20 |
|
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.
|
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|
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 |