Difference between revisions of "Functions"

From ADRIFT 5 Manual Wiki
Jump to: navigation, search
m (PopUpInput)
m (added several wiki-links)
Line 1: Line 1:
 
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.  
 
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.  
+
Many of these functions can automatically be generated by dragging the appropriate item ([[Locations|Location]], [[Objects|object]] or [[Characters|character]]) from a folder window to the text area that you wish the function to appear in.  
  
  
 
== AloneWithChar Function ==
 
== AloneWithChar Function ==
Returns the key of the character in the same location as the player.
+
Returns the [[key]] of the [[Characters|character]] in the same [[Locations|location]] as the player.
  
 
Always use the restriction "The player character must be alone with any character" to check if this function will return a valid result, before using the result of this function in any equation.
 
Always use the restriction "The player character must be alone with any character" to check if this function will return a valid result, before using the result of this function in any equation.
Line 18: Line 18:
  
 
== CharacterDescriptor 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".  
+
Returns the full descriptor (including article and prefix) of the [[Characters|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".  
  
 
NB. Available from version 5.0.17.
 
NB. Available from version 5.0.17.
Line 25: Line 25:
 
  %CharacterDescriptor[key]%  
 
  %CharacterDescriptor[key]%  
 
'''Parameters'''  
 
'''Parameters'''  
* ''key'' - The key of the character you wish to display the name of.
+
* ''key'' - The [[key]] of the character you wish to display the name of.
  
  
 
== CharacterName Function ==
 
== CharacterName Function ==
If the character is known (this will depend on the Known property, if it exists), or the character descripter field is blank, this function returns the proper name of a particular character. If the proper name field is blank this function will return "Anonymous". However, if the character is not known and the character descripter field is NOT blank, it will return the character descriptor instead.
+
If the [[Characters|character]] is known (this will depend on the Known property, if it exists), or the character descripter field is blank, this function returns the proper name of a particular character. If the proper name field is blank this function will return "Anonymous". However, if the character is not known and the character descripter field is NOT blank, it will return the character descriptor instead.
  
 
For the player character this function will return "I" in first-person mode, "you" in second-person mode, and the proper name in third-person mode (which defaults to "Anonymous" for the default player character).   
 
For the player character this function will return "I" in first-person mode, "you" in second-person mode, and the proper name in third-person mode (which defaults to "Anonymous" for the default player character).   
Line 36: Line 36:
 
  %CharacterName[key]%  
 
  %CharacterName[key]%  
 
'''Parameters'''  
 
'''Parameters'''  
* ''key'' - The key of the character you wish to display the name of.
+
* ''key'' - The [[key]] of the character you wish to display the name of.
  
  
 
== CharacterProper Function ==
 
== 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".
+
Returns the proper name of a particular [[Characters|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.
 
NB. Available from version 5.0.17.
Line 47: Line 47:
 
  %CharacterProper[key]%  
 
  %CharacterProper[key]%  
 
'''Parameters'''  
 
'''Parameters'''  
* ''key'' - The key of the character you wish to display the name of.
+
* ''key'' - The [[key]] of the character you wish to display the name of.
  
  
 
== ConvCharacter Function ==
 
== ConvCharacter Function ==
Returns the key of the character the player is currently in conversation with.
+
Returns the [[key]] of the [[Characters|character]] the player is currently in conversation with.
  
 
Always use the restriction "The player character must be in conversation with any character" to check if this function will return a valid result, before using the result of this function in any equation.
 
Always use the restriction "The player character must be in conversation with any character" to check if this function will return a valid result, before using the result of this function in any equation.
Line 63: Line 63:
  
 
== DisplayCharacter Function ==
 
== DisplayCharacter Function ==
Displays the description of a particular character  
+
Displays the description of a particular [[Characters|character]]
  
 
'''Syntax'''
 
'''Syntax'''
 
  %DisplayCharacter[key]%  
 
  %DisplayCharacter[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the character you wish to display the description for.   
+
* ''key'' - The [[key]] of the character you wish to display the description for.   
  
  
 
== DisplayLocation Function ==
 
== DisplayLocation Function ==
Displays the description of a particular location.
+
Displays the description of a particular [[Locations|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.
 
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.
Line 78: Line 78:
 
Next will be the long description of the location, possibly modified by [[Alternate_Descriptions|alternate descriptions]].
 
Next will be the long description of the location, possibly modified by [[Alternate_Descriptions|alternate descriptions]].
  
Static objects with "Specifically list objects in location description" selcted, and dynamic objects, will then be listed.
+
Static [[objects]] with "Specifically list objects in location description" selcted, 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.
 
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).
 
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.
+
[[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.
 
*This function does not currently show characters or objects that are sitting or laying on another object.
Line 90: Line 90:
 
  %DisplayLocation[key]%  
 
  %DisplayLocation[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the location you wish to display the description for.
+
* ''key'' - The [[key]] of the location you wish to display the description for.
 
<br>
 
<br>
  
 
== DisplayObject Function ==
 
== DisplayObject Function ==
Displays the description of a particular object.  
+
Displays the description of a particular [[Objects|object]].  
  
 
'''Syntax'''
 
'''Syntax'''
 
  %DisplayObject[key]%  
 
  %DisplayObject[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the object you wish to display the description for.   
+
* ''key'' - The [[key]] of the object you wish to display the description for.   
  
  
Line 112: Line 112:
  
 
== ListCharactersIn Function ==
 
== ListCharactersIn Function ==
Lists all the characters inside a particular object.  
+
Lists all the [[characters]] inside a particular [[Objects|object]].  
  
 
'''Syntax'''
 
'''Syntax'''
 
  %ListCharactersIn[key]%  
 
  %ListCharactersIn[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the object you wish to list the characters that are inside of.  
+
* ''key'' - The [[key]] of the object you wish to list the characters that are inside of.  
  
  
 
== ListCharactersOn Function ==
 
== ListCharactersOn Function ==
Lists all the characters sitting, laying or standing on top of a particular object.
+
Lists all the [[characters]] sitting, laying or standing on top of a particular [[Objects|object]].
 
Example output: "Harry, Fred and George"  
 
Example output: "Harry, Fred and George"  
  
Line 127: Line 127:
 
  %ListCharactersOn[key]%  
 
  %ListCharactersOn[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the object you wish to list the characters that are on top of.  
+
* ''key'' - The [[key]] of the object you wish to list the characters that are on top of.  
  
  
 
== ListCharactersOnAndIn Function ==
 
== 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.
+
Lists all the [[characters]] on and inside a particular [[Objects|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"
 
Example output: "Harry and fred are on the box, and George are inside the box"
  
Line 137: Line 137:
 
  %ListCharactersOnAndIn[key]%  
 
  %ListCharactersOnAndIn[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the object you wish to list the Characters that are on and in.  
+
* ''key'' - The [[key]] of the object you wish to list the Characters that are on and in.  
  
  
 
== ListHeld Function ==
 
== ListHeld Function ==
Lists all the objects held by a particular character.  
+
Lists all the [[objects]] held by a particular [[Characters|character]].  
  
 
'''Syntax'''
 
'''Syntax'''
 
  %ListHeld[key]%  
 
  %ListHeld[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the character you wish to list the held objects of.  
+
* ''key'' - The [[key]] of the character you wish to list the held objects of.  
  
  
 
== ListExits Function ==
 
== ListExits Function ==
Lists all the exits available to a particular character.  
+
Lists all the exits available to a particular [[Characters|character]].  
  
 
'''Syntax'''
 
'''Syntax'''
 
  %ListExits[key]%  
 
  %ListExits[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the character you wish to list the exits for.
+
* ''key'' - The [[key]] of the character you wish to list the exits for.
  
  
 
== ListObjectsAtLocation Function ==
 
== 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.  
+
Displays a list of all the [[objects]] at a particular [[Locations|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'''
 
'''Syntax'''
 
  %ListObjectsAtLocation[key]%  
 
  %ListObjectsAtLocation[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the location you wish to list the objects at.  
+
* ''key'' - The [[key]] of the location you wish to list the objects at.  
  
  
 
== ListWorn Function ==
 
== ListWorn Function ==
Lists all the objects worn by a particular character.  
+
Lists all the [[objects]] worn by a particular [[Characters|character]].  
  
 
'''Syntax'''
 
'''Syntax'''
 
  %ListWorn[key]%  
 
  %ListWorn[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the character you wish to list the worn objects of.  
+
* ''key'' - The [[key]] of the character you wish to list the worn objects of.  
  
  
 
== ListObjectsIn Function ==
 
== ListObjectsIn Function ==
Lists all the objects inside of a particular container object.  
+
Lists all the [[objects]] inside of a particular container object.  
  
 
'''Syntax'''
 
'''Syntax'''
 
  %ListObjectsIn[key]%  
 
  %ListObjectsIn[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the object you wish to list the objects that are in.  
+
* ''key'' - The [[key]] of the object you wish to list the objects that are in.  
  
  
 
== ListObjectsOn Function ==
 
== ListObjectsOn Function ==
Lists all the objects on the surface of a particular object.  
+
Lists all the [[objects]] on the surface of a particular object.  
  
 
'''Syntax'''
 
'''Syntax'''
 
  %ListObjectsOn[key]%  
 
  %ListObjectsOn[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the object you wish to list the objects that are on.  
+
* ''key'' - The [[key]] of the object you wish to list the objects that are on.  
  
  
 
== ListObjectsOnAndIn Function ==
 
== ListObjectsOnAndIn Function ==
Lists all the objects on and inside a particular object.  This is basically the same as ListObjectsOn and ListObjectsIn, but it gives the response in a nicer syntax when there are objects both on and in the object.  
+
Lists all the [[objects]] on and inside a particular object.  This is basically the same as ListObjectsOn and ListObjectsIn, but it gives the response in a nicer syntax when there are objects both on and in the object.  
  
 
'''Syntax'''
 
'''Syntax'''
 
  %ListObjectsOnAndIn[key]%  
 
  %ListObjectsOnAndIn[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the object you wish to list the objects that are on and in.  
+
* ''key'' - The [[key]] of the object you wish to list the objects that are on and in.  
  
  
 
== LocationName Function ==
 
== LocationName Function ==
Returns the short description of a particular location.  
+
Returns the short description of a particular [[Locations|Location]].  
  
 
'''Syntax'''
 
'''Syntax'''
 
  %LocationName[key]%  
 
  %LocationName[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the location you wish to return the short description for.
+
* ''key'' - The [[key]] of the location you wish to return the short description for.
  
  
 
== LocationOf Function ==
 
== LocationOf Function ==
Returns the key of the location of a particular character.  
+
Returns the key of the [[Locations|location]] of a particular [[Characters|character]].  
  
 
'''Syntax'''
 
'''Syntax'''
 
  %LocationOf[key]%  
 
  %LocationOf[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the character you wish to find the location of.  
+
* ''key'' - The [[key]] of the character you wish to find the location of.  
  
  
Line 231: Line 231:
  
 
== ParentOf Function ==
 
== 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.  
+
Returns the parent [[key]] of an [[Objects|object]].  So for example, if an object is inside another object, or an object is part of a [[Characters|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'''
 
'''Syntax'''
 
  %ParentOf[key]%
 
  %ParentOf[key]%
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the object you wish to find the parent of.  This can also be a reference, for example %objects%.   
+
* ''key'' - The [[key]] of the object you wish to find the parent of.  This can also be a reference, for example %objects%.   
  
  
Line 249: Line 249:
  
 
== Player Function ==
 
== 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.  
+
This function returns the [[key]] of the player [[Characters|character]].  This will normally always be known at design time, but if you switch characters during the game, it may be necessary.  
  
 
'''Syntax'''
 
'''Syntax'''
Line 290: Line 290:
 
'''Example'''
 
'''Example'''
  
To ask the player for their name at the start of the game we would create a system task set to run "Immediately", and add the following action to use the PopupInput function to ask them to enter it, then write the name they entered to the "Name" property of the player character.
+
To ask the player for their name at the start of the game we would create a system task set to run "Immediately", and add the following action to use the PopupInput function to ask them to enter it, then write the name they entered to the "Name" property of the player [[Characters|character]].
  
 
[[File:ActionEnterYourName.jpg]]
 
[[File:ActionEnterYourName.jpg]]
Line 297: Line 297:
  
 
== PropertyValue Function ==
 
== PropertyValue Function ==
Returns the current value of a property of an object, location or character.  
+
Returns the current value of a property of an [[Objects|object]], [[Locations|Location]] or [[Characters|character]].  
  
 
'''Syntax'''
 
'''Syntax'''
 
  %PropertyValue[key, propertykey]%  
 
  %PropertyValue[key, propertykey]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the location, object or character you wish to obtain the property value of.
+
* ''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.
 
* ''propertykey'' - The key of the property you wish to obtain the value of.
 
<br />
 
<br />
Line 317: Line 317:
  
 
== TheObject/TheObjects Function ==
 
== 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.  
+
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 [[Objects|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'''
 
'''Syntax'''
 
  %TheObject[key]%  
 
  %TheObject[key]%  
 
'''Parameters'''
 
'''Parameters'''
* ''key'' - The key of the object you wish.  This can also be a reference, for example %objects%.
+
* ''key'' - The [[key]] of the object you wish.  This can also be a reference, for example %objects%.
  
  

Revision as of 05:18, 30 August 2012

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 (Location, object or character) from a folder window to the text area that you wish the function to appear in.


AloneWithChar Function

Returns the key of the character in the same location as the player.

Always use the restriction "The player character must be alone with any character" to check if this function will return a valid result, before using the result of this function in any equation.

This function can be used as the %character% parameter for an Execute-Task action. The executed task will then be applied to the character that is currently in the same location as the player.

Syntax

%AloneWithChar% 

Parameters

  • none


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

NB. Available from version 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), or the character descripter field is blank, this function returns the proper name of a particular character. If the proper name field is blank this function will return "Anonymous". However, if the character is not known and the character descripter field is NOT blank, it will return the character descriptor instead.

For the player character this function will return "I" in first-person mode, "you" in second-person mode, and the proper name in third-person mode (which defaults to "Anonymous" for the default player character).

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


ConvCharacter Function

Returns the key of the character the player is currently in conversation with.

Always use the restriction "The player character must be in conversation with any character" to check if this function will return a valid result, before using the result of this function in any equation.

This function can be used as the %character% parameter for an Execute-Task action. The executed task will then be applied to the character that 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 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" selcted, 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.


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.


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.


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.


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.


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.


ListObjectsIn Function

Lists all the objects inside of a particular container object.

Syntax

%ListObjectsIn[key]% 

Parameters

  • key - The key of the object you wish to list the objects that are in.


ListObjectsOn Function

Lists all the objects on the surface of a particular object.

Syntax

%ListObjectsOn[key]% 

Parameters

  • key - The key of the object you wish to list the objects that are on.


ListObjectsOnAndIn Function

Lists all the objects on and inside a particular object. This is basically the same as ListObjectsOn and ListObjectsIn, but it gives the response in a nicer syntax when there are objects both on and in the object.

Syntax

%ListObjectsOnAndIn[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


PopUpChoice

Causes an input box to popup on the screen, displaying a short message prompt and two choices. The player chooses one of the two options and this becomes the value returned by the function. This is used in the expression field of a set variable action to allow the player to choose which of two text strings is written to the variable.

See [| Ask player to enter their gender when the game starts] for an example.

  • Do NOT use directly in a restriction. If you need to do this then call PopupChoice in an action which stores result in a variable and then execute a system task (with another action) which checks the variable with a restriction.

Syntax

%PopUpChoice[prompt, choice1, choice2]% 

Parameters

  • prompt - An expression (typically a quoted string) to display as a message in the inputbox.
  • choice1 - An expression returned in the function if the user selects this option.
  • choice2 - An expression returned in the function if the user selects this option.


PopUpInput

Causes an input box to popup on the screen, displaying a short message prompt and a single-line text entry field. The player can accept the default text or enter a new line of text, then press OK. This could be used to allow the player to enter their own name, which is then used in the game. If the player presses cancel then this function will return a zero-length string. This function should be used in the expression field of either a "Variables" action or a "Set Properties" action.

  • Do NOT use directly in a restriction. If you need to do this then call PopUpInput in an action which stores the result in a variable, and then execute a system task (with another action) which checks the variable with a restriction.

Syntax

%PopUpInput[prompt, default]%

Parameters

  • prompt - An expression (typically a quoted string) to display as a message in the inputbox.
  • default - Optional. An expression (typically a quoted string) to display in the text field of the inputbox.


Example

To ask the player for their name at the start of the game we would create a system task set to run "Immediately", and add the following action to use the PopupInput function to ask them to enter it, then write the name they entered to the "Name" property of the player character.

ActionEnterYourName.jpg


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.


Rand Function

The Rand function returns a random value between two integers.

Syntax

RAND(value1, value2)

Parameters

  • value1 - The lowest possible value you wish the function to return.
  • value2 - The highest possible value you wish the function to return.


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


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.