Functions
There are quite a few functions that can be added to any text within ADRIFT 5. Functions must always be within percent (%) symbols. Any arguments must be provided in square brackets. If multiple arguments are required, these should be comma separated.
Many of these functions can automatically be generated by dragging the appropriate item the text area you wish the function to appear in.
Contents
- 1 CharacterDescriptor Function
- 2 CharacterName Function
- 3 CharacterProper Function
- 4 ConvCharacter Function
- 5 DisplayCharacter Function
- 6 DisplayLocation Function
- 7 DisplayObject Function
- 8 LCase Function
- 9 ListHeld Function
- 10 ListExits Function
- 11 ListObjectsAtLocation Function
- 12 ListWorn Function
- 13 ListObjectsOn Function
- 14 ListObjectsIn Function
- 15 ListObjectsOnAndIn Function
- 16 LocationName Function
- 17 LocationOf Function
- 18 NumberAsText Function
- 19 ParentOf Function
- 20 PCase Function
- 21 Player Function
- 22 PropertyValue Function
- 23 TheObject/TheObjects Function
- 24 UCase 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". NB. This has only been implemented in 5.0.17.
Syntax
%CharacterDescriptor[key]%
Parameters
- key - The key of the character you wish to display the name of.
CharacterName Function
If the character is known (this will depend on the Known property, if it exists), this returns the name of a particular character (unless it is blank). However, if the character is not known it will return the character descriptor (unless it is blank).
Syntax
%CharacterName[key]%
Parameters
- key - The key of the character you wish to display the name of.
CharacterProper Function
Returns the proper name of a particular character. NB. This has only been implemented in 5.0.17.
Syntax
%CharacterProper[key]%
Parameters
- key - The key of the character you wish to display the name of.
ConvCharacter Function
Returns the key of the character the player is currently in conversation with.
Syntax
%ConvCharacter%
Parameters
- none
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.
DisplayLocation Function
Displays the description of a particular character.
Syntax
%DisplayLocation[key]%
Parameters
- key - The key of the location you wish to display the description for.
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.
LCase Function
Returns a string that has been converted to lower case.
Syntax
%LCase[string]%
Parameters
- string - The text string you wish to convert to lower case.
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.
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.
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.
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.
ListObjectsOn Function
Lists all the objects on a particular object.
Syntax
%ListObjectsOn[key]%
Parameters
- key - The key of the object you wish to list the objects that are on.
ListObjectsIn Function
Lists all the objects inside a particular object.
Syntax
%ListObjectsIn[key]%
Parameters
- key - The key of the object you wish to list the objects that are in.
ListObjectsOnAndIn Function
Lists all the objects on and inside a particular object. This is basically the same as ListObjectOn and ListObjectsIn, but it gives the response in a nicer syntax when there are objects both on and in the object.
Syntax
%ListObjectsInAndIn[key]%
Parameters
- key - The key of the object you wish to list the objects that are on and in.
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.
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.
NumberAsText Function
Returns a number written out as text.
Syntax
%NumberAsText[number]%
Parameters
- number - Any non-negative integer value
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%.
PCase Function
Returns a string that has been converted to proper case (i.e. the first letter will be capitalised, and all other letters will be converted to lower case).
Syntax
%PCase[string]%
Parameters
- string - The text string you wish to convert to proper case.
Player Function
This function returns the key of the player character. This will normally always be known at design time, but if you switch characters during the game, it may be necessary.
Syntax
%Player%
Parameters
- none
PropertyValue Function
Returns the current value of a property of an object 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 with to obtain the value of.
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 articles with 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%.
UCase Function
Returns a string that has been converted to upper case
Syntax
%UCase[string]%
Parameters
- string - The text string you wish to convert to upper case.