Teg_Navanis
King
- Joined
- Jan 21, 2006
- Messages
- 737
Since people seem to want a concise tutorial that helps them to add civs, units or buildings to BTS, I'll try to write one. I'm taking most of my infos from another tutorial, the Modders Guide to Beyond the Sword by Kael, Impaler[WrG] and Solver.
Purplexus will publish a more detailed guide soon. Check his Plug and Play Project for more.
This guide is purely concerned with how to make a mod work with BTS. To see how to make the art or what the XML entries mean, check the existing Vanilla or Warlords tutorials.
Modular Modding
Until now, the most common way to add a unit, civ or building (I'll just say custom content from now on) to the game was to take the original files, copy them to a mod folder and add your custom content there.
With BTS, there is a new, cleaner and easier way to add your custom content. It's called Modular XML Loading. You find a more detailed instruction in the guide mentioned above, I'll just give a step-by-step guide how to use it.
Step 1: Enabling Modular XML Loading
Modular mods only work if the setting "ModularLoading" in your mod config file is set to 1. The config file is created automatically in your mod folder when you start your mod.
Step 2: File structure
This is a classical file structure for a Vanilla or Warlords Mod:
Assets\XML\Art\CIV4ArtDefines_Civilization.xml
Assets\XML\Art\CIV4ArtDefines_Leaderhead.xml
Assets\XML\Civilizations\CIV4LeaderHeadInfos.xml
Assets\XML\Civilizations\CIV4CivilizationInfos.xml
Assets\XML\Units\CIV4UnitInfos.xml
Assets\XML\Text\CIV4GameText_AnyName.xml
This is the same structure for a modular BTS Mod:
Assets\Modules\Switzerland_CIV4ArtDefines_Civilization.xml
Assets\Modules\Switzerland_CIV4ArtDefines_Leaderhead.xml
Assets\Modules\Switzerland_CIV4LeaderHeadInfos.xml
Assets\Modules\Switzerland_CIV4CivilizationInfos.xml
Assets\Modules\Switzerland_CIV4UnitInfos.xml
Assets\Modules\Switzerland_CIV4GameText.xml
+
Assets\Modules\Switzerland_CIV4UnitSchema.xml
Assets\Modules\Switzerland_CIV4CivilizationsSchema.xml
Assets\Modules\Switzerland_CIV4ArtDefinesSchema.xml
There are four important changes:
1. Everything is in a folder called Modules, not XML. You can make subfolders, but they are no longer needed for the game, so I would advise to maybe use one folder per civ instead of splitting up the ArtDefines and CivilizationInfos that belong together.
2. Every modular file needs a "*_" at its beginning. In my example case, I used "Switzerland_". You could replace "Switzerland" by anything you want, but I suggest you use something that is a good description of your module.
3. Every modular file needs to have its schema in the same folder. If you want to know what schema a file needs, look up its first line (except for the comments). It will look something like this:
The file I looked up (CIV4ArtDefines_Unit) uses the CIV4ArtDefinesSchema, hence this schema needs to be in the same folder as the file itself. It is recommended to rename all schemas to Switzerland_* to prevent file conflicts when different modules are merged. To make sure that all files find the renamed schema, change
to
(or whatever your new name is).
4. Notice that most GameText files will be called something like CIV4GameText_AnyName in non-BTS mods. However, you can't call your modular GameText file Switzerland_CIV4GameText_AnyName.xml. Just remove everything after CIV4GameText and you will be fine.
Modular Art
You can freely change the path of your art files as well, as long as you change all the references to them in the corresponding XML files. If you want to make a module that can easily be deleted (including all art files), it is recommended to put them all into a single folder. Here is a slightly modified version of the Switzerland Civ for BTS as an example.
Before:
After:
The disadvantage is that you cannot change the folder structure without adjusting all the references to the art files.
Step 3: File content
A modular file will look like this:
Notice that you no longer have to include all the original civilizations, but just the one you wish to add. This is the beauty behind modular modding. Take either an original file and delete all entries but one, or use another modular mod (like the BTS Switzerland Mod) as your basis. After changing the file structure according to Step 2, you can then edit this single entry to create your own content (unit, civ, building, leaderhead etc.).
Please tell me if you still have problems using modular modding, I'll be glad to expand this tutorial if you do.
Purplexus will publish a more detailed guide soon. Check his Plug and Play Project for more.
This guide is purely concerned with how to make a mod work with BTS. To see how to make the art or what the XML entries mean, check the existing Vanilla or Warlords tutorials.
Modular Modding
Until now, the most common way to add a unit, civ or building (I'll just say custom content from now on) to the game was to take the original files, copy them to a mod folder and add your custom content there.
With BTS, there is a new, cleaner and easier way to add your custom content. It's called Modular XML Loading. You find a more detailed instruction in the guide mentioned above, I'll just give a step-by-step guide how to use it.
Step 1: Enabling Modular XML Loading
Modular mods only work if the setting "ModularLoading" in your mod config file is set to 1. The config file is created automatically in your mod folder when you start your mod.
Step 2: File structure
This is a classical file structure for a Vanilla or Warlords Mod:
Assets\XML\Art\CIV4ArtDefines_Civilization.xml
Assets\XML\Art\CIV4ArtDefines_Leaderhead.xml
Assets\XML\Civilizations\CIV4LeaderHeadInfos.xml
Assets\XML\Civilizations\CIV4CivilizationInfos.xml
Assets\XML\Units\CIV4UnitInfos.xml
Assets\XML\Text\CIV4GameText_AnyName.xml
This is the same structure for a modular BTS Mod:
Assets\Modules\Switzerland_CIV4ArtDefines_Civilization.xml
Assets\Modules\Switzerland_CIV4ArtDefines_Leaderhead.xml
Assets\Modules\Switzerland_CIV4LeaderHeadInfos.xml
Assets\Modules\Switzerland_CIV4CivilizationInfos.xml
Assets\Modules\Switzerland_CIV4UnitInfos.xml
Assets\Modules\Switzerland_CIV4GameText.xml
+
Assets\Modules\Switzerland_CIV4UnitSchema.xml
Assets\Modules\Switzerland_CIV4CivilizationsSchema.xml
Assets\Modules\Switzerland_CIV4ArtDefinesSchema.xml
There are four important changes:
1. Everything is in a folder called Modules, not XML. You can make subfolders, but they are no longer needed for the game, so I would advise to maybe use one folder per civ instead of splitting up the ArtDefines and CivilizationInfos that belong together.
2. Every modular file needs a "*_" at its beginning. In my example case, I used "Switzerland_". You could replace "Switzerland" by anything you want, but I suggest you use something that is a good description of your module.
3. Every modular file needs to have its schema in the same folder. If you want to know what schema a file needs, look up its first line (except for the comments). It will look something like this:
Code:
<Civ4ArtDefines xmlns="x-schema:CIV4ArtDefinesSchema.xml">
The file I looked up (CIV4ArtDefines_Unit) uses the CIV4ArtDefinesSchema, hence this schema needs to be in the same folder as the file itself. It is recommended to rename all schemas to Switzerland_* to prevent file conflicts when different modules are merged. To make sure that all files find the renamed schema, change
Code:
<Civ4ArtDefines xmlns="x-schema:CIV4ArtDefinesSchema.xml">
to
Code:
<Civ4ArtDefines xmlns="x-schema:Switzerland_CIV4ArtDefinesSchema.xml">
(or whatever your new name is).
4. Notice that most GameText files will be called something like CIV4GameText_AnyName in non-BTS mods. However, you can't call your modular GameText file Switzerland_CIV4GameText_AnyName.xml. Just remove everything after CIV4GameText and you will be fine.
Modular Art
You can freely change the path of your art files as well, as long as you change all the references to them in the corresponding XML files. If you want to make a module that can easily be deleted (including all art files), it is recommended to put them all into a single folder. Here is a slightly modified version of the Switzerland Civ for BTS as an example.
Before:
Code:
<Button>,Art/Interface/Buttons/Units/Hellebardier.dds</Button>
After:
Code:
<Button>,Modules/Switzerland/Hellebardier.dds</Button>
The disadvantage is that you cannot change the folder structure without adjusting all the references to the art files.
Step 3: File content
A modular file will look like this:
Code:
<?xml version="1.0"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Firaxis Games (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- -->
<!-- Civilization art path information -->
<Civ4ArtDefines xmlns="x-schema:CIV4ArtDefinesSchema.xml">
<CivilizationArtInfos>
<CivilizationArtInfo>
<Type>ART_DEF_CIVILIZATION_SWITZERLAND</Type>
<Button>,Art/Interface/Buttons/Civilizations/Switzerland.dds,Art/Interface/Buttons/Civics_Civilizations_Religions_Atlas.dds,5,7</Button>
<Path>Art/Interface/TeamColor/swiss.dds</Path>
<bWhiteFlag>1</bWhiteFlag>
</CivilizationArtInfo>
</CivilizationArtInfos>
</Civ4ArtDefines>
Notice that you no longer have to include all the original civilizations, but just the one you wish to add. This is the beauty behind modular modding. Take either an original file and delete all entries but one, or use another modular mod (like the BTS Switzerland Mod) as your basis. After changing the file structure according to Step 2, you can then edit this single entry to create your own content (unit, civ, building, leaderhead etc.).
Please tell me if you still have problems using modular modding, I'll be glad to expand this tutorial if you do.