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
crpl:docs:define [2020/02/02 16:11] – Removed obsolete markup Karsten75crpl:docs:define [2022/06/25 13:06] (current) – new format Karsten75
Line 3: Line 3:
 =====  $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 ===
  
Line 17: Line 21:
   * [[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 
crpl/docs/define.txt · Last modified: 2022/06/25 13:06 by Karsten75