Difference between revisions of "GetOpenState - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Jlundin
 
imported>Pickysaurus
(Added discovery about function)
 
Line 29: Line 29:
endIf
endIf
</source>
</source>
== Notes ==
*Will return even on doors with no animations, but doesn't work on AutoLoadDoors (cave entrances).


== See Also ==
== See Also ==
*[[ObjectReference Script]]
*[[ObjectReference Script]]
*[[SetOpen - ObjectReference]]
*[[SetOpen - ObjectReference]]

Latest revision as of 18:19, 5 February 2018

Member of: ObjectReference Script

Obtains this object's current "open state".

Syntax[edit | edit source]

int Function GetOpenState() native

Parameters[edit | edit source]

None

Return Value[edit | edit source]

The current "open state" of the object. Will be one of the following:

  • 0: None (object can't be opened or closed)
  • 1: Open
  • 2: Opening
  • 3: Closed
  • 4: Closing

Examples[edit | edit source]

; Is this door open or opening?
int openState = JailDoor.GetOpenState()
if (openState == 1 || openState == 2) ; Open or opening
  Debug.Trace("Door is open!")
endIf

Notes[edit | edit source]

  • Will return even on doors with no animations, but doesn't work on AutoLoadDoors (cave entrances).

See Also[edit | edit source]