Difference between revisions of "%object%.LockStatus function"

From ADRIFT 5 Manual Wiki
Jump to: navigation, search
(Created page with " <TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER><<< StaticLocation</TD><TD WIDTH="34%" ALIGN=CENTER>[[Obj...")
 
m (How to use)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
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.
  
 +
[[File: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 [[Boolean_functions#Lockable|%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 ==
 +
*<span style="color:red">Character7</span>.LockStatus
 +
: Prints the word "Locked" if the object with the [[key]] "Character7" can be locked.
  
 
+
*<span style="color:green">%object%</span>.LockStatus
 
+
: Prints the word "Locked" if the referenced object, in a task with an %object% reference, can be locked.
 
+
 
+
  
  
 
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[%object%.StaticLocation function|<<< StaticLocation]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Object Functions]]</TD><TD ALIGN=CENTER>[[%object%.OpenStatus function|OpenStatus >>>]]</TD></TABLE>
 
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[%object%.StaticLocation function|<<< StaticLocation]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Object Functions]]</TD><TD ALIGN=CENTER>[[%object%.OpenStatus function|OpenStatus >>>]]</TD></TABLE>
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 02:31, 25 December 2013

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