Modular Fall from Heaven

Updated the Deep Fix for Dimensional Promotions to work with Patch K, link in the same place as before, same instructions need following :) No worries if you don't care about the Dimensional Summons I added though.

EDIT: Also made another Ninja-Update to the mod. Removed the Water Elemental and re-organized how I was adding the Dimensional Promotions now that I know what is causing them not to work. This is probably the last release till next weekend.
 
BTW, is anyone interested in a Module to customize your game options? Things like Living World, Raging Barbarians, Aggressive AI....

You can change what the default settings are and which ones are visible really easily, but if you do it the normal way you have to adjust it with each patch. Set up a module and you can set it once and never have to do so again.


Instructions as follow:

  1. Turn on Modular Loading in the .ini if not already enabled for my mod-mod (See first post for instructions)
  2. Open the Assets Folder
  3. Create a new folder called Modules
  4. Open the Modules Folder
  5. Create a new folder called Game Settings
    • Copy Assets\XML\Gameinfo\CIV4GameOptionInfos.xml & Assets\XML\Gameinfo\CIV4GameInfoSchema.xml into this folder
    • Rename these two files to Assets\XML\Gameinfo\Opt_CIV4GameOptionInfos.xml & Assets\XML\Gameinfo\Opt_CIV4GameInfoSchema.xml
  6. Open Opt_CIV4GameOptionInfos.xml with Notepad
  7. Find the line which reads: <Civ4GameOptionInfos xmlns="x-schema:CIV4GameInfoSchema.xml">
    • Edit it to read: <Civ4GameOptionInfos xmlns="x-schema:Opt_CIV4GameInfoSchema.xml">

Now you can edit this file further as you desire to customize your settings for future games as follows:

  1. <bDefault>0</bDefault> means the option will be disabled by default. Change it to <bDefault>1</bDefault> to enable the option
  2. <bVisible>1</bVisible> means that the option will show up in the Custom Game screen so that you can change on a case-by-case basis. Change it to <bVisible>0</bVisible> to hide an option.
    • If you ALWAYS play your game with an option either ON or OFF, set the default to what you desire, then hide it by setting this option to 1. Now your list of options available will be much smaller and easier to browse for those options which you like to use only in some games.
 
Set up a module and you can set it once and never have to do so again.

Have you ever known the FFH team to include a change that doesn't get mentioned in the changelog? They seem very conscientious about that, but I've been thinking about moving my modmod - mostly tweaks - into modular format and wouldn't want to unknowingly overwrite an official change.
 
It isn't that they don't announce changes or anything, it is just that the patches include more than just the files which they made changes to (it would be a pain to track EVERY file that gets updated). Also, even if they did only include the modified files, since the patches are inclusive that means any modification since initial big release, which right now DOES include the gameoptions file.

Hence, any change you make will always be overwritten by a new patch (placing default values back in) unless you make it modular.
 
Hence, any change you make will always be overwritten by a new patch (placing default values back in) unless you make it modular.

What I'm worried about is the reverse, and the mod as a whole - not just GameOptions: A modular mod's changes overwriting changes introduced by a patch.

For example, I changed the OO Temple to reduce hurry unhappiness. Since it's currently not modular I have to re-do it with each patch. Or, at least each patch that includes the buildinginfos file. (Thank goodness for the FFH Editor!)

As you point out, if my modded OO Temple were modular that wouldn't be a worry. My Temple overwrites the old version. However, if a patch every introduces a _new_ version of the Temple - a change to cost or boni or something - my modular Temple would still overwrite it.

If I want to include official changes I'll have to change the modular file myself. So long as changes are included in the changelog that's easy. Any unlisted changes would most likely get left out, though.
 
Ok, I thought at first you were arguing against Modular Loading, but it sounds now more like yor are asking about complications and format.

What you bring up about them changing something which is in a module is part of why I made so many folders. Like patch K just now and the Water Elemental: All you must do to undo my change is delete 1 folder.

So if you make modules small enough, they are really nice. But if you make one Big module, then it may as well just be a full Mod-mod really.

Thinking of that, I might start placing links for individual modules in addition to a full installer of every module at once.
 
