Jump to content

are local variables reliable?


subtledoctor

Recommended Posts

If I apply a local variable to a character, will it stick permanently, even after death, through an entire EET campaign with 3 or more campaigns? Would it stick if I exported a character, or imported one from a savegame?

Would it be better to apply it via opcode 187 with timing mode 9, versus directly setting the variable in a dialogue? Or would that make no difference?

Example use case: I want players to choose Bhaal powers instead of getting them based on alignment or reputation. My dialogue asks:

Quote

Which do you choose?

  • Cure Light Wounds
  • Larloch's Minor Drain
  • Cure Poison
  • +1 bonus to Wisdom

Some time later,  I want to trigger the same dialogue, but I want to exclude the ability that has already been chosen. I want to keep track of what's been chosen. Say this is for Imoen, so it needs to work whether she leaves and rejoins the party, dies and is resurrected, etc.

EDIT - actually I think I would prefer to apply it via op187. That way I could set up a spell with op171 to give the ability and op187 to set the variable, and where appropriate I could apply the spell, for example, via a kit ability table. Question is how bulletproof would that be.

Edited by subtledoctor
Link to comment

Transferring from one campaign to the next, e.g. BGEE to SoD, or SoA to ToB is seamless, and the LOCALS will be preserved. This is also true for all of EET AFAIK.

Game-to-game is trickier, as IIRC no variables survive an export/import. For save games, some global variables do get preserved; specifically, the variables listed in varimprt.2da get transferred into BG2EE from BGEE save games.

Link to comment

It looks like LOCALS survive export. There's a bug though - if you:

  1. Set a LOCALS on a creature
  2. Don't save the game since the LOCALS was set
  3. Export the character

=> The LOCALS is not saved on the exported character.

Using op187 directly with timing mode 9, special=1 will probably work.

Link to comment

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