Difference between revisions of "General item functions"
m (links) |
m (moved Obsolete general functions to General item functions: These functions could be useful for library customisation, especially language translations) |
(No difference)
|
Revision as of 04:04, 25 December 2013
These are general functions which were used in previous versions of ADRIFT which have now been replaced with Item functions.
For backward compatibility with older games these functions still work, but the Item functions are often shorter and offer extra functionality so they should be used instead.
Contents
- 1 CharacterDescriptor Function
- 2 CharacterProper Function
- 3 DisplayCharacter Function
- 4 DisplayLocation Function
- 5 DisplayObject Function
- 6 ListCharactersIn Function
- 7 ListCharactersOn Function
- 8 ListCharactersOnAndIn Function
- 9 ListHeld Function
- 10 ListExits Function
- 11 ListObjectsAtLocation Function
- 12 ListWorn Function
- 13 LocationName Function
- 14 LocationOf Function
- 15 ParentOf Function
- 16 PropertyValue Function
- 17 TheObject/TheObjects Function
CharacterDescriptor Function
Returns the full descriptor (including article and prefix) of the character. ADRIFT will need to determine whether the article should be replaced with "the". A "Bad Function" error will occur in Runner if this function is used on a character that does not have a descriptor. If the point of view of the player character is switched to another character which does not have a descriptor then this function will return "me" or "myself", but only if they are unaltered in the descriptor field of the character with the blue icon named "Player".
Syntax
%CharacterDescriptor[key]%
Parameters
- key - The key of the character you wish to display the name of.
Equivalent item function
Key.Descriptor
CharacterProper Function
Returns the proper name of a particular character. For the default player character, and any character with a blank proper name field, it will return "Anonymous".
NB. Available from version 5.0.17.
Syntax
%CharacterProper[key]%
Parameters
- key - The key of the character you wish to display the name of.
Equivalent item function
Key.ProperName
DisplayCharacter Function
Displays the description of a particular character
Syntax
%DisplayCharacter[key]%
Parameters
- key - The key of the character you wish to display the description for.
Equivalent item function
Key.Description
DisplayLocation Function
Displays the description of a particular Location.
If "Display the short location name when viewing descriptions" is selected in the runner options, then the first thing displayed will be the short description of the location. It will be in boldface.
Next will be the long description of the location, possibly modified by alternate descriptions.
Static objects with "Specifically list objects in location description" selected, and dynamic objects, will then be listed. Objects with a specific "When the object is listed in location, display this" description, will be shown after the listed objects. All dynamic objects will be shown after all static objects (5.0.22 and later).
Characters at the location are then listed, those with specific "What to show when the character is at location" descriptions after the list of other characters.
- This function does not currently show characters or objects that are sitting or laying on another object.
Syntax
%DisplayLocation[key]%
Parameters
- key - The key of the location you wish to display the description for.
Equivalent item function
Key.Location.Description
DisplayObject Function
Displays the description of a particular object.
Syntax
%DisplayObject[key]%
Parameters
- key - The key of the object you wish to display the description for.
Equivalent item function
Key.Description
ListCharactersIn Function
Lists all the characters inside a particular object.
Syntax
%ListCharactersIn[key]%
Parameters
- key - The key of the object you wish to list the characters that are inside of.
Equivalent item function
Key.Contents(Characters).List
ListCharactersOn Function
Lists all the characters sitting, laying or standing on top of a particular object. Example output: "Harry, Fred and George"
Syntax
%ListCharactersOn[key]%
Parameters
- key - The key of the object you wish to list the characters that are on top of.
Equivalent item function
Key.Contents(Characters, On).List
ListCharactersOnAndIn Function
Lists all the characters on and inside a particular object. This is basically the same as ListCharactersOn and ListCharactersIn, but it also formats the output into a complete sentence. Example output: "Harry and fred are on the box, and George are inside the box"
Syntax
%ListCharactersOnAndIn[key]%
Parameters
- key - The key of the object you wish to list the Characters that are on and in.
Equivalent item function
Key.Children(Characters).List
ListHeld Function
Lists all the objects held by a particular character.
Syntax
%ListHeld[key]%
Parameters
- key - The key of the character you wish to list the held objects of.
Equivalent item function
Key.Held.List
ListExits Function
Lists all the exits available to a particular character.
Syntax
%ListExits[key]%
Parameters
- key - The key of the character you wish to list the exits for.
Equivalent item function
Key.Location.Exits.List
ListObjectsAtLocation Function
Displays a list of all the objects at a particular location. This will include dynamic objects directly at the location (i.e. not inside or on another object) and static objects which have been marked as explicitly list.
Syntax
%ListObjectsAtLocation[key]%
Parameters
- key - The key of the location you wish to list the objects at.
Equivalent item function
Key.Objects.List
ListWorn Function
Lists all the objects worn by a particular character.
Syntax
%ListWorn[key]%
Parameters
- key - The key of the character you wish to list the worn objects of.
Equivalent item function
Key.Worn.List
LocationName Function
Returns the short description of a particular Location.
Syntax
%LocationName[key]%
Parameters
- key - The key of the location you wish to return the short description for.
Equivalent item function
Key.Name
LocationOf Function
Returns the key of the location of a particular character.
Syntax
%LocationOf[key]%
Parameters
- key - The key of the character you wish to find the location of.
Equivalent item function
Key.Location
ParentOf Function
Returns the parent key of an object. So for example, if an object is inside another object, or an object is part of a character, the function will return the key of the container object or character. If the function returns more than one parent (for example, the key supplied is a multiple object reference), the keys will be listed in a pipe separated list.
Syntax
%ParentOf[key]%
Parameters
- key - The key of the object you wish to find the parent of. This can also be a reference, for example %objects%.
Equivalent item function
Key.Parent
PropertyValue Function
Returns the current value of a property of an object, Location or character.
Syntax
%PropertyValue[key, propertykey]%
Parameters
- key - The key of the location, object or character you wish to obtain the property value of.
- propertykey - The key of the property you wish to obtain the value of.
Equivalent item function
Key.PropertyKey
TheObject/TheObjects Function
These two functions are identical. However, they are interchangeable to facilitate clearer readability, depending on your task output. These functions will display the full name of an object, replacing any indefinite articles with definite ones, i.e. the word “the”. If the function returns more than one object (for example, the key supplied is a multiple object reference), the objects will be listed in a comma separated list.
Syntax
%TheObject[key]%
Parameters
- key - The key of the object you wish. This can also be a reference, for example %objects%.
Equivalent item function
Key.Name
<<< General Functions | Main Page | Expressions >>> |