Variables

From HIVE
Jump to navigation Jump to search

Variables are used to store information into something that you will be able to call later on. This information can be pretty much anything (not just numbers!), from units to players, passing by regions, orders, sounds, and much much more. For a complete list of the Variable Types, please click here.

The Variables themselves contain 4 important notions: Local variables, Global variables, Arrays and Constants.

Local

A Local variable is a variable that you will only be able to use within the trigger that contains it.

Global

A Global variable is used to transcend the boundaries of the triggers, thus allowing you to use it anywhere. They are created on the left-tree, where triggers and folders are listed.

Arrays

Arrays are extremely useful and time-saving when you learn to use them properly. They are used to store different informations into the same variable.

What is the difference between having 10 different variables and 1 variable with 10 arrays? Well, with the arrays, you can use an Integer to call data, which will save you a lot of time.

Constants

A Constant "type" variable is one that you will not be able to change. You set its initial value, and it'll always stay as it is.

Most used types

Among the pretty long list of Variable Types, there of course are some types you'll use more often than others. Here's an arbitrary list:

See Also