%character%.CharacterAtLocation function

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

This function returns the contents of the "At which Location property", which is the key of the location at which the selected character is currently located.

Requirements

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

RestrictionLocationOfChar.jpg

  • To obtain the key of a characters location regardless of whether they are inside or on top of an object or another character, use the %character%.Location function instead.

Properties

When the "Location of the character" property is is set to "At Location", the "At Which Location" property of the character displays the short description of the location. Setting "At Which Location" determines which location will be returned by the CharacterAtLocation function.

PropertyAtLocation.jpg

How to use

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

Any of the Location Functions can be appended to the CharacterAtLocation function to display a property of the location of a character.

Examples

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

  • Character4.CharacterAtLocation.ShortLocationDescription
This example obtains the current location of the character who's key is Character4, then prints the short location description of that location.
  • %AloneWithChar%.CharacterAtLocation.LongLocationDescription
If there is only one other character at the same location as the player character, then this will print the long description of that location.
  • %ConvCharacter%.CharacterAtLocation.Exits.List
If the player is currently in conversation with another character, then this functions will list all of the available exits from that characters current location.
  • %object%.Parent.CharacterAtLocation.Objects.List
In a task with an %object% reference, this function first finds the parent (location of) the referenced object. The object must be being held by a character for the CharacterAtLocation to work. The Objects.List function then lists all of the objects at this location.


<<< Item functionsCharacter FunctionsLocation >>>