General item functions

From ADRIFT 5 Manual Wiki
(Redirected from Obsolete general functions)
Jump to: navigation, search

These are general functions which duplicate the functionality of some of the Item functions.

These functions are used in libraries instead of the item functions because they make it easier to customise the default messages that the library generates. This is because you can override a general function by creating a user function with the same name. This user function can then re-format the item function output to better suit a particular game, or as part of translating the library into a different language.

The Item functions are often shorter and offer extra functionality so in your own games item functions should be used instead.


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


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


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