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

From ADRIFT 5 Manual Wiki
Jump to: navigation, search
m (Examples)
m (Link)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
This function returns the [[key]] of the [[Locations|location]] at which the selected character is currently located.  
+
This function returns the contents of the "At which Location property", which is the [[key]] of the [[Locations|location]] at which the selected character is currently located.
  
 
== Requirements ==
 
== Requirements ==
*This function will not work if the character is on or inside an object, on another character, or is hidden.
+
* 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 [[Tasks|task]] or an [[Alternate Descriptions|alternate description]] to ensure that it is.
+
: If you cannot be certain that the character is at a location, then you must use the following restriction in the [[Tasks|task]] or an [[Alternate Descriptions|alternate description]] to ensure that it is.
 
[[File:RestrictionLocationOfChar.jpg]]
 
[[File: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 ==
 
== 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.
+
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.
 
Setting "At Which Location" determines which location will be returned by the CharacterAtLocation function.
  
Line 20: Line 22:
 
== Examples ==
 
== 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:
 
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:
*<span style="color:red">Character4</span>.CharacterAtLocation.ShortLocationDescription
+
* <span style="color:red">Character4</span>.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.
+
: This example obtains the current location of the character who's [[key]] is Character4, then prints the short location description of that location.
  
*<span style="color:blue">%AloneWithChar%</span>.CharacterAtLocation.LongLocationDescription
+
* <span style="color:blue">%AloneWithChar%</span>.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.
+
: 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.
  
*<span style="color:blue">%ConvCharacter%</span>.CharacterAtLocation.Exits.List
+
* <span style="color:blue">%ConvCharacter%</span>.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.
+
: 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.
  
*<span style="color:green">%object%</span>.Parent.CharacterAtLocation.Objects.List
+
* <span style="color:green">%object%</span>.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.
+
: 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.
  
  
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[Object-oriented functions|<<< Object-oriented functions]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Character Functions]]</TD><TD ALIGN=CENTER>[[%character%.CharOnWho function|CharOnWho >>>]]</TD></TABLE>
+
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[Item functions|<<< Item functions]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Character Functions]]</TD><TD ALIGN=CENTER>[[%character%.Location function|Location >>>]]</TD></TABLE>
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 06:42, 4 March 2013

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 >>>