Jump to content

"ADD_SPELL_EX: couldn't add new_spell to spell.ids as no slots remain"


Recommended Posts

What is the limit to spell.ids and is there a way to bypass this limit?

I've created a whole load of spells in IWD:EE and want to expose them to .BCS scripts so that NPCs can use them like so:

ReallyForceSpell(NearestEnemyOf(Myself),NEW_SPELL)

Before I tried to edit spell.ids with weidu, there were ~726 lines already used. I get to adding 26 new lines before it complains that no slots are available.

This is how I add spells:

LAF ~ADD_SPELL_EX~ INT_VAR type = 2 level = 1 STR_VAR file = EVAL ~my_mod/data/RB_SPL01.SPL~ name = ~NEW_SPELL~ RET DEST_FILE END

 

Edited by pete_smith1229
Link to comment

50 normally learnable wizard spells per level, 50 normally learnable priest spells per level. If you don't care about that, 4000 total slots split among the four (SPCL, SPIN, SPPR, SPWI) groupings. There's no way to bypass that overall limit, as spell.ids entries encode resource names.

There is an alternative if you want to use your spells in scripts; all of the "cast a spell" actions have RES versions that take the spell resource as an argument instead of the symbolic name. For example,

ReallyForceSpellRES("NEWSPELL",NearestEnemyof(Myself))

will do the exact same thing as your version and cast your NEWSPELL.SPL at the nearest enemy.

Edited by jmerry
Link to comment
2 minutes ago, jmerry said:

50 normally learnable wizard spells per level, 50 normally learnable priest spells per level. If you don't care about that, 4000 total slots split among the four (SPCL, SPIN, SPPR, SPWI) groupings.

There is an alternative if you want to use your spells in scripts; all of the "cast a spell" actions have RES versions that take the spell resource as an argument instead of the symbolic name. For example,

ReallyForceSpellRES("NEWSPELL",NearestEnemyof(Myself))

will do the exact same thing as your version and cast your NEWSPELL.SPL at the nearest enemy.

You're a genius! Using the alternative works perfectly and saves a lot of hassle. Many thanks!

Link to comment
15 minutes ago, subtledoctor said:

Yes, use SpellRES() and ForceSpellRES() for nonjoinable creatures. You really only should use ADD_SPELL for spells that you want player-character sorcerers to have access to. 

Ahh that's good advice and makes perfect sense after being made aware about learnable spells for each level for various classes. Thank you!

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...