Difference between revisions of "Location Functions"
From ADRIFT 5 Manual Wiki
(Exits) |
m (Exits) |
||
Line 25: | Line 25: | ||
:<font color="green">%location%</font>.Characters.count - The number of characters at this location | :<font color="green">%location%</font>.Characters.count - The number of characters at this location | ||
*[[%location%.Exits function|Exits]] - The directions that the player can move from this location | *[[%location%.Exits function|Exits]] - The directions that the player can move from this location | ||
− | :<font color="green">%location%</font>.Exits - | + | :<font color="green">%location%</font>.Exits - Returns the %direction% references of all exits from this location (including those blocked by a restriction) |
:<font color="green">%location%</font>.Exits.List - List all exits from this location (including those blocked by a restriction). Use the %ListExits[<font color="green">%character%</font>]% function to list available exits that a particular character may use from their current location. | :<font color="green">%location%</font>.Exits.List - List all exits from this location (including those blocked by a restriction). Use the %ListExits[<font color="green">%character%</font>]% function to list available exits that a particular character may use from their current location. | ||
:<font color="green">%location%</font>.Exits.Count - The total number of exits from this location | :<font color="green">%location%</font>.Exits.Count - The total number of exits from this location |
Revision as of 04:20, 16 March 2017
The item functions for locations can be used to obtain the value of any text or integer property of the location, or the list of exits from the location.
Selecting the Location
These functions can be used with a specific location, or with any function or reference that returns a location key:
- In a task containing a %location% reference, using the reference will apply the location function to the location that the player entered in the command.
- A specific location can be selected by using its key. eg. "Location12.Name"
- A character or object function can be used to obtain a location key, and the location function appended to it. eg "Character3.AtWhichLocation.Name" will print the name of the location at which Character3 is currently located.
Selecting the Function
The properties of locations can be listed by typing a dot (full-stop ".") immediately after the location reference "%location%", a location key, or a function that returns a location key, in a text box or expression.
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 location will be ommited from the list.
- Properties that you create for locations 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
- %location%.Characters.list - Lists the characters at this location
- %location%.Characters.count - The number of characters at this location
- Exits - The directions that the player can move from this location
- %location%.Exits - Returns the %direction% references of all exits from this location (including those blocked by a restriction)
- %location%.Exits.List - List all exits from this location (including those blocked by a restriction). Use the %ListExits[%character%]% function to list available exits that a particular character may use from their current location.
- %location%.Exits.Count - The total number of exits from this location
- NOTE: The Objects list only includes objects that are set to be listed in location descriptions.
- Static objects will only be listed if they have "Specifically list object in location descriptions" ticked.
- Dynamic objects will only be listed if "Specifically exclude object from location description" is NOT ticked.
- %location%.Objects.list - Lists the visible objects at this location
- %location%.Objects.count - The number of visible objects at this location
- Long Location Description - The full description of the location
- %location%.LongLocationDescription
- Short Location Description - The name of the location
- %location%.ShortLocationDescription
- LocationTo(direction) - The key of the location in a specified direction from referenced location
- %location%.LocationTo(%direction%) - The location in the referenced direction
- %location%.LocationTo(NorthWest) - The location to the north-west from this location
User Properties
- If you create a new location property then a new function for accessing that property will be added to the list of functions for locations.
- The list will display the name of the property, but its key will be used in the function, so something like "%location%.Property12" will be entered into the text box.
- If you load a special-purpose library, then that library may add extra location properties/functions.
- These functions will usually consist of a property key with a library prefix, so for a battle library it might be: "%location%.battleProperty6"
<<< Object PartOfWhat | Item functions | Exits >>> |