Jump to content

[Scripting] Using LOCALS in non-sprite triggers


argent77

Recommended Posts

There are several instances where variables in the LOCALS scope are used in scripts assigned to map regions, containers and doors (not counting those in ActionOverride/TriggerOverride). Since LOCALS don't work correctly in these cases (ie. always return false), it would be a good idea to check whether they are causing scripting issues. Otherwise, they could be safely removed.

I have found the following scripts so far:

IWDEE:
EETPLDOR.BCS (door script)
D4DOORT.BCS (door script)
D4DOORG.BCS (door script)
D4GELDOR.BCS (door script)
D5DOOR.BCS (door script)
D5YXUDOR.BCS (door script)
5104D3.BCS (door script)
UDTRAP1.BCS (region script)
WTBRIDGE.BCS (region script)
LDEYETP1.BCS (region script)
LDEYETP2.BCS (region script)
LDBDGOPN.BCS (door script)

BGEE:
BDMENHI1.BCS (region script)
BDMENHI4.BCS (region script)
NETRIG1.BCS (region script)

BG2EE:
OHBPOT.BCS (container script)

PSTEE:
1204TRIG.BCS (region script)

Edited by argent77
Updated script list
Link to comment
On 8/16/2022 at 7:27 PM, argent77 said:

Since LOCALS don't work correctly in these cases (ie. always return false), it would be a good idea to check whether they are causing scripting issues. Otherwise, they could be safely removed.

A safer option would be to promote everything to the MYAREA scope (provided there are no name collisions.)

Link to comment

Fixed in two commits, here and here. Running notes as I do these:

IWDEE

  • EETPLDOR.BCS (door script) - would remain true infinitely, but harmless as it was only one block of script. Converted to MYAREA.
  • D4DOORT.BCS, D4DOORG.BCS, D4GELDOR.BCS (door scripts) - Scripts to open the doors in the Eldathyn section (level 4 of Dragon's Eye). Once the alarm was sounded, the scripts would open these doors instantly if closed. Scripts amended; door opening handled by area script.
  • D5DOOR.BCS, D5YXUDOR.BCS (door script) - Scripts to open doors once Yxunomei attacks. Like the Eldathyn area, these doors would open instantly if closed after she attacked, and is also handled by the area script. D5YXUDOR.BCS was previously fixed as part of this.
  • 5104D3.BCS (door script) - should open a door five seconds after entry, but door was opening instantly. LOCALS timer converted to MYAREA.
  • UDTRAP1.BCS (region script) - Harmless; would infinitely loop trying to set a variable. Converted to MYAREA
  • WTBRIDGE.BCS (region script) - Warning about broken bridge at aquarium; should only fire once per area visit/reload, but fired every time the region was entered
  • LDEYETP1.BCS (region script), LDEYETP2.BCS (region script) - Petrification traps in Malavon's lair that should only fire once, but would fire infinitely
  • LDBDGOPN.BCS (door script) - would infinitely loop opening itself; changed to MYAREA

BGEE

  • BDMENHI1.BCS, BDMENHI4.BCS (region script) - Fixed already as part of the Menhir quest fixes
  • NETRIG1.BCS (region script) - Non-working check of a non-existent variable for dialogue prompt; converted to check for valid dialogue conditions instead

BG2EE

  • OHBPOT.BCS (container script) - Wasn't working, and disabled by EEFP. The pots were supposed to hand out an item for cooking myconid, but this is handled via dialogue elsewhere (and the item being rewarded via this script is a placeholder).

PSTEE:

  • 1204TRIG.BCS (region script) - Was trying to set a debug LOCALS var. Removed.
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...