Jimbo: Do you have dead party members with you when the crash occurs?
Echon: Not sure this is connected to that - but a while back, we had CTD upon resting if a dead party member would have had a dream dialogue (dialogue that triggers upon resting) and the according script block startd with the AreaType() check. Reordering the script blocks so that the first trigger would be one detecting the death solved the problem. Meaning, you want a trigger that will fail if the character is dead evaluated before the AreaType() check, keeping the AreaType() from getting parsed at all. The discussion is
here, in case you have access to the BG1NPC Project. Reordering e.g. a script block for Zxar looking like this:
IF %BGT_VAR%
AreaType(FOREST)
InParty("%IMOEN_DV%")
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
See("%IMOEN_DV%")
!StateCheck("%IMOEN_DV%",CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
RealGlobalTimerExpired("X#DreamTalk","GLOBAL")
Global("X#XZIM1","GLOBAL",2)
THEN
RESPONSE #100
IncrementGlobal("X#XZIM1","GLOBAL",1)
RealSetGlobalTimer("Xz1BackUpTimer","GLOBAL",18)
RealSetGlobalTimer("X#DreamTalk","GLOBAL",180)
StartDialogueNoSet("%IMOEN_DV%")
END
so that it looks like this prevented the crash from happening:
IF
!StateCheck(Myself,CD_STATE_NOTVALID)
%BGT_VAR%
AreaType(FOREST)
InParty("%IMOEN_DV%")
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
See("%IMOEN_DV%")
!StateCheck("%IMOEN_DV%",CD_STATE_NOTVALID)
RealGlobalTimerExpired("DreamTalk","GLOBAL")
Global("XZIM1","GLOBAL",2)
THEN
RESPONSE #100
IncrementGlobal("XZIM1","GLOBAL",1)
RealSetGlobalTimer("Xz1BackUpTimer","GLOBAL",18)
RealSetGlobalTimer("DreamTalk","GLOBAL",180)
StartDialogueNoSet("%IMOEN_DV%")
END