GetOpenKey

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

A command for Oblivion Script Extender

Syntax:

(key:ref) reference.GetOpenKey

Returns the key used to unlock the calling reference.

Example

ref pDoor
ref pKey
...
set pDoor to DoorRef
set pKey to pDoor.GetOpenKey
if (pKey == 0)
  set pDoor to pDoor.GetLinkedDoor
  if pDoor
    set pKey to pDoor.GetOpenKey
  endif
endif
if pKey
...

Checks DoorRef and its linked door for the key.

Notes[edit | edit source]

  • The bug was fixed with v0013a. Make sure to use the latest version.
    • This function has a bug in v0013 that causes CTDs in interior spaces.
  • The key reference is only set on one side of the door. If a reference isn't returned, then check its linked door with
ref pDoor
ref pKey
;DoorRef is a Reference Editor ID of a door
...
set pDoor to DoorRef.GetLinkedDoor
set pKey to pDoor.GetOpenKey

See Also[edit | edit source]