Jump to content

ForceSpellRES() may fail to execute for innates that have a school

Recommended Posts

As the title says, an innate (spell type 4 in the header) with associated school other than NONE fails to execute in scripts when called through the ForceSpellRES action, simply changing the type to either wizard or cleric solved it immediately.

Schoolless innates have no such issue, neither do innates with a school if those are included in SPELL.ids and scripted for use via symbolic name rather than filename (i.e. Spell/ForceSpell/ReallyForceSpell/ApplySpell... drop the RES).

IESDP notes this action is unreliable, I've never had a problem before though, even with 8 character filenames rather than 7. Tested on original BG2 but don't see a fix of this mentioned for EE.

Link to comment
1 hour ago, jmerry said:

Huh. The specific details here make me wonder - is this about the casting animation?

I didn't think so, because casting animation is skipped with ReallyForceSpellRES() and ApplySpellRES(), which still failed, a quick test reveals it's the school itself, not the casting animation which prevents it executing if an innate rather than a cleric/wizard spell.

Incidentally, Hardiness is an innate which by default has both alteration casting animation and school in vanilla game, yet Hardiness can be cast via ForceSpellRES("SPCL907",Myself) whereas an new .spl of my own could not, possibly a hidden exception for vanilla game files.

Note that DRGRBRHT.spl - Green Dragon Breath - is an innate which has a school of GENERALIST rather than NONE, it's cast by ReallyForceSpellRES() in their script, and works (even with an 8 character filename!), whereas my added spell didn't, further supporting the idea of exceptions or possibly the action is unreliable if the .spl file contains special characters in the name (but why it should only fail for innates with schools is still beyond me).

Edited by polytope
Link to comment

Ok, I solved this one.

I had absentmindedly left the spell with a minimum level requirement for the first extended header, greater than 1.

The creature trying to cast it had a priest level exceeding the level in another class (mage), hence why it could cast it as a priest spell, or a schoolless innate, but could not cast it as a schooled innate because the game seemingly assumes that innates with an associated school (abjurer through transmuter, probably, MSCHOOL.2da) should check corresponding mage level rather than highest level in any class.

A mistake on my part, but still possibly useful to know the latter information.

Edited by polytope
Link to comment

Uh ... your original post was about ForceSpell/ForceSpellRES. Which, unlike the "Really" version, does respect casting time and play the animation.

If your spell is failing even when cast instantly with ReallyForceSpellRES, maybe there's something wrong with the spell itself.

Link to comment

There was indeed something wrong with the spell, rather than the scripting action.

It's still interesting to me:

  • spell required (wrongly, in this case) level x in its only header
  • cleric/mage of levels x, x-n

Can cast it if it's a priest spell (cleric level x) or a schoolless innate (highest level in any class is x), can't cast it if an innate with an associated school (which seems to check for mage level instead, and was less than x).

Edited by polytope
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.

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...