rootlite.blogg.se

Warcraft 3 world editor jass variables
Warcraft 3 world editor jass variables






warcraft 3 world editor jass variables

JASS is statically-typed, and its types can be separated into two classes: natives and handles. Set r = syntax_Example_Sum( i, r ) //the "call" keyword is omitted when accessing a function's return value Set i = 6 //the keyword "set" is used to rebind variablesĬall syntax_Example_Sum( i, r ) //function calls must be preceded by the keyword "call" separated statements MUST be placed on separate lines Local real r = 5.0 //local variable declarations must come before anything else in a function and variables may be Local integer i //declaring a local variable requires the modifier "local", the variable's data type, and the variable name Return i + r //return statements must begin with the keyword "return"Įndfunction //the keyword "endfunction" signals the end of a function blockįunction syntax_Example takes nothing returns nothing the function name, parameters (if any) and return type (if

warcraft 3 world editor jass variables

Examples of basic syntax are shown below:įunction syntax_Example_Sum takes integer i, real r returns real //function declaration must include: the keyword "function", The following function creates a string containing the message " Hello, world!" and displays it to all players:įunction Trig_JASS_test_Actions takes nothing returns nothingĬall DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Hello, world!")įunction Trig_JASS_test_Actions takes player p returns nothingĬall DisplayTextToPlayer(p, 0,0, "Hello, world!")Īnd if you want to print the message 90 times and show the iterator:Ĭall DisplayTextToPlayer(p, 0,0, "Hello, world! "+I2S(i))

#WARCRAFT 3 WORLD EDITOR JASS VARIABLES MODS#

JASS primarily uses procedural programming concepts, though popular user-made mods to Blizzard's World Editor program have since added C++-like object-oriented programming features to the syntax of JASS. It has a syntax similar to Turing and Delphi, although, unlike those languages, it is case sensitive. JASS can also create powerful functions such as trackables, which detects if a mouse goes over or hits a position, GetLocalPlayer(), which can cause disconnects if used improperly (such as using handles with GetLocalPlayer(). It can, for example, execute simple GUI functions such as, giving orders to units, change the weather and time of day, play sounds and display text to the player, and manipulate the terrain. The language provides an extensive API that gives programmers control over nearly every aspect of the game world.








Warcraft 3 world editor jass variables