Pocket Plane Group

Friends and Neighbors => Weimer Republic (WeiDU.org) => WeiDU => Topic started by: agb1 on February 07, 2016, 08:19:33 PM

Title: ADD_SPELL "Couldn't add [...] to spell.ids as no slots remain"
Post by: agb1 on February 07, 2016, 08:19:33 PM
Apologies if this has been discussed already.  I found a thread regarding ADD_SPELL "no slots" and SPIN spells here http://forums.pocketplane.net/index.php?topic=29433.0 but I am reporting a different issue.

More details here:  http://www.shsforums.net/topic/56752-the-official-bwp-fixpack-thread/?p=586876

Briefly, unless I've missed something else in the Divine Remix code, it seems that calling ADD_SPELL to modify a pre-existing IDS entry causes that entry to be deleted if the "no slots remain" error occurs.

Edit:  also, I would like to second the request from the other thread for the "no slots remain" error to at least result in the component being INSTALLED WITH WARNINGS instead of SUCCESSFULLY INSTALLED.
Title: Re: ADD_SPELL "Couldn't add [...] to spell.ids as no slots remain"
Post by: Mike1072 on February 07, 2016, 08:25:06 PM
My plan for updating the ADD_SPELL code was to FAIL the installation if no slots are available.  That should fix the issue, in a way.
Title: Re: ADD_SPELL "Couldn't add [...] to spell.ids as no slots remain"
Post by: agb1 on February 07, 2016, 08:56:40 PM
Is there a way to check if there are available slots before calling ADD_SPELL?

Also, in the particular case of replacing an existing slot, shouldn't it always succeed?
Title: Re: ADD_SPELL "Couldn't add [...] to spell.ids as no slots remain"
Post by: Mike1072 on February 08, 2016, 12:53:31 AM
There's no way to check beforehand whether ADD_SPELL will fail or not (unless you replicate the code it uses), but you will be able to use an ACTION_TRY statement around the ADD_SPELL which will let you catch errors and do something other than failing the installation.

I'd have to have more details on what you mean about replacing an existing slot.
Title: Re: ADD_SPELL "Couldn't add [...] to spell.ids as no slots remain"
Post by: agb1 on February 08, 2016, 12:59:40 AM
An example - Divine Remix component 11 tries to ADD_SPELL to update an existing IDS entry - CLERIC_NEGATIVE_PLANE_PROTECTION, in this case to change its spell level.

This failed in my install with the "no slots remaining" error, and the result was that IDS entry was removed from spell.ids.  I do not think ADD_SPELL should delete the IDS entry in this situation.
Title: Re: ADD_SPELL "Couldn't add [...] to spell.ids as no slots remain"
Post by: Mike1072 on February 08, 2016, 01:11:50 AM
If it changes the spell level, that means finding a new slot for the spell.  The spell slots are based on the filename, not the identifier.  If CLERIC_NEGATIVE_PLANE_PROTECTION was SPPR504 and you used ADD_SPELL to add it at level 6, it would need to be given a level 6 spell slot (e.g. SPPR630).

When I update the code, I'll make sure it won't make any changes to spell.ids if it's going to fail because of no spell slots remaining.
Title: Re: ADD_SPELL "Couldn't add [...] to spell.ids as no slots remain"
Post by: agb1 on February 08, 2016, 07:41:44 AM
That should work.  Thanks!