=CMD =COMMAND $VARNAME:DEF_VAL =DESC Defines an input variable. Input variables are created at script start and assigned either the default value, or a value specified in the editor. Input variables must start with a $ sign =ENDDESC =EX $enemy:1 $particleType:0 CreateParticle(CurrentCoords 0 0 <-particleType <-enemy) =ENDEX =ENDCMD =CMD =COMMAND ClearLocals =DESC Clears all local variables. Local variables persist across script invocations. =ENDDESC =EX 1 ->temp trace(<-temp) #prints out 1 to the tracelog ClearLocals trace(<-temp) #prints out 0 to the tracelog =ENDEX =ENDCMD =CMD =COMMAND --VARNAME =DESC Deletes VARNAME from the heap. It is now unassigned. =ENDDESC =EX 42 ->TheAnswer trace(<-TheAnswer) #prints out 42 --TheAnswer trace(<-TheAnswer) #prints out 0 =ENDEX =ENDCMD =CMD =COMMAND <-VARNAME value =DESC Reads the contents of the local variable VARNAME and pushes it to the stack. If VARNAME does not exist, 0 is pushed to the stack. =ENDDESC =EX #Increment a variable named 'i' by 1 and store the result back in 'i' <-i add(1) ->i =ENDEX =ENDCMD =CMD =COMMAND ->VARNAME (value) =DESC value ARG1: The value to pop from the stack and store in the heap at VARNAME.
Pops an item from the stack and stores it in the local variable named VARNAME. =ENDDESC =EX # Store coordinate points in local variables. # The points are defined once and assigned to local variables. once 10 ->x1 20 ->y1 40 ->x2 50 ->y2 endonce =ENDEX =ENDCMD =CMD =COMMAND -?VARNAME bool =DESC Checks to see if VARNAME exists (has been assigned). If so, 1 is pushed to the stack else 0. =ENDDESC =EX if (not(-?unit)) CreateUnit(10 20 "AmpGem") ->unit endif =ENDEX =ENDCMD =CMD =COMMAND <-! (string) value =DESC string ARG1: The string name of the heap variable to read. Reads the contents of the local variable and pushes it to the stack. This allows dynamic reading of variables. =ENDDESC =EX 42 ->someVar trace( <-!("someVar") ) =ENDEX =ENDCMD =CMD =COMMAND ->! (value string) =DESC value ARG1: The value to store.