So if you make modules small enough, they are really nice. But if you make one Big module, then it may as well just be a full Mod-mod really.

Thinking of that, I might start placing links for individual modules in addition to a full installer of every module at once.

Yeah... and thinking about it I doubt any changes missed from the changelog would be, well, really "missed." Noticed. I might do a full update of my modmod for every numbered release to make sure nothing has slipped past me, and otherwise just not worry about it.

Hmm... I wonder if the FFH editor would make it easier to generate the files: Delete the unneeded columns in the editor then Export. Or even delete all but one column for each module. Then take the resulting individual files, rename them and make the necessary minor alterations before putting them in a modular-mod folder. Might be easier/quicker than some of the cutting and pasting that'd otherwise be required.

Do you use an XML editor, xienwolf? (How about you, MagisterC?) I haven't found one I find more convenient than the FFH Editor + a simple text editor.

On installing your mod: Unless one or more of the components gets pretty large I suggest making it a simple zip file rather than an installer. I'd rather download the whole thing and then copy all or part, depending on what I want.

That's just me, though. There's certainly a disadvantage to doing it that way, and advantages to doing it other ways.
 
By using the installer I can guarantee that they at least START with everything in the right spot, and the Modules turned on. Plus this way you are forced to start with all of them and then delete what you don't want. If it was just a zip more people would just start with what they think they want and never try the rest ;) And it was also in part just to see what it was like using it kcwong's installer since it was right there and available for use.

I don't use an editor, I do all of my work directly in the XML using Notepad. Using the FfH editor should be fine, as long as you remember to redirect where it is writing to, and then change the filenames and the Schema reference (or figure out a way to make the editor ask you for those I suppose). Unless you built the Schema into the editor or made it run a batch file to copy them over and rename appropriately you would still have to do that part by hand too.

But overall, I just haven't TRIED using an editor yet :)

If you do go modular, be careful about breaking it up TOO small. You have no guarantee of the order in which things load. So for instance I used to have all 3 Dimensional Promotions in seperate modules so I could isolate the glitch, but that caused an error if the computer tried to load Dimensional 3 before Dimensional 2, because there wasn't any PROMOTION_DIMENSIONAL2 in the loaded XML yet to be a pre-req. Putting them all in one file fixes that problem.

So the easy rule of thumb is that if a Module references another Module, they need to be combined. If it only references the main mod, then it is fine to leave it as a seperate entity.

Also, always check the civlopedia to ensure that the first couple of entries that you did NOT change are still unchanged if anything goes wrong. Seems that lots of the FfH specific tags reference the index instead of the Type :( So you can't use those in modules (promotion Pre-reqs, Improvement Upgrades...)
 
The crashing in Vista occurs when you have any one or more of the folders Animals Build Lairs, Changed Summons, and New Summons in the Modulars folder. All other run fine together, so far. Civ IV will crash to desktop if even just one of these is in the Module folder.
 
I use Notepad2 for editing both XML and Python.

I used to use JCreator (a Java editor I already had on my computer) for the xml (since it let me conveniently collapse tags), but it tended to freeze up and crash a lot. I switched to mostly notepad2 and didn't reinstall it when my hardrive broke. Oh, WinMerge is useful to when updating a mod, but lss so when first writing it.


I always use notepad2 and IDLE for python. I really don't like the way IDLE works in general (no way to distinguish between spaces and tabs? how is that appropriate for a python editor?! Oddly limited scrolling and the fact that the programs recommended fix for a confusion between tabs and spaces is to turn all tabs to spaces really bug me too.) but it is useful for finding errors. (I know you didn't ask about python. I don't think I can limit myself to xml only modding, which is why I'm not making my modmod modular.)
 
So it looks like the UnitInfos file then. That is the only common thread I can think of between each of those that isn't in any of the others.

Do you understand XML enough to try and add those to the main FfH and see if they still cause crashes? All you'd have to do is copy/paste the correct chunks from the modules into the XML for normal FfH. I can't imagine that it is the code though, so it must be a problem with Vista loading up that particular file modularly.

