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

I tried using this tutorial to add a new Waffen SS unit to one of the Road to War scenarios.

I changed the ini file to allow modular changes. Then I followed the steps to add the unit. Nothing happens when I run the mod. No new unit at all. Everything else runs fine, BtS just ignores me. Any ideas?

Thanks,

JB
 
Hum, you'd have to try and isolate your problem.

Perhaps you can test whether your files are loaded by inserting an error on purpose, so you get an error message when the game starts. (an additional ">" somewhere in the file should do the trick). If there is no error message, your files don't load (perhaps they are in the wrong place, have a wrong name, or you enabled modular loading in the wrong place). If you do get an error message, there is probably another problem. I could imagine that you overwrote another unit instead of adding a new one (if you used the same <Type> tag for both), or that you added it successfully but just didn't see it, for example because you don't meet the requirements to build it.
 
Thanks, I tried your suggestion. First I put in an extra > then I put gibberish in for some of the values. Nothing happened.

I can tell from the startup screen that the mod is loading, and I have changes the public map to refer to my modpath.

I have changed the ini file to read:

; Modular XML Loading
ModularLoading = 1

I have actually done this in two places, in My Documents->My Games->Beyond the Sword and in the ini in my mod folder.

The files in the Modules folder are:

nazi_CIV4UnitClassInfos.xml
nazi_CIV4UnitSchema.xml
nazi_CIV4UnitInfos.xml

All I'm trying to do so far is add a Waffen SS unit. Any suggestions would be appreciated. Thanks.

JB
 
I also found an ini file with the name of the mod on it in the mod folder. I changed that one too. Still no go. How many of these files need to be changed to use modules?

JB
 
Hm, the only thing I can think of is disabling XML caching (
DisableCaching = 1) and enabling the logging system (
LoggingEnabled = 1). Then you should be able to check your xml.log to get more information about what is loaded and what isn't.
 
Thanks, Teg.

I tried it as you suggest. The only place those lines appear is in the CIV4.ini file in My Documents->My Games->Beyond the Sword. When I loaded the mod nothing different happened. Is this the only file that is supposed to be changed?

Another question: Do the filenames that I mentioned above look right? I have the files in Mods->JB The Road to War->Assets->Modules. Maybe it is loading but the files are in the wrong place.

Also, I can see the log files in My Docs->My Games->BTS. How do I read it? Is what I'm looking for in the xml log?

Thanks for your help with this. I'm watching everybody else around here modding like mad, but I can't seem to get off the starting line!

JB
 
Yep, you can now check your xml.log and search for your files (I guess 'nazi' would be a good search term). Perhaps you get an error message there. (you can just open it with notepad).
 
What about Diplomacy Infos? I think I remember reading about a problem with this file with modular loading, but I'm not sure. Any ideas?

Thanks for the tutorial, by the way.
 
Audio files aren't supported by modular XML loading. I think that's what you're trying to ask lol.
 
Perhaps adding CIV4DiplomacyInfos.xml will fix your problem (at least the second one). The file seems not to be fully modular though. While it is supported in theory, you can only replace an entire <Type> with the current system, which isn't that useful for CIV4DiplomacyInfos IMHO.

TAFirehawk is developing a better, more modular modding platform for Civ4, you can check it out here. Perhaps people should start adopting his standard. But I'm not too active anymore, so I don't know what exactly he did...
 
Hello, I'm trying to make my first mod, and I'm having a little bit of trouble. Using Teg's Switzerland mod as a comparison, I put it all together, and put it into my My Games/Beyond The Sword/MODS folder, and tried loading it from the Advanced menu. Everything seemed to load well, but when I tried to play the civ, Nothng in the mod showed up - no civ, leaders, etc, not even in the civilopedia.

So I unloaded the mod, checked the .ini file, and set modular loading to "1"

I immediately got an error, and Civ crashed on me. I'm not sure what I'm doing wrong, and would appreciate it if someone could take a look for me. Here are links to my Civ & an image of the error message.

Thanks in advance!

My Wampanoag Civ

Error Message

~S~
 
The error message is pretty useful. It tells you in which file to look (civ4leaderheadinfos.xml), at what line the error is (19) and exactly what the problem is (the parser is expecting iEspionageWeight, but the tag is iRefusetoTalkWarThreshold).

I suspect that you originally made your mod for vanilla civ or warlords. There are some additional tags that you have to include before it works with BTS.

I actually made a little script that can do that for you: script. If you can't run it (you're not running Linux I suppose :p), you can still have a look at it to see where the differences are. The last ten lines are relevant for civ4leaderheadinfos.xml. A short example:

Code:
	if line.find("<iWarmongerRespect>") != -1:
		line = ConvertUnits().InsertData(line,"<iEspionageWeight>0</iEspionageWeight>")

This bit of code simply tells the program (or you in this case) that a tag iEspionageWeight should be added after iWarmongerRespect. This will get pretty boring after a while (especially for units), so I recommend using a BTS unit/building/whatever as starting point for new mods, not vanilla/warlord ones.
 
The error message is pretty useful. It tells you in which file to look (civ4leaderheadinfos.xml), at what line the error is (19) and exactly what the problem is (the parser is expecting iEspionageWeight, but the tag is iRefusetoTalkWarThreshold).

I suspect that you originally made your mod for vanilla civ or warlords. There are some additional tags that you have to include before it works with BTS.

I actually made a little script that can do that for you: script. If you can't run it (you're not running Linux I suppose :p), you can still have a look at it to see where the differences are. The last ten lines are relevant for civ4leaderheadinfos.xml. A short example:

Code:
	if line.find("<iWarmongerRespect>") != -1:
		line = ConvertUnits().InsertData(line,"<iEspionageWeight>0</iEspionageWeight>")

This bit of code simply tells the program (or you in this case) that a tag iEspionageWeight should be added after iWarmongerRespect. This will get pretty boring after a while (especially for units), so I recommend using a BTS unit/building/whatever as starting point for new mods, not vanilla/warlord ones.

I actually used your Switzerland mod as a base for this one. I also tried using a variant of a Dido plug & play that was posted (Though I admittedly can't remember whose, at the moment), and even though the original loaded fine, mine came up with a general windows error (Civ4 has experienced a problem and must close, etc.) while loading the XML.

Looking at the files, I can't find any real discrepancy. I've also already emptied the cache.

Just a little lost....

~S~
 
Your Civ4UnitInfos seems to be alright, but your Civ4LeaderHeadInfos doesn't use the BTS schema as it should. I haven't looked at your other files, but it looks to me as if you used another file as a template for your leaderhead.
 
OK - so I revamped it using Schema & infos files from "Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Assets\XML". Now, the game loads all the XML, but it's still not showing up in the Civopedia, or in selectable civs. And I have already activated modular loading.

Sorry to keep bothering you - and thanks again for all the help.

~S~
 
Top Bottom