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:
--[[ === SDK files for modders
The changes I made are found in the files under SDK folder and are marked by // CA edit.
For example:
--[[ === 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
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 :
--[[ === 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 :