This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| crpl:docs:getwall [2013/01/14 19:10] – external edit 127.0.0.1 | crpl:docs:getwall [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | <- [[crpl: | ||
| =====  GetWall | =====  GetWall | ||
| 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 === | ||
| - | < | + | 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). | 
| + | < | ||
| + | CurrentX ->x | ||
| + | CurrentY ->y | ||
| + | |||
| + | Self CONST_CELLWIDTH GetUnitAttribute -> | ||
| + | Self CONST_CELLHEIGHT GetUnitAttribute -> | ||
| + | |||
| + | <-cellWidth 2 div -> | ||
| + | < | ||
| + | |||
| + | FALSE ->isAnyWallUnderMe | ||
| + | #iterate over all cells occupied by me | ||
| + | <-y < | ||
| + | <-x < | ||
| + | I J GetWall ->wall | ||
| + | <-wall 0 gt if | ||
| + | TRUE -> | ||
| + | endif | ||
| + | loop | ||
| + | loop | ||
| + | ShowTraceLog | ||
| + | < | ||
| + | </ | ||