Spell-modding limits, and a workaround of sorts
The last spellnr that works at all is 1023. However, right-click view (fatigue, effect, description etc) of spells numbered 1000 or more will crash the game. Because there are 829 spells at the moment, there are 171 spell slots left for modding and for future spells before one or both of those limits are hit. While it's probably enough for official spells and most mods, all-mods games with multiple nations could hit the limit. Also, at least Conceptual Balance will use lots of custom #onebattlespell effects.
In addition, while you can use #selectspell to choose empty spells and edit them, it seems the game will stop searching for new spells when it hits the first empty slot. As you know if you've read the discussion about missing modding commands in 3.14, #onebattlespell and #nextspell can only reference custom spells via their spell id numbers. The ID's change depending on which mods you chose, and the order in which you enabled them! The mod that was enabled first will be read first, and it's #newspells will be added first, thus the numbering will start from that mod.
Thanks to FoodStamp's idea, I've made a mod that creates empty spells that modders can use with #selectspell, partially circumventing the problem. For A Spell Enabler mod to properly create the null-spells usable in modding, it has to be selected before any mods that use these null-spells. If the order is wrong, you WON'T get an error message and the game seems to start properly, but the modded spells won't be there. To see the order the mods will be read in, press Esc and choose 'View enabled mods' in map view. This mod (A Spell Enabler) should appear first.
If I made all slots up to 999 usable via #selectspell, any mod using #newspell would crash. In this first version, I've left 71 slots free for #newspells, and reserved 100 spells for #selectspell use, which means that #selectspell works for spells between 0 and 929.
During the process of discovering various facts about how Dominions handles mods, I discovered how to organize your mods alphabetically in Dom3's mod preferences. The game seems to remember the order you added new mods in, and will only reorganize the folder if you first take the mods away. I did this by creating a folder called 'temp' in my Dominions 3\mods\, moving all the .dm files there, launching and quitting Dominions and moving the files back. I checked that no mods were left in the preferences screen, but I don't think it's required for this to work.
After this, A Spell Enabler will be first mod in your mod preferences, and thus easy to enable. You still have to remember to enable it before any mods you want it to work with, though.
Last edited by Endoperez; August 13th, 2008 at 11:36 AM..
|