%object%.LockStatus function

From ADRIFT 5 Manual Wiki
(Redirected from LockStatus)
Jump to: navigation, search

The LockStatus function returns the single word "Locked" if the object has the property "Object can be locked".

Properties

The "Object can be locked" property is only available if the "Object can be open and closed" property has been selected. Selecting the "Object can be locked" property changes the "Open status" property from two radio-buttons marked "Open" and "Closed", to a drop-down list with the third option "Locked".

The "Key for Lock" property also becomes available. This property must be set to a dynamic object that will be used as the key to unlock this object.

PropertyObjectLockable.jpg

How to use

This function simply returns the word "Locked" if the object is lockable, and does nothing if the object can't be locked. No further functions can be appended to it.

To print the actual state of the object, whether it is "Open", "Closed" or "Locked", use the %object%.OpenStatus function instead.

If you need to test whether an object can be locked in an expression, then use the %object%.Lockable function instead. It returns 0 if the object can't be locked and 1 if it can be, so you could use this in an expression like this:

IF( Door.Lockable=1, "It has a keyhole", "There is no way to lock this door" )

Examples

  • Character7.LockStatus
Prints the word "Locked" if the object with the key "Character7" can be locked.
  • %object%.LockStatus
Prints the word "Locked" if the referenced object, in a task with an %object% reference, can be locked.


<<< StaticLocationObject FunctionsOpenStatus >>>