This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 4rpl:commands:define [2021/01/13 22:24] – virgilw | 4rpl:commands:define [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ~~NOTOC~~ | + | < |
| - | < | + | |
| - | === Description === | + | ====== Input Variables ====== |
| - | Defines an input variable. Input variables are created at script | + | |
| + | ===== 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 | ||
| + | |||
| + | 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 | ||
| + | |||
| + | |||
| + | ===== Examples ===== | ||
| + | |||
| + | <code 4rpl> | ||
| + | # input vars go at the top of a script, before the actual code | ||
| + | $amt:1 | ||
| + | $text:" | ||
| + | $e:2.71828 | ||
| - | === Examples === | ||
| - | <code 4rpl> | ||
| SetCreeper(10 10 < | SetCreeper(10 10 < | ||
| </ | </ | ||
| + | |||
| + | ~~NOTOC~~ | ||
| + | |||