Modders Guide to FfH2

Is there a limit to the number of different promotions or units one can bring into the FfH2 baseline mod?

I added a few things and have a stable modmod. But now whenever I try to add a new promotion -- of any kind -- or a new unit -- of any kind -- the mod will load to the start screen but when I try to load a save game it crashes to desktop.

I have already added a few promotions, a few spells, and one unit successfully. I realize this description is a bit vague, but does anyone have any ideas?

Thanks!
 
Are you saying that you cannot load a savegame, or that you cannot even start a new game?

You might have simply managed to break your savegame with the latest changes. Especially if you are adding material to the front of the XML instead of the back of it.
 
Are you saying that you cannot load a savegame, or that you cannot even start a new game?

You might have simply managed to break your savegame with the latest changes. Especially if you are adding material to the front of the XML instead of the back of it.

Well, I guess it is obvious that I'm new at this. I didn't even try to start a new game. I had a savegame scenario that I'd been tweaking -- I suppose I need to remake it from scratch if I'm adding new units, etc? Bleh.

FWIW, I always make my additions to the very end of the XML files. Easier to keep track of it that way.

I will try this "start new game" of which you speak. But I'm just an unfrozen caveman, and your modern XML ways frighten and confuse me...
 
Kael, could you tell me where the python isWorldUnitClass() function gets defined? I'm working on adapting Sevopedia for FfH and since it's used in the standard Civilopedia to differentiate between Heroes and regular Units, I'd like to see if it's not possible to split off Equipment as well. But I'd like to see if I can't reuse the existing code before I start hacking stuff myself.
 
Kael,
I have a request, can the field bSacrificeCaster be transformed into an integer? With the percentage of having the caster die? That would be much more versatile.

Thanks.
 
Are you saying that you cannot load a savegame, or that you cannot even start a new game?

You might have simply managed to break your savegame with the latest changes. Especially if you are adding material to the front of the XML instead of the back of it.

Xienworlf, I'm curious on how modular loading work exactly? If a variable or object is present in 2 places, what is the one which will be loaded?

How can I do a modular mod for 2-3 spells eg?
 
It will load the last one read, which means anything in the Modules Folder if you placed things there. However there is no reliable way to tell what part of the Modules folder will load first, so you have to ensure that you don't have any conflicting Modules.

Spells are tricky. Few of them actually work through the XML, in general they call Python to do their nifty work. Summons are pretty easy since they just make a unit appear and all the rest is handled automatically. So, if you can do your spell with JUST XML, then you simply have to put the XML files you wish to modify into the Modules folder along with the Schema file which they refer to in the first couple of lines. Then you can delete all the large chunks which you don't change in each file (everything between the <SpellInfo> tags).

Also, I haven't tested the Spell files yet to see which portions of them fail for Modular Loading. Each xml has 1 or 2 so far, so I am sure there are some in SpellInfos as well :(.

For a fairly decent walkthrough, you can follow this thread. It obviously doesn't pertain directly to Spells, but it should help you to see the technical aspects of how to get started.

Quick and dirty way to check for which lines of the XML do not work Modular style is to create a completely blank spell (so all entries are <___></___>) and have 6 or 7 entries like that, then load the game and see how much you jacked up the Civlopedia entry for the first couple of things which are in the game.

EDIT: And of course you can always download my Modules just to see how I have them set up. All of the New Summons are adding in new spells, so should show you most of the structure you need.
 
thanks!

I have a more mundane problem though. I edited the Blinding Light Spell so that it gives the Charmed and fatigued promotion instead of blocking the enemy 2 turns (as there is a problem with that).

Charmed effect works, but Fatigued is never given. I don't understand why. If I only mod it to give Fatigued, then the spell is still off when adjacent to an enemy, as if the conditions are not fulfilled, but they are.

I don't understand the logic here.
 
I am reasonably certain your problem is that the promotion you grant has to be available to that UnitCombat to apply it through the XML. So far Fatigue is only used for Centaurs who use Sprint, so is applied by Python. But if you want to be able to hit someone else with it you'll have to add the other unitcombats to the available list. Of course, that means that those unitcombats are then able to take the promotion when they level, so to block that you have to make TECH_NEVER a pre-req Tech (look at how Enervation is done)
 
The source code for 0.31 is linked in the first post.
 
How would I make 'Adventure Mode' availiable as an option?
 
The BUG mod isn't capable of handling the sudden appearance of Hyborem (or Basium, I guess). Can anyone point me towards an event that I could hook into when either of these Civs appear?
 
Is the technology enabling improvements hardcoded in the DLL or is there just an XML tag I'm missing somewhere? I'm wanting to make barrows and graveyards buildable at necromancy, but it doesn't seem to be within the technology infos or the improvement infos.
 
Is the technology enabling improvements hardcoded in the DLL or is there just an XML tag I'm missing somewhere? I'm wanting to make barrows and graveyards buildable at necromancy, but it doesn't seem to be within the technology infos or the improvement infos.

Its in the build infos.
 
Back
Top Bottom