Object Functions

From ADRIFT 5 Manual Wiki
Jump to: navigation, search

The item functions for objects can be used to obtain the value of any text or integer property of the object, or to obtain a list of objects or characters that are inside of a container or on top of a supporter object.

Selecting the Object

These functions can be used with a specific object, or with any function or reference that returns an object key:

  • In a task containing an %object% reference, using the reference will apply the object function to the object that the player entered in the command.
  • A specific object can be selected by using its key. eg. "Object12.Name"
  • A location or character function can be used to obtain an object key, and the object function appended to it. eg "Character3.CharInsideWhat.Name" will print the name of the object inside which Character3 is currently located.

Selecting the Function

The available functions can be listed by typing a dot (full-stop ".") immediately after the object reference "%object%", an object key, or a function that returns an object key, in either a text box or an expression.

FunctionsObject.jpg

Scroll down to the wanted property and click on it to insert the property key into the function.

  • Note that properties that are not relevant to a particular object will be omitted from the list.
  • Properties that you create and add to objects will be added to this list.
  • If you type part of the name of the property then the list will be reduced to show only those that match.
  • Instead of clicking with the mouse you can type enough of the properties name to bring it to the top of the list and press enter or tab.

Standard Functions

IconLocation.jpg Location properties

  • At location (AtLocation) - Displays the KEY of a static objects location. Entering another dot after this will access the properties of that location
  • In location (InLocation) - Displays the KEY of a dynamic objects location.

IconCharacters.jpg Character properties

  • Held by who (HeldByWho) - Key of character that this object is being held by (Dynamic objects only)
  • Part of who (PartOfWho) - Key of character that this object is a part of (Face, hands, nose etc.)
  • Worn by who (WornByWho) - Key of character that this object is being worn by (Wearable objects only)

IconText.jpg Text properties

  • ...and description when read (ReadText) - Used for books and signs that we want to be readable
  • Description (Description) - The text box that describes the object
  • Location of the object (DynamicLocation) - The name of the current location of a dynamic object
  • Location of the object (StaticLocation) - The name of the location of a static object
  • Locked status (LockStatus) - Can the object be locked
  • Open status (OpenStatus) - Open, Closed or Locked
  • Object name (Name) - The name of the object
  • ObjectType (StaticOrDynamic) - Static or Dynamic
  • When the object is listed in location, display this (ListDescriptionDynamic) - Text to describe dynamic object in a location
  • When the object is listed in location, display this (ListDescription) - Text used to describe static object in a location description

IconInteger.jpg Integer properties

  • ...and the container can hold (Capacity) - How many tiny objects can fit in this object (Containers only)
  • ...and the surface can hold (SurfaceHold) - How many tiny objects can fit on top of this object (Supporters only)
  • Object size (Size) - How big is this object
  • Object weight (Weight) - How heavy is this object

IconInteger.jpg Boolean properties (returns 1 if the property is selected, 0 if not)

IconGroup.jpg Group properties

  • At Location group (AtLocationGroup) - The location group that a static object occupies
  • Children (Children) - List keys of objects and characters on top of this supporter object
    • %object%.Children.Count - Number of items on and in this object
    • %object%.Children.List - List items on and in this object
    • %object%.Children(Objects,In) - Keys of objects inside this object, add .Count for quantity, .List to list object names.
    • %object%.Children(Objects,On) - Keys of objects on top of this object, add .Count for quantity, .List to list object names.
    • %object%.Children(Characters,In) - Keys of Characters inside this object, add .Count for quantity, .List to list Character names.
    • %object%.Children(Characters,On) - Keys of Characters on this object, add .Count for quantity, .List to list Character names.
  • Contents (Contents) - Keys of objects and characters inside this container object
    • %object%.Contents.List - List of objects and characters inside this container object
    • %object%.Contents.Count - Number of items inside this object
    • %object%.Contents(Objects) - Keys of Objects inside this object
    • %object%.Contents(Objects).List - List of Objects inside this object
    • %object%.Contents(Objects).Count - Number of objects in this object
    • %object%.Contents(Characters) - Keys of Characters inside this object
    • %object%.Contents(Characters).List - List of Characters inside this object
    • %object%.Contents(Characters).Count - Number of Characters in this object

IconDynamicObject.jpg Object properties

  • Inside what? (InsideWhat) - The key of the container object that the object is inside of
  • Key for lock (LockKey) - The key of the object that is used as a key to unlock this object
  • On what? (OnWhat) - The object that this object is sitting on top of
  • Parent (Parent) - The location, character or object that is directly holding this object
  • Part of what? (PartOfWhat) - The object or character that this object is a part of

User Properties

  • If you create a new object property then a new function for accessing that property will be added to the list of functions for objects.
The list will display the name of the property, but its key will be used in the function, so something like "%object%.Property12" will be entered into the text box.
  • If you load a special-purpose library, then that library may add extra object properties/functions.
These functions will usually consist of a property key with a library prefix, so for a battle library it might be: "%object%.battleProperty6"


<<< Character ParentItem functionsAtLocation >>>