Jump to content

variables for starting EET in different campaigns


Recommended Posts

Posted (edited)

Anyone know if I can detect whether someone has started an EET game directly in the SoA campaign, versus continuing or importing from BG1 and/or SoD?

I specifically want to find out whether a character did not play SoD. So two conditions should be identified and excluded:

  1. character came through SoD and into BG2
  2. character played some/all of SoD, then was exported, and is now imported into BG2.

If a global variable is set in, say, the Coast Way Crossing, and the player is exported, would that variable be preserved with the import into the BG2 campaign?

(In which case I could just add my own variable, if no convenient one can be found.)

EDIT - if GVs are preserved across export/import, I suppose I could look for something like

GlobalLT("bd_plot","global",101)

 

Edited by subtledoctor
Posted

Global variables are not preserved across export/import unless specifically called out; VARIMPRT.2DA is the list. And here's its contents in unmodified BG2EE:

2DA V1.0
NONE
           VARIABLENAME   
1          NEERA_ROMANCE  
2          DORN_ROMANCE_2 
3          RASAAD_ROMANCE 
4          BD_HAVE_SOD   

You could use BD_HAVE_SOD, but then you'd get a false positive if the player had the campaign but skipped it. Or you could add bd_plot to the 2DA and use that.

Posted
1 hour ago, jmerry said:

You could use BD_HAVE_SOD, but then you'd get a false positive if the player had the campaign but skipped it.

That should work. I don't think false positives are a concern in this instance. Thx!

Posted

Actually, on closer examination, I don't think it results in false positives at all. bdbaldur.bcs sets bd_have_sod to 1 as soon as it runs, and it runs whenever you're in the SoD campaign. No other appearances of the variable in BGEE. That variable simply checks whether this run spent any time at all in SoD.

Posted (edited)

Yup! So I can just add this to a BG2 script:

IF
	Global("my_skip_var","GLOBAL",0)
	Global("BD_HAVE_SOD","GLOBAL",0)
THEN
	Response #100
	SetGlobal("my_skip_var","GLOBAL",1)
	Continue()
END

...and then all my stuff later on can just check for my skip_SoD variable.

(Yes, I could cut that out and probably just use the built-in variable... but all the stuff was already written to check for my variable, and this leaves flexibility to add/change the conditions in the future.)

Edited by subtledoctor

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