Difference between revisions of "Group Functions"

From ADRIFT 5 Manual Wiki
Jump to: navigation, search
m (Link)
m
Line 68: Line 68:
  
  
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[Event_Functions|<<< Event Functions]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Item functions]]</TD><TD ALIGN=CENTER>[[Expressions|Expressions >>>]]</TD></TABLE>
+
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[Event_Functions|<<< Event Functions]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Item functions]]</TD><TD ALIGN=CENTER>[[List_of_Item_functions|List of Item functions >>>]]</TD></TABLE>
 
[[Category:Functions]]
 
[[Category:Functions]]

Revision as of 11:13, 23 June 2013

Using the list functions

The list functions operate on a list of item keys.

A list of item keys is separated by the pipe "|" symbol, and looks like these if printed:

Object2|Object5|Object7

Character2|Character3|Character5|Player

The list functions are appended to a reference or function that generates a list of keys, and is used to format it for output or to count the number of items in the list.

Item lists can be generated from:

  • A group
  • The multi-item references %characters% and %objects%
  • Functions which return a list of items worn by or held by a character.
  • Functions which return a list of items contained inside or placed on top of an object.

If you enter any of these followed by a dot ".", an intellisense menu will popup which contains the "Count" and "List" functions plus several filter functions.

OoListFunctions.jpg

Filter functions

The options with the Filter.png icon are selection-only properties that can be used to filter the list.

For a list of objects these will be object properties, and for a list of characters these will be character properties.

Any number of these can be appended to the function to filter the list so it only includes the items with those properties selected.

The function "%character%.Worn.Edible.Readable.List" will take the list of objects currently being worn by the referenced character, select only those that are both edible and readable, then print them in a comma delimited list.

Count

This function simply counts the number of item keys in the list and returns the number of items as an integer number.

This number can then be printed or used in an expression

List

The list function is used to format a list of items for output. It reads the name of each item and prints them in a comma-delimited list with "and" or "or" inserted between the last two items.

Up to 3 parameters can be added to the "List" function, in any order, to control the formatting of the text output.

Each of these parameters has two settings, and if you type a "(" character immediately after the "List" function, the intellisense system will display a list of these six options:

OoListParams.jpg

Three of these options ("True", "Definite" and "And") are default values, so the function "Player.Worn.list" means the same as "Player.Worn.list(True, Definite, And)"

True/False

This parameter indicates whether the list should include the contents of each item listed as well as the items themselves.

The default value is True, so the text "You are carrying %player%.Held.List" might print:

You are carrying a fountain pen, a large sword and a leather pouch. Inside the leather pouch is a gold coin

If instead you enter "You are carrying %player%.Held.List(False)" you will only get:

You are carrying the fountain pen, the large sword and the leather pouch

Definite/Indefinite

This parameter controls whether each item is printed with the definite ("the box") or indefinite ("a box") article.

The default is Definite, so "You pick up %player%.Held.List" will print:

You pick up the fountain pen, the large sword and the leather pouch

while "You can see %player%.Held.List(Indefinite) the other side of the portal" will print:

You can see a fountain pen, a large sword and a leather pouch the other side of the portal

And/Or

This parameter chooses the word that is placed between the last two items in the list.

"You pick up %player%.Held.List" will print:

You pick up the fountain pen, the large sword and the leather pouch

but if you want to use a negative sentence, it would be better to write "You can't pick up %player%.Held.List(or)" which will substitute the word "or" in place of the word "and":

You can't pick up the fountain pen, the large sword or the leather pouch


<<< Event FunctionsItem functionsList of Item functions >>>