docs/Dynamic Object Variables

Dynamic Object Variables

To Getting Started

Object Variables as used in this plugin refer to an object that can have many variables to itself and are an important part of this plugin. They are what make this plugin so robust. You use them to store data, change data and most importantly, test the data to determine if you want to do something, do something else or do nothing at all.

There are three different types of object variable's; Integer, String, Boolean and have the following format:

$ObjectName.VariableName

In the scripts, object variables must start with a dollar sign ($). Immediately after the $ is an object name, this can be any alphanumeric name you want to use. A good use would be to use the name of the triggering player. This can be accomplished with the use of place holders. After the object name we use a separator, the period (.) and following this is the variable name. Again this can be any alphanumeric name you want to use. The Object Name is not case sensitive but the variable names are. So for a variable HasSword and hasSword are two completely different variables. Also you may use the same variable name for different data types.
$Tom.hasSword as an Integer
$Tom.hasSword as a Boolean
$Tom.hasSword as a String
are three completely different variables and may coexist at the same time.

You should remember that although you can use any names you like for the object and variable try to keepthem meaning full. The object can have many different variables but should always reflect thier pourpose. $SunTemple.MainDoorOpen could hold a boolean (true or false) value to represent if the Main Temple Door is open. $SunTemple.PlayerCount could be an integer (number) that store a count of Players inside the temple. You can use PlaceHolders as part of an object or variable name. $<playername>.LoginCount or $<this>Locked.<playername>

You use Script Commands to manage your Object Variables such as:
Integers
@SETINT $Obj.Var 244
@IF i $Obj.Var = 244

Strings
@SETSTR $Obj.Var This is some text
@IF s $Obj.Var = This is aome text

Boolean
@SETBOOL $Obj.Var true
@IF b $Obj.Var = true

You can get a complete list of these commands here

When naming your object variables keep in mind that if it is used on a trigger that other players might activate at the same time, personalize it to the player so that you will not have contamination of the value. Instead of $trap2.count use $<playername>.trap2count or $trap2.<playername>count this will make a uniqe object variable to each player.

To Getting Started