Item functions

From ADRIFT 5 Manual Wiki
Jump to: navigation, search

The item functions are used to get the current value of one of the properties of a particular object, character or location.

The item function syntax uses a dot character ("." the Full-Stop or decimal point) between an item key and one or more property keys, to allow direct access to the value of a property in text or an expression without having to use the more cumbersome %PropertyValue[]% function to access each one.

Adrift recognises an item function by the presence of a dot joining two words with no space between them. Therefore you dont need to use the % or <# delimiters to separate them from normal text.

  • "Object2.Name" is a property, "Object2." is just the full-stop at the end of a sentence, and "42.56" is a number.
  • The first word must be a recognised key with the first letter capitalised to activate the list of properties and functions when you press the "."
Typing "Player." will activate the list, but "player." will not.
  • The item key can come from a function (eg. %Player%.ProperName) or a reference (eg. %character%.ProperName)
  • These functions are quite powerful because you can keep adding property names to the end of the function to get more complex information.
For example: "Character2.CharacterAtLocation.Exits.Count" can be used to display the number of accessable exits from the current location of character 2.
  • You can also filter a list of items, such as the players inventory "Player.Held" or a group, to obtain only those objects that have a particular property or are currently in a certain state.
For example: "Player.Held.OpenStatus(Closed)" will return only those objects in the inventory which are closed containers.

Popup Menu's

If you type a reference, item key or %Function% that returns a key, then press the full stop "." key, ADRIFT will popup a menu of functions which are applicable to that type of item:


  • If you now press the down-arrow key ADRIFT will show a description of the first function next to the menu.
Pressing down-arrow again will move down the list showing the description of each function in turn.
Press ENTER to insert the selected function after the "."
  • You can also select a function by clicking on it with the mouse or typing part of its name to bring it to the top of the list.
  • If you want to stop the menu popup, or include text that looks like an Item function, just insert an empty html tag like %character%<>. or Player<>.Held

Property Types

IconLocation.jpg Location properties

These properties return the key of a location. These would not normally be displayed to the player, but can be used to access properties of the location by adding another dot followed by the name of a property that locations can have.

IconCharacters.jpg Character properties

These properties return the key of a character.

IconText.jpg Text properties

Returns text that can be displayed or stored in a text variable

IconInteger.jpg Integer properties

Returns a number that can be displayed, stored in an integer variable, or used in an expression.

IconGroup.jpg Group properties

These are basically a list of key names which are displayed with a pipe symbol "|" between each one.

eg. %Player%.CharacterAtLocation.Exits is displayed as "North|East|South"

There are two special List Functions that can be appended to a group property, ".List" to list the members of the group, and ".Count" to return the number of group members as an integer value.

Some group properties are functions which use parameters to filter the results.

For example the "Children" group can contain both Objects and Characters, and these can be either on or inside the parent object.

The function .Children(Objects,On) will filter the contents of the group to return only those which are objects and which are on top of the parent object.

Filter.png Group filters

Any selection-only property can be used to filter a group property so that only the items with that property selected will remain.

The function "%object%.Contents(Characters).Known" will take the list of characters that are inside the given object and filter them with the "known" property so that only characters inside the object which are known to the player will be in the returned list.

IconDynamicObject.jpg Object properties

Returns the key of an object

IconStaticObject.jpg Item properties

Returns the key of an item (can be either a Character, an Object, or a Location)

Function Lists

Character Functions

Object Functions

Location Functions

Event Functions

List Functions

Alphabetically sorted list

<<< FunctionsMain PageCharacter Functions >>>