This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| crpl:docs:setwall [2013/01/14 19:04] – created chani | crpl:docs:setwall [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | TODO | + | |
| + | <- [[crpl: | ||
| + | ===== SetWall | ||
| + | |||
| + | ^Arguments^Result^Notation^ | ||
| + | |X, Y, Amt(0-1)| |'' | ||
| + | |||
| + | |||
| + | === Description === | ||
| + | Sets wall values at specified coordinates. | ||
| + | The amount must be in the range of 0 to 1 where 0 means no wall, and 1 means a full health wall. | ||
| + | === Examples === | ||
| + | Create a rectangle of permanent walls that can't ever be destroyed by Creeper, by repairing them every 9 seconds. | ||
| + | |||
| + | This example will create a square of walls, with the first corner being at X1, | ||
| + | < | ||
| + | $wallX1: | ||
| + | $wallY1: | ||
| + | $wallX2: | ||
| + | $wallY2: | ||
| + | |||
| + | GetTimer0 eq0 if | ||
| + | 270 SetTimer0 | ||
| + | |||
| + | < | ||
| + | < | ||
| + | I J 1 SetWall | ||
| + | loop | ||
| + | loop | ||
| + | endif | ||
| + | </ | ||
| + | |||
| + | Spawn walls under this unit based on its cell width and cell height. Repair these walls every 9 seconds, effectively making them Crazonium (invincible) walls. | ||
| + | < | ||
| + | GetTimer0 eq0 if | ||
| + | 270 SetTimer0 | ||
| + | |||
| + | CurrentX ->x | ||
| + | CurrentY ->y | ||
| + | |||
| + | Self CONST_CELLWIDTH GetUnitAttribute -> | ||
| + | Self CONST_CELLHEIGHT GetUnitAttribute -> | ||
| + | |||
| + | < | ||
| + | < | ||
| + | |||
| + | <-y < | ||
| + | <-x < | ||
| + | I J 1 SetWall | ||
| + | loop | ||
| + | loop | ||
| + | endif | ||
| + | </ | ||