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

Actually, all three options are problematic.

You have pointed out the disadvantage of the regular art folders (i.e. the way I did the Switzerland Mod) before.

The disadvantage of having the art files in the Modules folder is that you can no longer freely change the folder structure for the different modules, since you would have to correct all references to the art files after moving them around.

With PakBuild, you add an additional barrier to accessing the files, which is bad for people who either want to quickly tweak a mod, copy parts of it or simply explore it on their own to learn how it was made.

Does packing only the art files work? If yes, that would be a good compromise IMHO. The fact that you cannot 'just delete one file' is no big issue if you pack all files of your module into a single subfolder.

A quick note to your comment about packing all schemata into a separate FPK: as Impaler pointed out, different modules could use different schemata. Hence, redundancy is actually a good thing.
 
That's a good point about packing all the Schema files into one FPK. It's probably unnecessary if redundancy is not a problem.

I guess the fundamental question is how are these module components intended to be used?

My CIV4 modding needs are simple. I like to work with Earth-based maps and use historical civilizations. I need civilizations placed on my maps that aren't always available in the game or the expansion packs. Making modules for each civilization helps to divide up my work into manageable pieces. As I've been discussing this with you, I've been thinking in these simple terms. Other modders have much more complicated issues.

The XML and art for civilizations, including unique units and buildings, can be packaged together into module FPKs. But, as you pointed out, I can see why that might be a bad idea. I suppose that the units, buildings, and leaderhead could each be packaged into individual module FPKs. But there is a need to be able to read the XML files in order to incorporate those elements into mods. Having all of the XML files in one directory is a really good idea.

I'm not so sure that I have the best solutions. Nevertheless, things have just gotten easier for me.

Thank you for creating this thread! I've learned a great deal from this experience.
 
Good Thread! :goodjob:
I just want to make sure I understood everything correctly...
To add a new civ+leader+UU+UB modding Bts with a module:

1. Copy the xml files into the Mod\[NameOfTheMod]\Assets\Modules\ folder

2. Rename them in this way
NameOfTheMod_CIV4ArtDefines_Civilization.xml *
NameOfTheMod_CIV4ArtDefines_Leaderhead.xml *
NameOfTheMod_CIV4LeaderHeadInfos.xml *
NameOfTheMod_CIV4CivilizationInfos.xml *
NameOfTheMod_CIV4UnitInfos.xml *
NameOfTheMod_CIV4GameText.xml[/B] **
NameOfTheMod_CIV4UnitSchema.xml ***
NameOfTheMod_CIV4CivilizationsSchema.xml ***
NameOfTheMod_CIV4ArtDefinesSchema.xml ***

3. Add in the folder the art files.

4. Edit the files (*) deleting everything except one block of text (to use as a base) and edit it for your new civ/leader/building/unit you are creating (making sure to specify correctly the path of the art files).

5. Edit the file (**) deleting everything and adding the Game Text you need to add (mostly coping from your Warlord version file, if there is one).

6. Edit the file (***) deleting everything and leaving it blank except the first lines???

Am I missing something?
Thanks.
 
Your step 6. is wrong. You need to leave those *** files intact, but change the first line of the * files, so that they correctly refer to the *** files.
 
Does this work for Interface art definitions? I'm including Sevopedia into BUG and trying to make the arrow DDS files modular.

I have enabled modular loading (the GameTexts are loading fine). Here's my file structure:

Code:
CustomAssets
    Modules
        Sevopedia
            Sevopedia_CIV4ArtDefines_Interface.xml
            Sevopedia_CIV4ArtDefinesSchema.xml
            Sevopedia_CIV4GameText.xml
            line-arrow.dds
            line-bltr.dds
            line-strait.dds
            line-tlbr.dds

Sevopedia_CIV4ArtDefinesSchema.xml is an exact file-copy of the one from BtS\Assets\XML\Art. Here is Sevopedia_CIV4ArtDefines_Interface.xml

