Post by DungeonM on May 10, 2004 13:48:23 GMT -5
It's really sad that so many people avoid variables, they are so useful and so easy to use.
Variables are sort of like a preset, they're there to be used to set certain information ingame.
Variables store data types of their name, such as an ability variable, you can't make an ability variable 01 or mean false but you can make it mean Flamestrike or Brilliance Aura.
Some variables can be preset in the variable manager, others can only be set in-game.
Some variables that might need explaining:
Boolean (Basicly means True or False)
Integer (A non-decimal number such as 1)
Real (A number with 2 decimal slots such as 1.00)
String (Basicly text, such as this very sentance could be a sentance.)
Unit/Tech/Destructible/Item Type (The actuall type of the object, such as a footman compared to certain footman.)
Unit/Player/Item (Refers to a certain object or player.)
Unit/Player Group (Refers to a certain group of objects or players.)
How to use a variable:
Say we wanted to spawn a certain number of footman every 2 minutes yet we want to make the certain number changeable and we dont' want 100 different triggers.
Untitled Trigger 001
Events
Time - Elapsed game time is 120.00 seconds
Conditions
Actions
Unit - Create X Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
We replace X with an integer variable so it would be...
Unit - Create IntegerVariable Footman
Then whenever we want to change the number of footman made we just change that variable, now imagine we wanted to start off with 1 footman and increase to 100, we'd have to make 100 differnt triggers if it were not for variables.
Variables are sort of like a preset, they're there to be used to set certain information ingame.
Variables store data types of their name, such as an ability variable, you can't make an ability variable 01 or mean false but you can make it mean Flamestrike or Brilliance Aura.
Some variables can be preset in the variable manager, others can only be set in-game.
Some variables that might need explaining:
Boolean (Basicly means True or False)
Integer (A non-decimal number such as 1)
Real (A number with 2 decimal slots such as 1.00)
String (Basicly text, such as this very sentance could be a sentance.)
Unit/Tech/Destructible/Item Type (The actuall type of the object, such as a footman compared to certain footman.)
Unit/Player/Item (Refers to a certain object or player.)
Unit/Player Group (Refers to a certain group of objects or players.)
How to use a variable:
Say we wanted to spawn a certain number of footman every 2 minutes yet we want to make the certain number changeable and we dont' want 100 different triggers.
Untitled Trigger 001
Events
Time - Elapsed game time is 120.00 seconds
Conditions
Actions
Unit - Create X Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
We replace X with an integer variable so it would be...
Unit - Create IntegerVariable Footman
Then whenever we want to change the number of footman made we just change that variable, now imagine we wanted to start off with 1 footman and increase to 100, we'd have to make 100 differnt triggers if it were not for variables.