Editor guide

Page 265

Global Variables Next to the local variables exists global variables. While a local variable will only work in a special predefined section, a global variable will work for a much wider section, as the name already implies. An example: If the user is renaming a unit so the name is a global variable, the name can be used only one time. If one wants to rename another unit with the same name, an error message will appear. The unit which has been named can be now be called by scripts, triggers, and waypoints - it's global. Fixed variables Some values are already used by the game, these are: Player This Time _time _x _this Pi

- The Player - Unit or object - Time of day in the game - Local time - An element out of an Array - Local unit - 3,14…

Conditions of variables It’s possible to allocate conditions or values to a variable. Its also possible to set them on true or allocate them a text string. Name1= true Name1= 44 Name1= "MyText" Name1= [Value1,Value2]

- Variable is receiving the value TRUE - Variable is receiving a value - Variable is receiving a text string - Variable is receiving a array value

Saving variables It's also possible to save variables at any time to call the again later saveVar "Variablenname"

9.2 - Logical values A logical value is a special condition of a value. One can compare it with an on/off switch. If a variable has been set to true, a predefined action will get started. If the same action gets set back to false, this action will be ended. It's also possible to define true as 1 and false as 0. true false 266

- Will be executed when a condition has been executed - Will be executed when a condition has not been executed


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.