User Tools

Site Tools


4rpl:commands:define2

Differences

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

Link to this comparison view

Next revision
Previous revision
4rpl:commands:define2 [2021/01/13 22:24] – created virgilw4rpl:commands:define2 [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 1: Line 1:
-~~NOTOC~~ + <=[[4rpl:start| Index]]
-<=[[4rpl:start| Index]]+
  
-=== Description === +====== Hidden Input Variables ======
-Defines an input variable, that is not shown in the editor. Input variables are created at script start and assigned either the default value. Input variables that should not appear in the UI editor must start with $$ signs. +
  
-=== Examples === +===== Syntax ===== 
-<code 4rpl>$$amt:+ 
 +$$VARNAME:VAL 
 + 
 +===== Description ===== 
 + 
 +Hidden input variables must start with ''%%$$%%'' and be placed, together with other 
 +[[4rpl:commands:define|input variables]], before  
 +any of the actual code in a script.  
 +They define a variable named **VARNAME **with a default value of **VAL** which may be of type int, float or string. 
 + 
 +Unlike normal input variables, hidden input variables do not show up in a unit's Script Settings when selected  
 +in the editor, they are just a convenient way for defining some standard values at the start of a script. 
 + 
 +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 the default value **VAL**, which may be overwritten if the initParams  
 +of a [[4rpl:commands:CreateUnit |CreateUnit ]]call specify it. 
 + 
 +===== Examples ===== 
 + 
 +<code 4rpl> 
 +$$amt:
 SetCreeper(10 10 <-amt)  SetCreeper(10 10 <-amt) 
 </code> </code>
 +
 +=== See Also ===
 +  * [[4rpl:commands:define|input variables]]
 +
 + <=[[4rpl:start| Index]]
 +~~NOTOC~~
 +
4rpl/commands/define2.1610576678.txt.gz · Last modified: 2025/02/14 14:56 (external edit)