The 255 spells known crash: NWN2 crashes whenever a wizard knows 255 spells or more.
- I suspect the summon creature line of spells is not counted for this purpose.
- This crash only occurs in environments where custom spells have been added. Stock NWN2 doesn't contain 255 wizard spells.
Readme for the 255 spells known crash-prevention fix,
The core system verifies whether Wizards are near the spell limit when entering the module. If they are it will randomly remove certain spells.
- In this case prevention only occurs on login and on level-up. (And whenever you manually perform a count)
The expanded system allows you to replace the stock spell learning mechanic. Instead players will use a custom feat to target an item for learning. Then they will study that item's spell when they cast it (such as a spell-scroll, or a wand).
- With this variant prevention also occurs whenever a wizard player learns a new spell from a scroll.
Core system,
- Copy bg_countspells.NSS and bg_remove_spell_random.NSS into your module.
- Have your module on-load script execute 'bg_countspells' (see example) and count wizard levels.
- Have your module on-level-up script execute 'bg_countspells' (see example).
Expanded system,
- Copy bg_countspells.NSS and bg_remove_spell_random.NSS into your module.
- Also copy pc_on_scribescroll.NSS and pc_on_scribescroll2.NSS into your module.
- Create a new feat in feats.2da which links to a spell in spells.2da.
- Have the new feat target items. Set its spell-script to 'pc_on_scribescroll'.
- Give the new feat a fancy name.
- Remove the stock game's spell learning mechanic from your context_menu.xml so it can't be used anymore.
------------------------- Contributions! ------------------------------
SQL addition, by: ComeAndSee.
August 27th 2016.
Readme for the SQL version of the 255 spells known crash-prevention-fix, NWN 2.
I rewrote it to use SQL if you're interested. On my testing it runs about 10 times faster!
The major changes are the server will write into SQL all known Wizard / Sorcerer spell IDs and instead of looping through 2000+ spellIDs, it will do about 300-400 or so. It will also store the information on a database so it only really needs to run once the first time a Wizard logs in and when they level up (or rebuild). If they rebuild put this in...
SQLExecDirect("UPDATE spellids_count SET `count`=0 WHERE `name`='"+name+"' AND `act`='"+act+"';");
- On server load put OnSeverLoadPopulateSpellSQL();
- On PC loaded put CountSpells(oPC,0);
- On level up put CountSpells(oPC,1);
Attachment | Size |
---|---|
![]() | 7.21 KB |
![]() | 2.22 KB |