%object%.InLocation function

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

This function returns the key of the location at which the selected dynamic object is currenly located.

Requirements

  • This function will not work for static objects, or if the object is in or on another object, is held or worn by a character, or if it is hidden.
If you cannot be certain that the object is in a location, then you must use the following restriction in the task or an alternate description to ensure that it is.

RestrictionObjectInLocation.jpg

Properties

The initial location of the object is set using two drop-down lists on the description page. The first list sets the "Location of the object" property, and setting this determines which property will be set by the second list. When the "Location of the object" property is set to "In Location", the "In Location" property will become available. Setting "In Location" determines which location will be returned by the InLocation function.

PropertyInLocation.jpg

How to use

InLocation obtains the key of the location. To display the name of the location, append the "ShortLocationDescription" function to this function. ie. "%object%.InLocation.ShortLocationDescription".

Any of the Location Functions can be appended to the InLocation function to display a property of the location of an object.

The location key returned by this function can be compared to another location key in a restriction, or be used to move another item to this location with an action

In a text box you would use this function to obtain the location of an object so that you can then display one of the properties of that location. When you enter another full-stop after this function, you will be shown a list of the Location Functions that can be used with it.

Examples

As well as the %object% reference, you can use the key of an object, or any function that returns the key of a dynamic object, with this function:

  • Object4.InLocation.ShortLocationDescription
This example obtains the current location of the object who's key is Object4, then prints the short location description of that location.
  • %object%.Parent.InLocation.Objects.List
In a task with an %object% reference, this function first finds the parent (location of) the referenced object. The object must be be in or on a dynamic object for the InLocation function to work. The Objects.List function then lists all of the objects at this location.


<<< AtLocationObject FunctionsHeldByWho >>>