Difference between revisions of "Variables"

From HIVE
Jump to navigation Jump to search
Line 21: Line 21:
  
 
==Variable Types==
 
==Variable Types==
*[[Variables/Ability Command]]
+
*[[Variables/Ability Command|Ability Command]]
*[[Variables/Actor]]
+
*[[Variables/Actor|Actor]]
*[[Variables/Actor Message]]
+
*[[Variables/Actor Message|Actor Message]]
*[[Variables/Actor Scope]]
+
*[[Variables/Actor Scope|Actor Scope]]
*[[Variables/AI Filter]]
+
*[[Variables/AI Filter|AI Filter]]
*[[Variables/Animation Name]]
+
*[[Variables/Animation Name|Animation Name]]
*[[Variables/Attribute ID (Game)]]
+
*[[Variables/Attribute ID (Game)|Attribute ID (Game)]]
*[[Variables/Attribute ID (Player)]]
+
*[[Variables/Attribute ID (Player)|Attribute ID (Player)]]
*[[Variables/Attribute Value]]
+
*[[Variables/Attribute Value|Attribute Value]]
*[[Variables/Bank]]
+
*[[Variables/Bank|Bank]]
*[[Variables/Boolean]]
+
*[[Variables/Boolean|Boolean]]
*[[Variables/Byte]]
+
*[[Variables/Byte|Byte]]
*[[Variables/Camera Object]]
+
*[[Variables/Camera Object|Camera Object]]
*[[Variables/Chat bubble]]
+
*[[Variables/Chat Bubble|Chat Bubble]]
*[[Variables/Cinematic]]
+
*[[Variables/Cinematic|Cinematic]]
*[[Variables/Color]]
+
*[[Variables/Color|Color]]
*[[Variables/Conversation]]
+
*[[Variables/Conversation|Conversation]]
*[[Variables/Conversation Reply]]
+
*[[Variables/Conversation Reply|Conversation Reply]]
*[[Variables/Conversation State Index]]
+
*[[Variables/Conversation State Index|Conversation State Index]]
*[[Variables/Dialog]]
+
*[[Variables/Dialog|Dialog]]
*[[Variables/Dialog Item]]
+
*[[Variables/Dialog Item|Dialog Item]]
*[[Variables/Difficulty Level]]
+
*[[Variables/Difficulty Level|Difficulty Level]]
*[[Variables/Doodad]]
+
*[[Variables/Doodad|Doodad]]
*[[Variables/Integer]]
+
*[[Variables/Integer|Integer]]
*[[Variables/Leaderboard]]
+
*[[Variables/Leaderboard|Leaderboard]]
*[[Variables/Marker]]
+
*[[Variables/Marker|Marker]]
*[[Variables/Mercenary]]
+
*[[Variables/Mercenary|Mercenary]]
*[[Variables/Mission Archive]]
+
*[[Variables/Mission Archive|Mission Archive]]
*[[Variables/Model Camera]]
+
*[[Variables/Model Camera|Model Camera]]
*[[Variables/Objective]]
+
*[[Variables/Objective|Objective]]
*[[Variables/Order]]
+
*[[Variables/Order|Order]]
*[[Variables/Ping]]
+
*[[Variables/Ping|Ping]]
*[[Variables/Planet]]
+
*[[Variables/Planet|Planet]]
*[[Variables/Player Color]]
+
*[[Variables/Player Color|Player Color]]
*[[Variables/Player Group]]
+
*[[Variables/Player Group|Player Group]]
*[[Variables/Point]]
+
*[[Variables/Point|Point]]
*[[Variables/Portrait]]
+
*[[Variables/Portrait|Portrait]]
*[[Variables/Purchase Category]]
+
*[[Variables/Purchase Category|Purchase Category]]
*[[Variables/Purchase Group]]
+
*[[Variables/Purchase Group|Purchase Group]]
*[[Variables/Purchase Item]]
+
*[[Variables/Purchase Item|Purchase Item]]
*[[Variables/Real]]
+
*[[Variables/Real|Real]]
*[[Variables/Region]]
+
*[[Variables/Region|Region]]
*[[Variables/Research Category]]
+
*[[Variables/Research Category|Research Category]]
*[[Variables/Research Item]]
+
*[[Variables/Research Item|Research Item]]
*[[Variables/Research Tier]]
+
*[[Variables/Research Tier|Research Tier]]
*[[Variables/Revealer]]
+
*[[Variables/Revealer|Revealer]]
*[[Variables/Sound]]
+
*[[Variables/Sound|Sound]]
*[[Variables/Sound Link]]
+
*[[Variables/Sound Link|Sound Link]]
*[[Variables/String]]
+
*[[Variables/String|String]]
*[[Variables/Target Filter]]
+
*[[Variables/Target Filter|Target Filter]]
*[[Variables/Text]]
+
*[[Variables/Text|Text]]
*[[Variables/Text Tag]]
+
*[[Variables/Text Tag|Text Tag]]
*[[Variables/Time Of Day]]
+
*[[Variables/Time Of Day|Time of Day]]
*[[Variables/Timer]]
+
*[[Variables/Timer|Timer]]
*[[Variables/Timer Windows]]
+
*[[Variables/Timer Windows|Timer Windows]]
*[[Variables/Transmission]]
+
*[[Variables/Transmission|Transmission]]
*[[Variables/Transmission Source]]
+
*[[Variables/Transmission Source|Transmission Source]]
*[[Variables/Trigger]]
+
*[[Variables/Trigger|Trigger]]
*[[Variables/Unit]]
+
*[[Variables/Unit|Unit]]
*[[Variables/Unit Filter]]
+
*[[Variables/Unit Filter|Unit Filter]]
*[[Variables/Unit Group]]
+
*[[Variables/Unit Group|Unit Group]]
*[[Variables/Unit Type]]
+
*[[Variables/Unit Type|Unit Type]]
*[[Variables/Water]]
+
*[[Variables/Water|Water]]
*[[Variables/Wave]]
+
*[[Variables/Wave|Wave]]
*[[Variables/Wave Info]]
+
*[[Variables/Wave Info|Wave Info]]
*[[Variables/Wave Target]]
+
*[[Variables/Wave Target|Wave Target]]
  
 
[[Category:StarCraft II]]
 
