Jump to content

Scripting for spells


Miloch

Recommended Posts

If using HaveSpell(), should Class spells (like offensive spin) be added to a CREs memorized innates? Or if you have the relevant kit (blade in this case) does the engine automatically figure in the class spells the CRE should have?

If it's a joinable creature, CLABs do not get applied until they join the party so there's no need. If they're not in the party, just use one of the Spell actions that don't require memorization and track it with a LOCALS.

Link to comment
If they're not in the party, just use one of the Spell actions that don't require memorization and track it with a LOCALS.
Well, that's kind of what I was trying to avoid. This is for an enemy CRE. If it's something he could cast once, I guess I could just do a SpellNoDec and a SetGlobal with a LOCALS. But he can cast it twice, so I think I'd have to use an IncrementGlobal and a GLOBAL. And the more I understand about those, the messier they seem to me, or at any rate I'd like to avoid them if they're not necessary. So I'm just wondering if there's an alternative and also kind of wondering why there's no Class spell slots for CREs (unless they are in fact considered Innates or automatically accounted for).
Link to comment
So I'm just wondering if there's an alternative and also kind of wondering why there's no Class spell slots for CREs (unless they are in fact considered Innates or automatically accounted for).

I'm not sure I follow. There are only three spell types--arcane, divine and innate. What you're calling class spells are always one of the three. An Avenger's spells are actually divine, spins are innate, etc. All should be listed in the memorization block of a creature file.

 

One disadvantage to using HaveSpell() with innates is that if the spell is not defined as level one, HaveSpell() will crash the game. The trivial workaround, changing innates to level one, is unfortunately not without consequence. Most notably, I believe just about every SpellCast* trigger known to man fails. (To be fair, it seems most SpellCast* triggers fail unless you shake chicken bones over the engine, but my understanding is that this exacerbates the issue.)

Link to comment
I'm not sure I follow. There are only three spell types--arcane, divine and innate. What you're calling class spells are always one of the three.
Ok. I'm just going by the prefixes (SPCL### in this case). And the scripting conventions suggest there are four types of spells (1 for priest, 2 for wizard, 3 for innate, 4 for class). So I would refer to Defensive Spin as Spell(Myself,4522) or whatever - instead of 3522 if it were really innate, right? But if it's technically an innate, that makes sense I guess to assign it there, since there are no "slots" for "class" spells. Except for:
One disadvantage to using HaveSpell() with innates is that if the spell is not defined as level one, HaveSpell() will crash the game.
Which is a problem if this is coded as level 5 or whatever.
All should be listed in the memorization block of a creature file.
So why should I bother having the CRE memorise the spell (or even know it for that matter) if I have to use scripting commands that don't rely on either the CRE having it memorised or known? I would probably do it anyway, because I can be a stickler for details sometimes... just wondering why it's necessary if I can't use HaveSpell().
Link to comment

"Class" spells are just innates with a different name.

 

To fully script Offensive Spin you'd need to create a duplicate named either SPCL1xx or SPIN1xx and replace all references to SPCL521 in the game with the new spell (basically discarding the old spell completely).

 

/edit

 

Innates don't really need to known either, just memorized, though adding them as known also can be helpful to the modder :)

Link to comment

You can normally cast one single spell per round. The timer tracks that you don't try to cast another spell in the same round you cast the last one (which would usually lead to the character standing around until their next round started).

 

Spell casting time is relative to the round where the spellcasting starts (i.e., how much of that round is required to cast the spell). I think the value is 10ths of a round (each being 1/10th of 6 seconds), but I don't remember (it'd be hard to measure in any case, so the only important detail is that it's relative to the spellcasting round).

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...