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

HOW TO: Add a Civ/Unit/Building in BTS (Modular XML Modding)

Discussion in 'Civ4 - Modding Tutorials & Reference' started by Teg_Navanis, Jul 31, 2007.

  1. Teg_Navanis

    Teg_Navanis King

    Joined:
    Jan 21, 2006
    Messages:
    737
    I think your folder structure is wrong. It should look like this:

    but it looks like this:

    I still got a CTD when loading, but it worked fine when I changed the follwowing things (not all of them caused a crash, some just an error message).

    - Delete test_CIV4LeaderHeadInfos2.xml to make sure it isn't loaded.

    - Make sure that all ArtDefines references are to existing art files (I changed some from upper case to lower case).

    - Change the art (EarlyArtDefineTag) of your UNIT_WAMPANOAG_GUERILLAS from ART_DEF_UNIT_HELLEBARDIER to ART_DEF_UNIT_WAMPANOAG_GUERILLA. This stopped the game from crashing. Remember: whenever the game crashes without warning, it's usually the art files that are to blame (references to non-existing art).

    I still got some error message though:

    - In your Civ4CivilizationInfos.xml, the following code bits are missing:
    -- an end tag </Cities> after line 42.
    -- you need a tag <Leaders> right before the first <Leader> tag and a </Leaders> tag after the last </Leader> tag. This is necessary to allow for multiple leaders.

    - Your unit is called UNIT_WAMPANOAG_GUERILLA in your CivilizationInfos, but UNIT_WAMPANOAG_GUERILLAS in your UnitInfos.

    After making these changes (dunno if the first two are necessary, the last three definitely are), it worked fine.
     
  2. Sightburner

    Sightburner Chieftain

    Joined:
    Apr 4, 2007
    Messages:
    26
    Awesome - Thank you SO much!
    But I (Of course) have just one more question. While the mod now loads, everything is appearing as tags; instead of "Metacomet", my leader is showing up as "TXT_KEY_LEADER_METACOMET".

    How would I fix this?

    EDIT: Nevermind; I figured it out. I'd missnamed my TXT file <_<.
    Now I just need to get the yellow sheen off of my flag :D

    ~S~
     
  3. JeanZGerman

    JeanZGerman Chieftain

    Joined:
    Apr 28, 2006
    Messages:
    5
    How's it going Teg. This is my first mod. After creating a new Civ, I had an initial audio problem with diplo music.

    I copied my code into some audio module I found online and that worked. But now i've created two new civs and the game crashes everytime it tries to load the audio data.

    I put the code for the two new civs just like I did the original and the civs work fine (but with no diplo music) if I remove the audiodefines and etc files. Does anyone have any suggestions?
     
  4. Teg_Navanis

    Teg_Navanis King

    Joined:
    Jan 21, 2006
    Messages:
    737
    JeanZGerman, what audio module did you use? According to the Modder's Guide (see first post), audio files (and the XML files dealing with sound/audio) don't work with modular loading.
     
  5. JeanZGerman

    JeanZGerman Chieftain

    Joined:
    Apr 28, 2006
    Messages:
    5
    It was some sort of universal audio files for a plug and play mod. However, I didn't actually do any modular loading (well to the best of my knowledge). In the config file, I have modular loading set to 0.

    Here is the site where I got it. http://forums.civfanatics.com/forumdisplay.php?f=255

    When I used his universal audio files, id did correct the problem when I added one civ, just not 3. Maybe it's a schema thing, but I don't know anything about that.
     
  6. Teg_Navanis

    Teg_Navanis King

    Joined:
    Jan 21, 2006
    Messages:
    737
    I do not know how this plug and play audio file works, nor am I sure if it works at all if you set modular loading to 0. I do not think, however, that you need to use that 'universal audio file' since the idea behind it is that it includes data for as many civs as possible, so that you can use it no matter which modular civs you actually want to use. If you're doing your own mod with only the standard civs + three of your own, you could try editing the standard file until it works.
     
  7. Gurra09

    Gurra09 First Consul

    Joined:
    Jan 1, 2008
    Messages:
    1,284
    My civilizations (Sweden and Norway) doesn't come up in the Choose a Civilization-list or in the Civilopedia when but it's no problems with the XML when I load my mod.

    What can be wrong?


    Gurra09
     
  8. Teg_Navanis

    Teg_Navanis King

    Joined:
    Jan 21, 2006
    Messages:
    737
    You can always test whether the modular files load or not by planting an error in them (deleting a '>' or so). If there is no error message when you start your mod, the files don't load.

    If this is the case, you should make sure that you have modular loading enabled (the file you have to modifiy is automatically created the first time you load a mod; it should be in your mod's main directory). Then, double-check the directory structure and whether you have all the schema files necessary.
     
  9. Gurra09

    Gurra09 First Consul

    Joined:
    Jan 1, 2008
    Messages:
    1,284
    OK, I should check that now and then look in the game again...

    It doesn't work, the XML files is wrong and it's something with a line that's "gone" from the XML and isn't in the schema. Maybe the wrong is that I've copied and cut the civilization infos from my mod for original Civ IV?


    Gurra09
     
  10. Gurra09

    Gurra09 First Consul

    Joined:
    Jan 1, 2008
    Messages:
    1,284
    My civilizations works with BTS now. Thank you for this guide!


    Gurra09
     
  11. Premier Valle

    Premier Valle FF: Babylon 5 Mod Team

    Joined:
    Sep 9, 2007
    Messages:
    675
    Location:
    Ich bin in Mexico Stadt
    Thank you for this guide!!

    I'm starting to mod civ (already experienced in other games), and you have been a great help for getting me started.
    :thanx:
     
  12. DrJambo

    DrJambo Crash-test dummy

    Joined:
    Dec 27, 2001
    Messages:
    1,027
    Location:
    Athens of the North (Edinburgh)
    I've asked this in a few threads, so apologies in advance for the duplication.

    Is it possible to load modules through the Custom Assets tree instead of the Mod/Assets route? If this is possible, where does one put the Modules folder, i.e. the one that contains the xml, and there any specific naming convention required?

    Cheers
     
  13. Teg_Navanis

    Teg_Navanis King

    Joined:
    Jan 21, 2006
    Messages:
    737
    Officially, I think it should be possible. It didn't work when I tried it though. If you still want to try, the folder structure should theoretically be CustomAssets\Modules\whateveryouwant, since CustomAssets corresponds to the Assets folder.
     
  14. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,055
    Location:
    San Diego, California
    In buildinginfo.xml how do you tel the game a building is a wonder, a national project, or a building? I don't see xml tags
     
  15. jkp1187

    jkp1187 Unindicted Co-Conspirator

    Joined:
    Aug 29, 2004
    Messages:
    2,496
    Location:
    Pittsburgh, Pennsylvania
    Projects are located in CIV4ProjectInfo.xml under the GameInfo folder.
     
  16. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,055
    Location:
    San Diego, California
    I see now! its in the buildingclassinfos.xml

    <iMaxGloablInstance>
    <iMaxPlayerInstance>
    <iExtraPlayerInstance> ?????????
     
  17. Bahmo

    Bahmo King

    Joined:
    May 7, 2006
    Messages:
    836
    Thanks for making this; it will be helpful in adding another civilization to BTS.
     
  18. DEADLY9996

    DEADLY9996 Chieftain

    Joined:
    Nov 4, 2005
    Messages:
    48
    I think i owe you a Beer!

    Thanks!
     
  19. CivLucas

    CivLucas Governor-General

    Joined:
    Jun 14, 2009
    Messages:
    92
    Location:
    Nijmegen, the Netherlands
    Hi, thanks for the guide, but there are 2 things I'm not really sure of:
    What to do with the atlas.dds 's?
    If I'm not making art for my special unit can I just copy it, or is even that unnecessary?
     
  20. Teg_Navanis

    Teg_Navanis King

    Joined:
    Jan 21, 2006
    Messages:
    737
    It doesn't really matter where you put the art files, as long as the paths in the XML files are correct.
     

Share This Page