Skip to content

Use "ENDOFBG1" variable for SoD detection ingame

jasteyjastey Member Posts: 2,782
When transitioning from end of BG1 to SoD campaign, the variable Global("ENDOFBG1","GLOBAL",2) will be set via bdsodtrn.bcs.

So far, I thought I could use this variable to detect ingame whether the game is in SoD or still in BG1.
But, this variable is only set during the transition. Meaning, it is not set if a new SoD game is started.

(Leaving the discussion out of here why the value "2" was used here whereas BGT was using "2" for BGII for years - )

What do you do to detect whether your NPC / mod is in SoD or still in BG1?

Do you see any problems arising if my mod sets Global("ENDOFBG1","GLOBAL",2) at the beginning of Korlasz's tomb for a new SoD game (in BG:EE, not EET) or should I use a different variable altogether?

Comments

  • argent77argent77 Member Posts: 3,479
    How about this check: !Global("BD_PLOT","GLOBAL",0)?

    Chapter check doesn't work, since SoD prolog still counts as chapter 7. And as you mentioned "ENDOFBG1" isn't set in all cases. However, "BD_PLOT" is used to track the progress of SoD. It should not be set in BG1 at all. For EET you'll probably have to add another check to account for transition into BG2 campaign.
  • jasteyjastey Member Posts: 2,782
    Excellent suggestion! This solves all my problems and eliminates my worries about possible compatibility problems.
    I am using these check variables with OUTER_SPRINT definitions anyway since I am providing for BGT, BG:EE(SoD) and EET, with EET using the "ENDOGBG1" variable in a disctinct way, so BGII checks in EET are covered independent of whether I use this variable for SoD-standalone.
    Thank you!
  • jasteyjastey Member Posts: 2,782
    Just for update: in my own mods, I am using "GlobalGT("bd_plot","global",40)" for checking for SoD and am treating Korlasz' Tomb as BG1 content (regarding script and dialogue names). This works just as well and it ensures compatibility with EndlessBG1's and Transitions tweaks to move Korlasz' Tomb into the BG1 campaign without any further need of compatibility code.
Sign In or Register to comment.