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

XML Load 1.2 2016-10-05

XML Load 1.2

  1. Chinese American
    XML Load : SDK mod component
    by Chinese American
    v 1.2

    Official thread:
    http://forums.civfanatics.com/showthread.php?t=184907

    --[[ === Synopsis

    For casual or experienced modders who just want to add new units and buildings without copying the huge original files. Use this mod as a launcher to hold your compilation of favorite mod components, or incorporate the SDK code component into your mods.

    Will replace old and load new units, buildings, improvements, builds, techs, traits, leaderheads, civilizations.

    --[[ === Details

    This mod component lets you use partial xml files instead of huge original files. It'll read in extra files without mandatory original Firaxis files inside the mod's folder. A partial file contains only the entries of the things not found in the vanilla game. An example is TradeRoutes_Looter_CIV4UnitInfos.xml which I put in this mod. Be sure to include the headers and footers, like this segment example:
    <Civ4UnitInfos xmlns="x-schema:CIV4UnitSchema.xml">
    <UnitInfos>
    .
    .
    .
    </UnitInfos>
    </Civ4UnitInfos>

    What it does is read in files that match *_CIV4UnitInfos.xml and add those entries into the game. So in this folder, Mods\XMLLoad\Assets\XML\Units\, could contain XMLLoad_CIV4UnitInfos.xml and nothing else. You don't need the original files. Whereas before, you would have to add your new units into the huge CIV4UnitInfos.xml and put that inside your mod folder.

    If you don't want to use the vanilla units, then you would make your own CIV4UnitInfos.xml and put that into your mod folder. This works just like before.

    If you want to borrow another mod's units, copy or make the partial file into the units folder and rename it if necessary, such as HisMod_CIV4UnitInfos.xml. So your units folder may have two files, MyMod_CIV4UnitInfos.xml and HisMod_CIV4UnitInfos.xml, and both will be added to the game. Or you could just use his file and not even make your own.

    Be aware that duplicate entries will replace older entries already in the game. If a new version of Workers are found, then this one will be used in the game. This is useful to replace Workers so that they can build new improvements.

    Unfortunately, new and replacement buildings may cause a serious bug where some buildings will get a huge amount of happiness. The best remedy is to put replacements in *_CIV4BuildingInfos.xml files and new buildings in *_Infos.xml or *_BuildingInfos.xml files.

    --[[ === Files that can be read

    This section lists the patterns of file names that can be understood by this mod (so far). The asterisk * represents any set of legal characters that you can normally put in file names. Everything else after the asterisk must be exact. The path to the file is also important. Put only correct entries into the appropriate file. Thus, art defines for units go in xml\art\*_CIV4ArtDefines_Unit.xml or xml\units\*_Arts.xml.

    The List:

    Spoiler :
    UNITS:
    << ARTS >>
    xml\art\*_CIV4ArtDefines_Unit.xml
    xml\units\*_UnitArts.xml (do not include schema)
    xml\units\*_Arts.xml (do not include schema)
    << UNIT CLASSES >>
    xml\units\*_CIV4UnitClassInfos.xml
    xml\units\*_UnitClasses.xml
    xml\units\*_Classes.xml
    << UNITS >>
    xml\units\*_CIV4UnitInfos.xml
    xml\units\*_UnitInfos.xml
    xml\units\*_Infos.xml
    xml\units\*_Units.xml

    BUILDINGS:
    << ARTS >>
    xml\art\*_CIV4ArtDefines_Building.xml
    xml\buildings\*_BuildingArts.xml (do not include schema)
    xml\buildings\*_Arts.xml (do not include schema)
    << BUILDING CLASSES >>
    xml\buildings\*_CIV4BuildingClassInfos.xml
    xml\buildings\*_BuildingClasses.xml
    xml\buildings\*_Classes.xml
    << BUILDINGS >>
    xml\buildings\*_CIV4BuildingInfos.xml (replacements should go here; don't put new buildings here)
    xml\buildings\*_BuildingInfos.xml
    xml\buildings\*_Infos.xml
    xml\buildings\*_Buildings.xml

    TECHNOLOGIES:
    xml\technologies\*_CIV4TechInfos.xml
    xml\technologies\*_TechInfos.xml
    xml\technologies\*_Infos.xml
    xml\technologies\*_Techs.xml

    IMPROVEMENTS:
    << ARTS >>
    xml\art\*_CIV4ArtDefines_Improvement.xml
    xml\terrain\*_ImprovementArts.xml (do not include schema)
    << IMPROVEMENTS >>
    xml\terrain\*_CIV4ImprovementInfos.xml
    xml\terrain\*_ImprovementInfos.xml
    xml\terrain\*_Improvements.xml

    BUILDS:
    xml\units\*_CIV4BuildInfos.xml
    xml\units\*_BuildInfos.xml
    xml\units\*_Builds.xml

    TRAITS:
    xml\civilizations\*_CIV4TraitInfos.xml
    xml\civilizations\*_TraitInfos.xml
    xml\civilizations\*_Traits.xml

    LEADERHEADS:
    << ARTS >>
    xml\art\*_CIV4ArtDefines_Leaderhead.xml
    xml\civilizations\*_LeaderheadArts.xml (do not include schema)
    << LEADERS >>
    xml\civilizations\*_CIV4LeaderheadInfos.xml
    xml\civilizations\*_LeaderheadInfos.xml
    xml\civilizations\*_Leaderheads.xml

    CIVILIZATIONS:
    << ARTS >>
    xml\art\*_CIV4ArtDefines_Civilization.xml
    xml\civilizations\*_CivilizationArts.xml (do not include schema)
    << CIVS >>
    xml\civilizations\*_CIV4CivilizationInfos.xml
    xml\civilizations\*_CivilizationInfos.xml
    xml\civilizations\*_Civilizations.xml


    --[[ === SDK files for modders

    The changes I made are found in the files under SDK folder and are marked by // CA edit.
    For example:
    Code:
    // CA edit -- added function AddGlobalArtDefineInfo
    	template <class T>
    	DllExport void AddGlobalArtDefineInfo(T **ppArtDefneInfos, char* szXMLFileName, char* szTagName, int& iNumVals);
    // CA edit end
    --[[ === Example files and credits

    I will try to include several example files that demonstrate different naming conventions in the appropriate folders. Credit will be given to their original creators. My main sources will be my own mods and mod components from Civilization Fanatics Center http://www.civfanatics.com/

    XML Load by Chinese American (myself, this mod)
    http://forums.civfanatics.com/showthread.php?t=184907

    Trade Routes by Chinese American (myself)
    http://forums.civfanatics.com/showthread.php?t=163657



    --[[ === Version History

    Spoiler :
    1.0
    Reads partial xml files for *_CIV4ArtDefines_Unit.xml, *_CIV4UnitClassInfos.xml, *_CIV4UnitInfos.xml.

    1.1
    Will replace old types with new ones.
    Reads partial xml files for *_CIV4ArtDefines_Building.xml, *_CIV4BuildingClassInfos.xml, *_CIV4BuildingInfos.xml.

    1.2
    Workaround for bug where buildings get obscene happiness from new buildings.
    Added reading techs, improvements, builds, traits, leaderheads, civilizations.
    Reads partial xml files for *_Arts.xml, *_Classes.xml, and *_Infos.xml in xml\units\ and xml\buildings\.
    Reads partial xml files for *_UnitArts.xml, *_UnitClasses.xml, *_UnitInfos.xml, and
    *_Units.xml in xml\units\.
    Reads partial xml files for *_BuildingArts.xml, *_BuildingClasses.xml, *_BuildingInfos.xml, and *_Buildings.xml in xml\buildings\.
    Reads partial xml files for *_CIV4TechInfos.xml, *_TechInfos.xml, *_Techs.xml, and *_Infos.xml in xml\technologies.
    Reads partial xm files for *_CIV4ImprovementInfos.xml, *_ImprovementInfos.xml and *_Improvements.xml in xml\terrain, and xml\art\*_CIV4ArtDefines_Improvement.xml and xml\terrain\*_ImprovementArts.xml.
    Reads partial xml files for *_CIV4BuildInfos.xml, *_BuildInfos.xml and *_Builds.xml in xml\units.
    Reads partial xml files for *_CIV4CivilizationInfos.xml, *_CivilizationInfos.xml and *_Civilizations.xml in xml\civilizations\, and xml\art\*_CIV4ArtDefines_Civilization.xml and xml\civilizations\*_CivilizationArts.xml.
    Reads partial xml files for *_CIV4LeaderheadInfos.xml, *_LeaderheadInfos.xml and *_Leaderheads.xml in xml\civilizations\, and xml\art\*_CIV4ArtDefines_Leaderhead.xml and xml\civilizations\*_LeaderheadArts.xml.