Jump to content

[Discussion] Spellstate budget


DavidW

Recommended Posts

Posted

It would be good to know how severe the demands on spellstates actually are. There are 256 slots available, of which the vanilla game uses 133, leaving 123 free. My mods (mostly SCS, but also some upcoming projects) use maybe 30-40 of those. Does anyone have an impression of what other mods do? If actually the extant mods only use 50-60 in total, we could borrow a bunch for FP with impunity (which would simplify immunities); if there's real pressure on splstate.2da, of course we shouldn't.

(It would be *really* nice if BD were willing to extend splstate to 2 bits in 2.7)

Posted (edited)

I haven't done a complete count of how many I have used... I really should. My current install with all of my mods has 18 spellstates with my prefix. With recent additions, that might be up to 20 or so. That game is fairly heavily modded, with an emphasis on tweaks more than content, and SPLSTATE.IDS has 215 entries. EDIT - if I had installed Morpheus' mod as a described below, that would bring my game's total to 245 or more. Basically right up near the limit.

Worth recollecting, though, that in certain circumstances - if scripts are not involved and the spellstate is only needed for opcodes 318/324/326 - then proficiencies can safely be used the same way. I have moved several of my spellstates over to the 4th byte of stat 115, and I will probably move a few more over to reduce my usage of SPLSTATE.IDS. There is room for over 400 of these pseudo-spellstates. (Though now that I think about it, their use should be recorded in an .IDS or .2DA file somewhere, to prevent overlap.)

Edited by subtledoctor
Guest morpheus562
Posted (edited)

I think my scripts have about 30+ new spellstates that are being created (a good amount to track new spells being added by other mods); however, I think it may not be possible for all to be added at once due to other mod compatibility, etc. My current splstate.ids file has 212 slots being used.

Edited by morpheus562
Posted (edited)

Here is another issue that can be easily fixed with a new spellstate.

As you know, the script trigger SpellCastOnMe() returns false in case of SPL/ITM files whose Ability Target (Extended Header @ 0xC) is 4 (Any point within range).

As a result, Nishruus and Hakeashars cannot be killed by Dispel Magic (since all such spells have an Ability Target of 4). In particular, the following script block is completely useless

Spoiler
// Taken from "nishru01.bcs"

IF
	OR(3)
		SpellCastOnMe([ANYONE],CLERIC_DISPEL_MAGIC)  // SPPR303.SPL (Dispel Magic)
		SpellCastOnMe([ANYONE],WIZARD_DISPEL_MAGIC)  // SPWI302.SPL (Remove Magic)
		SpellCastOnMe([ANYONE],WIZARD_TRUE_DISPEL_MAGIC)  // SPWI326.SPL (Dispel Magic)
THEN
	RESPONSE #100
		Kill(Myself)
END

 

If we add a new spell state, we can simply patch all such spells with a subspell (applied by op326) that can actually kill them (via op13 for instance...)

On reflection, in this case it is probably easier to add a new SPECIFIC (@ 0x274) value... In so doing, we can simply patch all Dispel Magic spells with an additional op177 effect (resource=DESTSELF) targeting the new SPECIFIC value...

Edited by Luke
Guest morpheus562
Posted

One of my things I patched in my scripts was having Wild Magic and Dead Magic zones apply the appropriate, existing spellstates (WILD_MAGIC_AREA and DEAD_MAGIC_AREA) to any characters within those zones. The spellstates were already there, they were just never being assigned. Is this something we want to correct for? The only mod I know that uses these is mine, but it would allow future modders/mods to use these spellstates.

Posted

Pardon me if this has been discussed elsewhere, but I thought it would fit here.  There is a state (I wouldn't know if it's a spell state or something hardwired in the engine that can't be fixed without @Bubb), but when someone is blind they can hide 100%.  I'm sure we'd all agree this can't possibly be intended behavior.  Is it possible, if it is hardwired, that we use a different 'state' on it?  I know next to nothing about spell states so...it's just an ask.

Posted
20 minutes ago, Lauriel said:

Pardon me if this has been discussed elsewhere, but I thought it would fit here.  There is a state (I wouldn't know if it's a spell state or something hardwired in the engine that can't be fixed without @Bubb), but when someone is blind they can hide 100%.  I'm sure we'd all agree this can't possibly be intended behavior.  Is it possible, if it is hardwired, that we use a different 'state' on it?  I know next to nothing about spell states so...it's just an ask.

That happens because the engine checks if the creature hiding can see any enemies, not if any enemies can see the creature. An exe patch could approximate a fix by changing that check to use the default range of 14, (instead of the current visual range, which is 2 when blinded).

Posted
On 3/18/2022 at 4:04 AM, DavidW said:

If actually the extant mods only use 50-60 in total, we could borrow a bunch for FP with impunity (which would simplify immunities); if there's real pressure on splstate.2da, of course we shouldn't.

One problem of not using spell states, is that, as mentioned on this thread (and an older one), some modders are using proficiencies instead. Freeing proficiencies by changing detectable spells seems worth it, to me at least. But I'm not so experienced, so I can't see the consequences of such change.

Posted

Reflecting more on this: I think the spellstates that FPEE would use almost entirely overlap with ones SCS uses *anyway*. So I think there's very little actual cost in using this method for FPEE.

Posted
8 hours ago, DavidW said:

Reflecting more on this: I think the spellstates that FPEE would use almost entirely overlap with ones SCS uses *anyway*. So I think there's very little actual cost in using this method for FPEE.

I think that's true for any mod that introduces new enemy encounters and the like...

Anyway, I'm definitely in favor of this approach

Spoiler

// Hold Person

  • op324 (GENERAL != HUMANOID, timing=0, duration=0, resource="sppr208")
  • op324 (SPLSTATE = IMMUNITY_TO_HOLD, timing=0, duration=0, resource="sppr208")
  • op175 // automatically displays string `STRREF_EFFECT_HOLD` and the portrait icon "Held". It is imperative this opcode is here (before cosmetic effects) for later compatibility with IWDification (in particular "7eyes.2da")
  • op215 (resource="spmindat.vvc")
  • op174 (resource="eff_e05.wav" – ending sound)

 

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