1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Civ 4 XML Tutorial Part 1

Discussion in 'Civ4 - Modding Tutorials & Reference' started by BrentRitchie, Oct 30, 2005.

  1. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,839
    Location:
    Germany / Netherlands
    Just clicking "save" should work.


    You're not running vista, aren't you?
     
  2. Drunk Link

    Drunk Link Chieftain

    Joined:
    Jul 21, 2009
    Messages:
    18
    Location:
    United States
    I am running Vista. It says it doesn't support the file type. It's pissing me off!!!
     
  3. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,839
    Location:
    Germany / Netherlands
    :confused: what? When does it say that? Can you take a screenshot?
     
  4. Drunk Link

    Drunk Link Chieftain

    Joined:
    Jul 21, 2009
    Messages:
    18
    Location:
    United States
    I guess. I couldn't save it so I have to do it all over again.
     
  5. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,839
    Location:
    Germany / Netherlands
    :confused: that's strange.

    Beside that problem: Are you logged in as administrator/do you run notepad with administrator rights?
     
  6. Drunk Link

    Drunk Link Chieftain

    Joined:
    Jul 21, 2009
    Messages:
    18
    Location:
    United States
    Yes I do. It is n administrator.
     
  7. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,839
    Location:
    Germany / Netherlands
    I have no real idea, where the problem could be.

    Maybe it's still a problem with the access rights. Did you try to copy the file to your desktop and to change it there?
     
  8. Greggorion

    Greggorion Chieftain

    Joined:
    Dec 15, 2009
    Messages:
    1
    for me, it says the civilizations folder is empty. no xml files what so ever
     
  9. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,839
    Location:
    Germany / Netherlands
    Welcome to CFC :).

    To the question: Err...what :confused:?
     
  10. 22bebo

    22bebo Chieftain

    Joined:
    Dec 16, 2009
    Messages:
    125
    I liked the tutorial, it was good. If you highlighted the actual code in a different colour, it might be easier to read.
     
  11. 22bebo

    22bebo Chieftain

    Joined:
    Dec 16, 2009
    Messages:
    125
    I can't find the designated folders. In mine it has CustomAssests/Xml/Civilizations, and it stops there.
     
  12. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,839
    Location:
    Germany / Netherlands
    :confused: maybe i can't read the tutorial clearly enough, but what folders else do you need?
     
  13. 22bebo

    22bebo Chieftain

    Joined:
    Dec 16, 2009
    Messages:
    125
    I wanted to see one of the original game files to kind of get a look at the format. I know what he's got is one, but I just wanted to check.
     
  14. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,839
    Location:
    Germany / Netherlands
    Original game files are under C:\Program Files\Firaxis Games\Civ\BtS\.
     
  15. 22bebo

    22bebo Chieftain

    Joined:
    Dec 16, 2009
    Messages:
    125
    Ah! Thank you! That makes life much easier.
     
  16. bwcbwc

    bwcbwc Chieftain

    Joined:
    Jan 5, 2010
    Messages:
    39
    A few gotchas I've found doing a simple mod to GlobalDefinesAlt.xml in Vista:
    1) If you use an XML editor like XML Copy Editor, make sure the file is being saved in Windows (CRLF) as opposed to Unix (CR) line termination format. Civ IV will throw a syntax error on the XML file if it is not in windows format.
    2) If you attempt to save the file directly in \Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\XML, it will instead save a shadow copy to your \Users\yourname\AppData\Virtual Store\Program Files\... etc. This file will not be readable by other users on the computer. In fact, it appears that if you originally installed Civ 4 with one ID and are running it under another ID it will not read the file in any case.

    I did find that putting the file in \Users\myName\Documents\My Games\Sid Meier's Civilization 4\CustomAssets\xml worked fine once I got past the syntax error issue. Note that in addition to my own changes, I also set the value of the override define to 1. I'm not sure if this is required, but I don't see any reason to change it.
    <Define>
    <DefineName>MODS_SHOULD_OVERRIDE_GLOBAL_DEFINES_HERE</DefineName>
    <iDefineIntVal>1</iDefineIntVal>
    </Define>

    In order to ensure you save in Windows format, you can use Notepad, but when you save, if you do "Save As" be sure to change the file type in the save dialog from Text file to All Files, or it will append a .txt extension.

    I've found my best option is to use a one of several free text editors that do XML syntax highlighting and allow you to set the line termination format if that becomes necessary. Some examples are Programmers' Notepad ( http://www.pnotepad.org/download/ ) and Notepad++ (Sourceforge: http://notepad-plus.sourceforge.net/uk/download.php ). These are both Open Source Freeware. As is XML Copy Editor...
     
  17. Zmon

    Zmon Chieftain

    Joined:
    May 20, 2010
    Messages:
    10
    Does all this work the same for bts???
     
  18. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    30,839
    Location:
    Germany / Netherlands
    Nearly.
    There are some differences, some tags have been moved, some have been newly added, but in general it's the same.
     
  19. TMaxwell86

    TMaxwell86 Chieftain

    Joined:
    Nov 24, 2008
    Messages:
    10
    Location:
    Sackville, NB, Canada
    Thank you bwcbwc for that last input - it explains why I kept get some kind of syntax error when I was trying to create a Canadian Civ. I don't recall the specific wording, but something about "XML at top of page" blah blah blah. I got so frustrated that I eventually gave up.
    Thank you also to The_J. I may just try again to create my Canadian Civ and make sure I follow your tutorial...
     
  20. TMaxwell86

    TMaxwell86 Chieftain

    Joined:
    Nov 24, 2008
    Messages:
    10
    Location:
    Sackville, NB, Canada
    Also, Thank you especially to Brent - great job on the Tutorial, Now if only I can get Vista to behave. Any idea if Windows 7 behaves the same way?
     

Share This Page