Object-oriented functions

From ADRIFT 5 Manual Wiki
Revision as of 08:15, 23 March 2012 by Saabie (Talk | contribs) (key from function or reference)

Jump to: navigation, search

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

Adrift recognises an object-oriented 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 sentance, and "42.56" is a number.

These are quite powerfull 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.

The item key can come from a function (eg. %Player%.ProperName) or a reference (eg. %character%.ProperName)

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.

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

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