Difference between revisions of "%character%.CharacterAtLocation function"

From ADRIFT 5 Manual Wiki
Jump to: navigation, search
(example descriptions)
m (grammer)
Line 13: Line 13:
  
 
== How to use ==
 
== How to use ==
The CharacterAtLocation obtains the [[key]] of the location.
+
CharacterAtLocation obtains the [[key]] of the location.
 
To display the name of the location, append the [[%location%.ShortLocationDescription function|"ShortLocationDescription" function]] to this function. ie. "%character%.CharacterAtLocation.ShortLocationDescription".
 
To display the name of the location, append the [[%location%.ShortLocationDescription function|"ShortLocationDescription" function]] to this function. ie. "%character%.CharacterAtLocation.ShortLocationDescription".
  

Revision as of 01:55, 11 December 2012

This function returns 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

Properties

When the "Location of the character" property is selected, 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.


<<< Object-oriented functionsCharacter FunctionsCharOnWho >>>