I guess it could be some special character in the TEXT file for one of the entries in each Civlopedia too. To test that you would just delete all of the TEXT folders.
 
By using the installer I can guarantee ... Plus this way you are forced to start with all of them ...

Err... yes, unless someone points the installer to a bogus directory and then lifts what they want from there.

But I don't know anyone who'd do that. :eek:

I don't use an editor, I do all of my work directly in the XML using Notepad.

Ok, thanks for the info, xienwolf and MagisterC.

So the easy rule of thumb is that if a Module references another Module, they need to be combined. If it only references the main mod, then it is fine to leave it as a seperate entity.

I hadn't known that, thanks.

Seems that lots of the FfH specific tags reference the index instead of the Type :( So you can't use those in modules (promotion Pre-reqs, Improvement Upgrades...)

Ah, I just hit the "modular promotions don't work bug" with my own modmod.

At least it's easy to just drop the needed text into the XML file.

Though so far my _big_ problem has been remembering to rename the files properly. ;)
 
I can recommend a very good Notepad replacement (of course open source and free): Notepad++ http://notepad-plus.sourceforge.net
It has syntax highlighting and you can collapse tags, and of course record macros very simply and quickly, use many enhanced text editing features etc. You should really take a look at it, it's a real time saver, starts up very fast and looks better. :)
 
Well, no need for bogus directories now, every module is individually uploaded and linked in the first post :)

EDIT: JDexter, I think you have made a convert of me :) Notepad2 did the coloration bit, which was nifty, and handled indentations fairly well. But with the plugins I am seeing available on Notepad++ I can see it helping quite a bit more. But even without plugins, the ability to collapse sections of indentation is PHENOMENALLY useful for me (since I have to count the number of entries quite often to find these damn indexing conflicts)
 
How does Notepad++ compare to Notepad2? It looks very similar, except for the syntax folding and the mention of bugs (I've yet to come across any in Notepad2)
 
Well, with one of the add-ons you can get the same utility as WinMerge. You get tabbed opening of XML (great for me), it can auto-close your tags (I occasionally accidentally delete some, so nice to back me up with).

I haven't played with it much, but so far the Macro is pretty sweet (Can do Find/Replace of multi-valued fields with it if you are tricky, so makes setting all events to 100 or 0 percent chance of being in game easier)

And that syntax folding alone makes me like it more than Notepad2.

EDIT: MC, you will want it for the "Search in File" plugin if nothing else :) You can search all the files in a directory for a set term. Great for finding obscure references to characters for the Quiz game :p
 
Yeah it does seem better (it also looks very similar to Code::Blocks, and I just realized it can be used for C++ too, so the same program can be used for modding xml, python, and the SDK), but it did freeze up for a while.

It still can't debug with it though, right? (Meaning I shouldn't delete IDLE just yet)
 
It still can't debug with it though, right? (Meaning I shouldn't delete IDLE just yet)

I used to debug a bit with IDLE, but it seems with BtS you can reload python modules "on the fly". If you start a single player game and Alt-Tab out to change the Python file, it reloads it when you Alt-Tab back into Civ. If I need to check what variables contain, I tend to get it to print them to a file to read whilst I'm Alt-Tabbed out.

The IDLE interface just got to be a bit of a pain in the backside.

I'm also having an play around at producing a GUI app using Python (and the wxPython libraries) - the first experiment with which is actually a text-editor for Civ with the BtS Python API built in (select a class from the list, select a function from it and it'll insert the function/arguments to the cursor). Mostly doing it for the Python practice - but if it turns out half-way useful I'll post it over here too.

Anycase - thread hijack in progress - I'll be quiet again now :)
 
Hey, great mod so far. Played my first game last night, and got steamrolled by Auric. No building requirements makes the AI seem a lot smarter...

Speaking of which, I looked in the WB and the Amurites were building Wizards. Is this an intended consequence of the no building req. option? If it gets the AI to use magic, then I'm all for it, but it might be overpowered.

Also, any chance you could include fireballs/meteors with 0 sight for next release? They're powerful enough, and the idea of a fireball scout never sat well with me.
 
Top Bottom