How do modules work?

Niveras

Prince
Joined
Dec 28, 2006
Messages
362
While trying out the Scion civ, I noticed that it included the files for a small module that moves the Over and Undercouncils to Way of the Wicked and the Wise respectively. However, there are no instructions in the readme about how to enable it, nor do I really know where to look about how to enable modules themselves. I'm not even really sure what the difference is between a mod (such as FFH) versus a module, except that mods use the standard Civ filenames, and the files of this module is prefixed with a unique identifier (that being, presumably, the name of the module).

I assume these files are to go into /FFH/Module/<somedirectory>? Is there a specific convention that I need to follow?
 
However, there are no instructions in the readme about how to enable it

Whoops.

That's my fault - I'll try to answer your questions.

There's a specific folder the module's folder needs to be put in: One called "Modules" that you create in the "Assets" folder of FFH2/FFH.
If FFH is installed in the default location Assets will be in:
where ever civ4 is/Civilization 4/Beyond the Sword/Mods/Fall from Heaven 2 032/

So you'll finally end up with (starting with Assets): Assets/Modules/ajoin

You'll also need to open the "Fall from Heaven 2 032.ini" file and change the first entry "ModularLoading = 0" to "ModularLoading = 1"

Modular mods contain parts of XML files used by the game - just the parts that the mod changes. So ajoin has the file containing information about Civics. But the module's file has entries for just the two Councils, and the only different information in each is what tech. enables each. There's also a scheme file in there, which (AIUI) tells the program how to read the XML file.

When the game loads it'll load up all the modules and have them over-write the information from the non-modular files. So, so long as no module tries to change the same thing, modules get along very well together. They also don't have to be remade every time the game/mod/modmod is patched. I was pleasantly surprised that the "Holy Warriors" mod made for 031 seems to still work, for example. (Been play testing the Scions when I play, so it's been awhile since I've had a religion. :))

Hope that helps!
 
Modules have to be placed in the Module folder, from there they can be nested deeper as you wish. They need to be renamed with the prefix as you saw, and you also have to include the Schema File for each of the files you include in the same folder.

Some things don't quite work in Modules, but for the things which DO work, you are saved from a lot of the mess of trying to update your module, or make it compatible with other Mod-mods. So if your alterations DO work modularly, then it is quite nice to set them up that way.

EDIT: Ninja posted again. I'm getting slow :)
 
Sorry to hijack the thread, but I'm glad someone asked about this.

I have a few questions:

1. Can you make changes to the python files with modules? Or are they XML only?

2. Could you explain more about the needed prefixes? Is that just the "modules" folder, which makes an assets\modules pathway?

3. Do modules load in alphabetical order by main folder name? So for example, everything in the assets\modules\apple folder would load before the stuff in the assets\modules\bananas folder?

4. Do I understand correctly that modules can "add" or "overwrite" information but not simply deactivate certain entries in root mod? Or could you deactivate a certain XML section by putting it in a module as commented-out text?

I have been trying to figure out if modular format would work for my DA modmod. I would need it to be able to accept python changes and "deactivations" to work, though.

Thanks!
 
1. They are XML only.

2. The prefixes means that if you want to add a new unit in a non-modular method, you add it to Assets/XML/Units/CIV4UnitInfos.xml. If you want to add it in a modular method you add it to Assets/Modules/(Whatever)/*_CIV4UnitInfos.xml. Prefix in this case means whatever you place in there as "*_". The primary reason for this from what I understand is to keep the files from different modules from having the same file names, and thus cut back on the possibility of files overwriting each other. Though the folder structure will typically be used to ensure this.

3. AFAIK the modules do load in Alphabetical order. I know we tested it once, I can't remember what the result was. Pretty sure it was Alpha though. And yes, the order is VERY important :)

4. You can only add or modify, though in the process of modification you can essentially remove something from the game (graphical only, no stats, unbuildable/selectable, yadda yadda). But you cannot directly pluck something completely out of the game without using nifty tricks like that.





Now, all of that is about Modular Loading as designed by Impaler_WRG, who was then hired by Firaxis to implement it in that manner. The boys over at WoC had worked with him, and continued the work beyond when he left the group and expanded on it CONSIDERABLY. In their version you are able to make a single line of a single entry be an entire module, and I am reasonably certain that you can control Python Modularly as well (you don't actually modify the python modularly if I am remembering right, but rather you change which Python file you are using for the game, and can redefine that midway through any game. I am probably remembering wrong though, because it sounds way awesome).

When I get back to town in about 2 weeks I am planning to continue my work that I started a couple months ago of making WoC modular loading work for FfH. I put the project off because they were working with the 3.17 source code directly and I couldn't access that information since I don't have an NDA agreement with Firaxis (though I would LOVE to get one... just can't figure out HOW).

So ideally they will have the new WoC out this weekend, and I will get some time to review it while I am on vacation, then I can hopefully merge it over in short order when I get back, and write up a nice tutorial on how to use the new method (and hopefully convince Kael to use the imported code for the main mod)
 
xienwolf said:
When I get back to town in about 2 weeks I am planning to continue my work that I started a couple months ago of making WoC modular loading work for FfH.

My cluttered, bloated mods directory would absolutely love you for this. It sounds like it makes playing around with different mods so much less of a headache.

You sure you really need to be gone for 2 weeks? :P
 
Back
Top Bottom