User Tools

Site Tools


crpl:docs:define

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
crpl:docs:define [2013/01/19 01:51] grauniadcrpl:docs:define [2022/06/25 13:06] (current) – new format Karsten75
Line 1: Line 1:
-~~DISCUSSION~~ 
-<html><!--This is a comment--></html> 
 <- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#vars_and_functions|Vars and Functions]] <- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#vars_and_functions|Vars and Functions]]
  
 =====  $VARNAME:DEFAULT_VALUE  ===== =====  $VARNAME:DEFAULT_VALUE  =====
  
-^  Arguments  ^  Result  ^  Notation +===== Syntax =====
-| | |  %%-- %%  |+
  
 +$VAR:VAL
 +
 +===== Description =====
 +
 +Input variables must start with a $ sign and be placed before any of the actual code in a script. They define a variable named **VAR **with a default value of **VAL** which may be of type int, float or string.
 +
 +Input variables will show up in a unit's Script Settings when selected in the editor, this allows the editor to place the unit with a different value than the default specified in the script itself, but also allows the the value to be changed at any moment in time.
 +
 +Input variables are created at the same time as the unit itself (even if the game is paused and the script hasn't executed once) and assigned either the default value **VAL** (which may be overwritten if the initParams of a CreateUnit call specify it), or a value specified in the editor through the Script Settings.
  
-=== Description === 
-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 
 === Examples === === Examples ===
  
 Commands used in example: Commands used in example:
-* [[crpl:docs:currentcoords|CurrentCoords]] +  * [[crpl:docs:currentcoords|CurrentCoords]] 
-* [[crpl:docs:setcreeper|SetCreeper]] +  * [[crpl:docs:setcreeper|SetCreeper]] 
-* [[crpl:docs:delay|Delay]] +  * [[crpl:docs:delay|Delay]] 
-<code>+<code 4rpl>
 $amtToEmit:10  $amtToEmit:10 
 $interval:15  $interval:15 
 CurrentCoords <-amtToEmit SetCreeper  # At current location, create  $amtToEmit creeper CurrentCoords <-amtToEmit SetCreeper  # At current location, create  $amtToEmit creeper
-<-interval Delay                      # ddelay next action for the specified interval+<-interval Delay                      # delay next action for the specified interval
 </code>  </code> 
crpl/docs/define.1358578313.txt.gz · Last modified: 2014/10/01 15:02 (external edit)