[[Category:StarCraft II]]
 
[[Category:Reference]]
 
[[Category:Reference]]
 
[[Category:Triggers]]
 
[[Category:Triggers]]

Revision as of 10:21, 27 March 2013

Variables are used to store information that you will be able to call later on. This information can be pretty much anything from units to players, passing by regions, orders, sounds, and much much more.

To create a variable, right click the left area in the Trigger Window, go to New, then New Variable (Ctrl + B). Now you need a type, a name, and sometimes a value or configure it to be an array.

Variables Basics

Writing to a variable is as simple as making a new action, and choosing the option that first comes up, which is 'Set Variable'. When setting a variable, the editor will automatically populate the list with reasonable things to put into it.

When reading a variable, conditions vary. Bringing a unit to a location can also be done by bringing a variable to a location, if the unit is inside the Unit variable. Even math can be done, in the math section of the conditions list, to variables containing numbers and can allow you to do more things in only one trigger.

Local Variables

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

Global Variable

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 information into the same variable. Let's say you have a Variable that you want to change based on what different players do, but you don't want the changes one player makes to affect the variable for another player. By checking the box next to "Array" and setting the size to the amount of players in your game, you can then link to whateverVariable[1] and have that specifically be for Player 1's triggers, then set up whateverVariable[2] for Player 2, and so on. Of course this also isn't limited to something as simple as that. Arrays are most helpful when you just want to keep your variables organized and minimal rather than having to create a ton of variables that serve a similar purpose.

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.

Variable Types