STATE_REALLY_DEAD in UDMPSWN.BCS is not reliable
swit
Member, Translator (NDA) Posts: 495
According to @CamDawg and @Erg STATE_REALLY_DEAD check is not always reliable when running on dying creature: http://gibberlings3.net/forums/index.php?showtopic=26728#entry227743
There is also a link to similar problem already fixed in BG2:EE in that topic.
I've encounterd similar problem in underdark AR2400 - there should be 1 respawn for UDMIND10.CRE located in a room at x=4195, y=1681. It has local script attached named UDMPSWN.BCS with this code:
@CamDawg, @Erg could you please comment on this issue if my workaround is indeed 100% reliable?
There is also a link to similar problem already fixed in BG2:EE in that topic.
I've encounterd similar problem in underdark AR2400 - there should be 1 respawn for UDMIND10.CRE located in a room at x=4195, y=1681. It has local script attached named UDMPSWN.BCS with this code:
In my game this block did not trigger (probably the script stopped working after creature death before it detected it). So I suggest moving this block to AR2400.BCS instead, to make it more reliable. For example like this:
IF
StateCheck(Myself,STATE_REALLY_DEAD)
Global("CDDieReplace","LOCALS",0)
THEN
RESPONSE #100
SetGlobalTimer("SpawnIllTimer","GLOBAL",TWELVE_MINUTES)
SetGlobal("spawnIll","AR2400",0)
SetGlobal("CDDieReplace","LOCALS",1)
END
Sorry, I no longer have a save file. But it would be useless anyway as the STATE_REALLY_DEAD in local script problem seems to be a timing issue which is hard to reproduce.
IF
Global("CDDieReplace","AR2400",0)
OR(2)
StateCheck("udmind10",STATE_REALLY_DEAD)
Dead("udmind10")
THEN
RESPONSE #100
SetGlobalTimer("SpawnIllTimer","GLOBAL",TWELVE_MINUTES)
SetGlobal("spawnIll","AR2400",0)
SetGlobal("CDDieReplace","AR2400",1)
END
@CamDawg, @Erg could you please comment on this issue if my workaround is indeed 100% reliable?
0
Comments
Concerning reproducibility, see this or, for the Enhanced Editions, this.
Edit: Sorry, I didn't take in account that there are several differences between your case and mine. In particular, in my case the creature was supposed to die only once. In your case Dead() will not work because it will return TRUE always once the first instance is dead. I think you should use Died("udmind10") instead.
https://forums.beamdog.com/discussion/25072/i-ran-out-of-mind-flayers
https://forums.beamdog.com/discussion/19686/mind-flayer-tunnels-spoilers-question
https://forums.beamdog.com/discussion/28357/trapped-in-illithid-layer-bug-spoiler
Edit: in theory CDDieReplace should work if used locally to the creature, because it will be reset to zero once the creature is respawned, but it will not work if used locally to the area unless you add SetGlobal("CDDieReplace","AR2400",0) to the area script when the creature is respawned. Also see my edit above about replacing Dead() with Died().
I cannot test in BGII:EE as I don't have it, but something like this should work: followed but something like
the modified script has now both variables "spawnill" and "CDDieReplace" on AR2400, but only one should be really required.
Besides, maybe I'm overthinking it, but I'm not sure it is a good idea to use STATE_REALLY_DEAD here (IESDP says that CreateCreatureDoor requires 3.5 seconds for the creature to appear, and I'm not sure what StateCheck("udmind10",STATE_REALLY_DEAD) would return in that interval) and Died() should be enough, so maybe something like this in the area script is better: