This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| crpl:docs:getwall [2018/05/02 00:22] – add example Grabz | crpl:docs:getwall [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 11: | Line 11: | ||
| Values in between represent varying degrees of health for the wall. | Values in between represent varying degrees of health for the wall. | ||
| === Examples === | === Examples === | ||
| - | Spawn walls under this unit based on its cell width and cell height. Repair these walls every 10 seconds, effectively making them Crazonium | + | This script will check if there is any single wall piece under the CRPL core this script is attached to. If there is, it will trace 1 (TRUE), if not, it will trace 0 (FALSE). | 
| < | < | ||
| - | GetTimer0 eq0 if | + | CurrentX ->x | 
| - | 300 SetTimer0 | + | CurrentY ->y | 
| - | CurrentX | + | Self CONST_CELLWIDTH GetUnitAttribute | 
| - | CurrentY | + | Self CONST_CELLHEIGHT GetUnitAttribute | 
| - | Self CONST_CELLWIDTH GetUnitAttribute | + | <-cellWidth | 
| - | Self CONST_CELLHEIGHT GetUnitAttribute | + | <-cellHeight | 
| - | < | + | FALSE ->isAnyWallUnderMe | 
| - | < | + | |
| - | <-y < | + | #iterate over all cells occupied by me | 
| - | <-x < | + | <-y < | 
| - | I J 1 SetWall | + | <-x < | 
| - | loop | + | I J GetWall ->wall | 
| + | <-wall 0 gt if | ||
| + | TRUE -> | ||
| + | endif | ||
| loop | loop | ||
| - | endif | + | loop | 
| - | </ | + | |
| + | ShowTraceLog | ||
| + | < | ||
| + | </ | ||