This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| crpl:docs:setwall [2013/01/14 19:11] – external edit 127.0.0.1 | crpl:docs:setwall [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | <- [[crpl: | ||
| ===== SetWall | ===== SetWall | ||
| Line 10: | Line 11: | ||
| The amount must be in the range of 0 to 1 where 0 means no wall, and 1 means a full health wall. | The amount must be in the range of 0 to 1 where 0 means no wall, and 1 means a full health wall. | ||
| === Examples === | === 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:32 | ||
| + | $wallY1:32 | ||
| + | $wallX2:64 | ||
| + | $wallY2:64 | ||
| + | |||
| + | 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 | ||
| + | </ | ||