Code:
<?xml version="1.0"?>
<!-- BUG Mod - Copyright 2007 -->
<!-- -->
<!-- Interface art path information for Progor's unit upgrade/promo charts in Sevopedia 2.3 -->
<Civ4ArtDefines xmlns="x-schema:Sevopedia_CIV4ArtDefinesSchema.xml">
	<InterfaceArtInfos>
		<InterfaceArtInfo>
			<Type>LINE_TLBR</Type>
			<Path>Modules/Sevopedia/line-tlbr.dds</Path>
		</InterfaceArtInfo>
		<InterfaceArtInfo>
			<Type>LINE_BLTR</Type>
			<Path>Modules/Sevopedia/line-bltr.dds</Path>
		</InterfaceArtInfo>
		<InterfaceArtInfo>
			<Type>LINE_STRAIT</Type>
			<Path>Modules/Sevopedia/line-strait.dds</Path>
		</InterfaceArtInfo>
		<InterfaceArtInfo>
			<Type>LINE_ARROW</Type>
			<Path>Modules/Sevopedia/line-arrow.dds</Path>
		</InterfaceArtInfo>
	</InterfaceArtInfos>
</Civ4ArtDefines>

When the Sevopedia is opened to the unit / promo upgrade graphs, it cannot find the art definitions.

Code:
LINE_ARROW = ArtFileMgr.getInterfaceArtInfo("LINE_ARROW").getPath()

The ArtInfo returned is None, causing getPath() to fail.

Am I missing some step here? Any help would be greatly appreciated.
 
I found the answer (which I don't like), so for anyone else having trouble, here ya go.

Once I put it into a real mod folder (rather than under My Games\BtS\CustomAssets), it worked. Does this mean that modular XML loading won't work for non-mods? :(
 
I've also had problems with the CustomAssets folder, but officially (according to the Modder's Guide linked on the first post) it should work. Perhaps this qualifies as a bug.
 
I always get this thing:
"Failed to load:
assets/modules/custom leaderheads/lenin/_______.xml"
Is it my file structure?
 
Is this the only error message you get? Usually there's another one just before that, saying where exactly the XML file is corrupt (because of a typo for example).
 
Is this the only error message you get? Usually there's another one just before that, saying where exactly the XML file is corrupt (because of a typo for example).

Nah, I never get XML errors, it just says plain:
"Failed to load:
assets/modules/custom leaderheads/lenin/______.xml"
I'm not new to XML, so it's not that. :(
 
Does it say ______.xml or is there an actual name? Have you tried removing the modular files one by one to pinpoint the problem? I need more information to make a better guess as to what could be wrong.
 
Does it say ______.xml or is there an actual name? Have you tried removing the modular files one by one to pinpoint the problem? I need more information to make a better guess as to what could be wrong.

It doesn't say ____.xml I should've said *.xml . PM me...:lol:
 
Do you mean that the game didn't load at all or that your changes didn't have any effect? If it's the latter, you might have forgotten to enable modular xml loading, which you can now do in the mod's config file.
 
I have modular enabled. BUt It didn't load all of my changes. I added the plug-n-play California civ which loaded but my modified US stuff did not. Nor did ersaz Grey Germany with Hitler added or the Byzantium with Theodora.

I'll try again. But I was just wondering if there is a special way to write over civs already in the standard file.
 
ok I got it working. But I do have an issue with gametext.xml. I copied the entry for the tag American EMpire. I wanted it to read United Stsates, but the game still reads the old gametext. Same thing with civics. IS tyhere a reason for this ( i know i dont have other entries restoring the old lines). Or should I just make new game text and the lines just to get past it?

thx
 
The gametext files behave differently than other XML files. I do not know if it is possible to overwrite the vanilla files through modular modding, but to be on the save side, just create a new tag (for example "TXT_KEY_AMERICAN_EMPIRE") and use this for your modified civ.
 
I've gotten a modular to work now! Instead of opening the XML that failed to load with my usual XML editor, I decided to open them with notepad instead, because in notepad it shows all the other info, like the schema the XML document uses, and the author, etc. In my XML Editor it didn't, so now I know! Thanks Teg Navanis. :)
 
Are there any known issues for modular xml with BtS 3.13?
I did change the cottages (more commerce), and this loads successfully as I can see by the yield display. In addition, I changed the time to upgrade, and this is not only not reflected, the upgrade time is not shown at all. I tested it, and they really don't upgrade to hamlets.

What did I miss?
Any hint would be appreciated.

Edit: here is a reference to where I initially posted the files:
The file and the description may be found here

Edit2: It is only one file. The CB_MOD_CIV4TerrainSchema.xml is present in the same folder and it is unaltered from the original (except the name, of course).
 
Top Bottom