Skip to content

If an NPC dies in BGEE do they appear in SOD?

Both Rasaad and Neera died in my current BGEE run and were ejected from my party without resurrection...

...can I expect to see them in SOD anyway?

Comments

  • atcDaveatcDave Member Posts: 2,387
    edited June 2023
    Probably. I haven't had either of them finish dead in my games, but other characters who died (Khalid, Dynaheir, Minsc) definitely showed up alive and well in SoD. I'm going to guess the game does not check.
    The big unknown to me would be if they are actually in your party at the end.
  • DhariusDharius Member Posts: 665
    Thanks. Does anyone have a more definitive answer?
  • jasteyjastey Member Posts: 2,780
    They reappear in BG:SoD, yes.
    Rasaad's first appearance in Iron Throne Building (bd0111.bcs):
    IF
    Global("BD_SPAWN_RASAAD","BD0111",0) // Iron Throne Floor, First Floor
    BeenInParty("RASAAD") // Rasaad
    THEN
    RESPONSE #100
    MoveGlobal("BD0111","RASAAD",[928.466]) // Rasaad
    ApplySpellRES("bdresurr","RASAAD") // No such index
    SmallWait(1)
    ActionOverride("RASAAD",Face(SSE))
    ApplySpellRES("bdrejuve","RASAAD") // No such index
    ChangeEnemyAlly("RASAAD",NEUTRAL) // Rasaad
    ChangeSpecifics("RASAAD",ALLIES) // Rasaad
    ActionOverride("RASAAD",SetGlobal("bd_joined","locals",0))
    ActionOverride("RASAAD",SetGlobal("bd_retreat","locals",0))
    ActionOverride("RASAAD",SaveObjectLocation("LOCALS","bd_default_loc",Myself))
    ActionOverride("RASAAD",ChangeAIScript("bdrasaad",OVERRIDE))
    ActionOverride("RASAAD",ChangeAIScript("DEFAULT",CLASS))
    ActionOverride("RASAAD",ChangeAIScript("",RACE))
    ActionOverride("RASAAD",ChangeAIScript("",GENERAL))
    ActionOverride("RASAAD",ChangeAIScript("",DEFAULT))
    ActionOverride("RASAAD",SetDialog("bdrasaad"))
    SetGlobal("BD_SPAWN_RASAAD","BD0111",1) // Iron Throne Floor, First Floor
    Continue()
    END

    IF
    Global("BD_SPAWN_RASAAD","bd0111",0) // Iron Throne Floor, First Floor
    !BeenInParty("RASAAD") // Rasaad
    THEN
    RESPONSE #100
    CreateCreature("rasaad7",[928.466],SEE) // Rasaad
    ActionOverride("rasaad",MakeGlobalOverride())
    SetGlobal("SPRITE_IS_DEADRASAAD","GLOBAL",0)
    ChangeSpecifics("RASAAD",ALLIES) // Rasaad
    ActionOverride("RASAAD",ChangeAIScript("bdrasaad",OVERRIDE))
    ActionOverride("RASAAD",ChangeAIScript("DEFAULT",CLASS))
    ActionOverride("RASAAD",ChangeAIScript("",RACE))
    ActionOverride("RASAAD",ChangeAIScript("",GENERAL))
    ActionOverride("RASAAD",ChangeAIScript("",DEFAULT))
    SetGlobal("BD_SPAWN_RASAAD","bd0111",1) // Iron Throne Floor, First Floor
    Continue()
    END

    Neera in Bridgefort intereor (bd2100.bcs):
    IF
    Global("BD_NEERA","BD2100",0) // Bridgefort Interior
    BeenInParty("neera") // Neera
    THEN
    RESPONSE #100
    MoveGlobal("BD2100","neera",[1715.1185]) // Neera
    ApplySpellRES("bdresurr","neera") // No such index
    SmallWait(1)
    ActionOverride("neera",Face(NW))
    ApplySpellRES("bdrejuve","neera") // No such index
    ChangeEnemyAlly("neera",NEUTRAL) // Neera
    ChangeSpecifics("neera",ALLIES) // Neera
    ActionOverride("neera",SetGlobal("bd_joined","locals",0))
    ActionOverride("neera",SetGlobal("bd_retreat","locals",0))
    ActionOverride("neera",SaveObjectLocation("LOCALS","bd_default_loc",Myself))
    ActionOverride("neera",ChangeAIScript("bdneera",OVERRIDE))
    ActionOverride("neera",ChangeAIScript("bdfort",CLASS))
    ActionOverride("neera",ChangeAIScript("bdshout",RACE))
    ActionOverride("neera",ChangeAIScript("bdmage01",GENERAL))
    ActionOverride("neera",ChangeAIScript("",DEFAULT))
    ActionOverride("neera",SetDialog("bdneera"))
    SetGlobal("BD_NEERA","BD2100",1) // Bridgefort Interior
    Continue()
    END

    IF
    Global("BD_NEERA","BD2100",0) // Bridgefort Interior
    !BeenInParty("neera") // Neera
    THEN
    RESPONSE #100
    CreateCreature("neera7",[1715.1185],NW) // Neera
    SetGlobal("SPRITE_IS_DEADNEERA","GLOBAL",0)
    ActionOverride("neera",MakeGlobalOverride())
    ChangeSpecifics("neera",ALLIES) // Neera
    ActionOverride("neera",ChangeAIScript("bdneera",OVERRIDE))
    ActionOverride("neera",ChangeAIScript("bdfort",CLASS))
    ActionOverride("neera",ChangeAIScript("bdshout",RACE))
    ActionOverride("neera",ChangeAIScript("bdmage01",GENERAL))
    ActionOverride("neera",ChangeAIScript("",DEFAULT))
    SetGlobal("BD_NEERA","BD2100",1) // Bridgefort Interior
    Continue()
    END
  • jasteyjastey Member Posts: 2,780
    EET, however, is another story. There they will stay dead, with an additional check against STATE_REALLY_DEAD status in the above script blocks.
  • DhariusDharius Member Posts: 665
    That sounds good...I'm not brilliant at scripting but it looks like they will come back alive but with the XP and items I left them with, as both of them were in the party...very interesting! Thanks!
  • jmerryjmerry Member Posts: 3,881
    Interpreting that scripting for folks that don't feel like reading the code...

    There are two possibilities for each NPC.
    - If they've ever been in the party, bring them over. Also cast a spell on them for a full heal and resurrection (if needed).
    - If they never joined the party at all, create the SoD version which starts with 64K XP and level-appropriate equipment.
  • jasteyjastey Member Posts: 2,780
    edited June 2023
    I need to elaborate on the topic a bit more thoroughly after looking at the spawn scripts of the camps in more detail.

    As far as I understand, visiting the NPCs Minsc, Dynaheir, Safana in their first area of appearance (Three Old Kegs / Elfsong Tavern) will revive them according to the above scripts.
    However, the script of the area in front of the Palace upon leaving for the crusade (bd0101.bcs) checks for a variable "BD_npcname_DIED_IN_BG" that was set before (via bdbaldur.bcs, probably in bd0103.bcs) if the NPC in question was in party in BG1. This means that they will not appear in front of the palace in this case.
    The camps' scripts however check whether the NPCs are "dead". This means, that if they were and you did not go to them in BG before leaving for the crusade, they will not get revived and they will not be there.

    I'm still a bit confused whether this is an oversight or whether I misunderstood the scripts. EDIT: I elaborated on this also here in the EE Fixpack forum.

    Example Safana. This is the script block in bdbaldur.bcs that sets the "BD_SAFANA_DIED_IN_BG" variable. It will not be executed in Korlasz' Tomb, but it should be after the transition to the palace room:
    IF
    Global("sprite_is_deadsafana","GLOBAL",1)
    StateCheck("safana",STATE_REALLY_DEAD) // Safana
    !InPartyAllowDead("safana") // Safana
    !AreaCheck("bd0120") // Tomb Safehouse, First Floor
    !AreaCheck("bd0130") // Tomb Safehouse, Second Floor
    Global("BD_SAFANA_DIED_IN_BG","GLOBAL",0)
    THEN
    RESPONSE #100
    SetGlobal("BD_SAFANA_DIED_IN_BG","GLOBAL",1)
    END

    The scripts for her resurrection without any checks whether she was dead in Elfsong Tavern I posted above.

    This is the script in bd0101, palace exterior before leaving for the crusade. Here her spawning gets prevented if the "BD_SAFANA_DIED_IN_BG" variable is not zero and she was in party in BG:
    IF
    Global("bd_safana_spawn","bd0101",0) // Ducal Palace, Leaving BG
    OR(2)
    InPartyAllowDead("safana") // Safana
    Global("BD_SAFANA_DIED_IN_BG","GLOBAL",0) //<- I believe this to be a bug, should be "1", but it has no consequence
    THEN
    RESPONSE #100
    SetGlobal("bd_safana_spawn","bd0101",1) // Ducal Palace, Leaving BG
    Continue()
    END

    IF
    Global("BD_SAFANA_DIED_IN_BG","GLOBAL",0)
    Global("bd_safana_spawn","bd0101",0) // Ducal Palace, Leaving BG
    BeenInParty("safana") // Safana
    !InPartyAllowDead("safana") // Safana
    THEN
    RESPONSE #100
    SetGlobal("bd_safana_spawn","bd0101",1) // Ducal Palace, Leaving BG
    MoveGlobal("BD0101","SAFANA",[904.645]) // Safana
    ApplySpellRES("bdresurr","SAFANA") // No such index
    SmallWait(1)
    ActionOverride("SAFANA",Face(W))
    ApplySpellRES("bdrejuve","SAFANA") // No such index
    ChangeEnemyAlly("SAFANA",NEUTRAL) // Safana
    ChangeSpecifics("SAFANA",ALLIES) // Safana
    ActionOverride("SAFANA",SetGlobal("bd_joined","locals",0))
    ActionOverride("SAFANA",SetGlobal("bd_retreat","locals",0))
    ActionOverride("SAFANA",SaveObjectLocation("LOCALS","bd_default_loc",Myself))
    ActionOverride("SAFANA",ChangeAIScript("BDSAFANA",OVERRIDE))
    ActionOverride("SAFANA",ChangeAIScript("",CLASS))
    ActionOverride("SAFANA",ChangeAIScript("BDSHOUT",RACE))
    ActionOverride("SAFANA",ChangeAIScript("BDTHIE01",GENERAL))
    ActionOverride("SAFANA",ChangeAIScript("",DEFAULT))
    ActionOverride("SAFANA",SetDialog("BDSAFANA"))
    Continue()
    END

    IF
    Global("bd_safana_spawn","bd0101",0) // Ducal Palace, Leaving BG
    !BeenInParty("safana") // Safana
    !InPartyAllowDead("safana") // Safana
    THEN
    RESPONSE #100
    SetGlobal("bd_safana_spawn","bd0101",1) // Ducal Palace, Leaving BG
    SetGlobal("SPRITE_IS_DEADSAFANA","GLOBAL",0)
    CreateCreature("safana7",[904.645],W) // Safana
    ActionOverride("safana",MakeGlobalOverride())
    ChangeSpecifics("SAFANA",ALLIES) // Safana
    ActionOverride("SAFANA",ChangeAIScript("BDSAFANA",OVERRIDE))
    ActionOverride("SAFANA",ChangeAIScript("",CLASS))
    ActionOverride("SAFANA",ChangeAIScript("BDSHOUT",RACE))
    ActionOverride("SAFANA",ChangeAIScript("BDTHIE01",GENERAL))
    ActionOverride("SAFANA",ChangeAIScript("",DEFAULT))
    Continue()
    END

    This is the moving to the first camp in bd1000. The script blocks check whether she is dead with the normal "!Dead()" checks:
    IF
    Global("bd_move_safana","bd1000",0) // Coast Way Crossing
    !Dead("safana") // Safana
    !InPartyAllowDead("safana") // Safana
    THEN
    RESPONSE #100
    SetGlobal("bd_move_safana","bd1000",1) // Coast Way Crossing
    MoveGlobal("bd1000","SAFANA",[280.3480]) // Safana
    ActionOverride("SAFANA",Face(SW))
    ApplySpellRES("bdrejuve","SAFANA") // No such index
    ChangeEnemyAlly("SAFANA",NEUTRAL) // Safana
    ChangeSpecifics("SAFANA",ALLIES) // Safana
    ActionOverride("SAFANA",SetGlobal("bd_joined","locals",0))
    ActionOverride("SAFANA",SetGlobal("bd_retreat","locals",0))
    ActionOverride("SAFANA",SaveObjectLocation("LOCALS","bd_default_loc",Myself))
    ActionOverride("SAFANA",ChangeAIScript("BDSAFANA",OVERRIDE))
    ActionOverride("SAFANA",ChangeAIScript("bdasc3",CLASS))
    ActionOverride("SAFANA",ChangeAIScript("BDSHOUT",RACE))
    ActionOverride("SAFANA",ChangeAIScript("BDTHIE01",GENERAL))
    ActionOverride("SAFANA",ChangeAIScript("",DEFAULT))
    ActionOverride("SAFANA",SetDialog("BDSAFANA"))
    Continue()
    END
  • DhariusDharius Member Posts: 665
    edited June 2023
    OK...this sounds a bit more complicated then...

    Also there is this possibility: met Dorn just before Nashkel Mines but killed him without letting him into the party at all..does he appear in SoD (imprisoned near Bridgefort) as a result of this? Or does this definition fall under "died in BG"?

    It might just be me but I'm not sure that the logic around whether an npc is revived or not in SoD is very coherent at the moment? Do the nature of the checks depend on the npc in question and/or location of the check?
  • jmerryjmerry Member Posts: 3,881
    edited June 2023
    Checking scripts ...
    IF
    	Global("bd_dorn_spawn","bd2000",0)  // Boareskyr Bridge & Bridgefort
    	!BeenInParty("dorn")  // Dorn
    THEN
    	RESPONSE #100
    		SetGlobal("bd_dorn_spawn","bd2000",1)  // Boareskyr Bridge & Bridgefort
    		CreateCreature("dorn7",[1545.3215],E)  // Dorn
    		ActionOverride("dorn",MakeGlobalOverride())
    		ChangeSpecifics("dorn",NEUTRALS)  // Dorn
    		ActionOverride("dorn",ChangeAIScript("bddorn",OVERRIDE))
    		ActionOverride("dorn",ChangeAIScript("",CLASS))
    		ActionOverride("dorn",ChangeAIScript("bdshout",RACE))
    		ActionOverride("dorn",ChangeAIScript("bdpal01",GENERAL))
    		ActionOverride("dorn",ChangeAIScript("",DEFAULT))
    		ActionOverride("dorn_chest",TakeCreatureItems("dorn",ALL))  // Dorn
    		Continue()
    END
    
    (That's from the area script bd2000.bcs)

    If Dorn has never been in the party at all, the game doesn't check whether he died or not. It just creates a new copy of him - in his 64K XP SoD version.
  • DhariusDharius Member Posts: 665
    Thanks jmerry. This arrangement of whether or not npcs are revived is very interesting and I guess there was no perfect way of programming this for the transition from BGEE to SOD...without checking the scripts each time it may cause some unexpected results on a playthrough but it is what it is!
Sign In or Register to comment.