This is best explained through examples:
Mod A might introduce the 1st level spell "Curse" as SPWI124.spl. Mod B introduces the same spell "Curse" as SPWI125.spl. There will be two copies of "Curse" in the players' 1st level priest spellbooks.
An even worse case scenario might be: Mod A introduces "Curse" as SPWI124.spl. Mod B introduces "Sunscorch" as SPWI124.spl. The user is forced to choose between those spells, by installing one mod first and the other one afterwards.
The WeiDU function ADD_SPELL was introduced to remedy this issue: different versions of the same spell accross different mods will overwrite each other if necessary, without unintentionally overwriting another spell and without unintentionally using up extra slots. Since WeiDU v221, mods that use this function can be safely un/reinstalled without messing up saved games.
The versatility of ADD_SPELL allows us to agree on common spell names added in the spell.ids instead of common .spl resources (which is less compact and would be much more difficult to maintain). We do not have to worry about how many slots we spend unless some user has more than 99 spells per level on his/her installation.
This applies to spells that use the SPCL/SPIN/SPPR/SPWI prefixes. The benefits of these prefixes are: scriptability (RES actions do not cover everything), sorcerer/new-game spell selection, priest spells being automatically granted to classes that use them, and certain opcodes are hardcoded to these prefixes. Ascension64's ToBExtender erases the only disadvantage to using these prefixes: the spell selection screens and mage/priest spellbooks can display more than 24 spells per level.
We will have to:
a.) compile a list of spell.ids entry names (ie CLERIC_BLESS) from various mods
b.) agree on common entry names so we can generate a standard list
c.) convert old mods to use ADD_SPELL using entry names from the standard list
d.) ensure (for each mod author) that any other mod files take into account that the same .spl file might be different for each and every install
This does not apply to:
a.) spells/abilities with prefixed filenames that are unlikely to appear in any other mod (ie Quest-specific spells, spells tagged to a certain character, etc.)
The benefits:
a.) basic compatibility between different spell mods
b.) introducing new scriptable spells without worrying about what filename to assign, since ADD_SPELL does it during installation in an optimal way
c.) the inclusion of mod-added priest spells in Divine Remix's sphere system
d.) allows users to play with more robust versions of the same spell by installing more robust mods after less robust ones (ie SpellPack's Sunscorch will overwrite TDD's version of the spell)
You can read more about ADD_SPELL in Turambar's thread or the WeiDU Readme. SpellPack B6 (yet to be released) has already switched to using ADD_SPELL.
Edited by Galactygon, 26 December 2010 - 10:47 AM.