- 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.
- 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.
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.
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.
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:
- This example obtains the current location of the character who's key is Character4, then prints the short location description of that location.
- 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.
- 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.
- 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 functions||Character Functions||Location >>>|