User Tools

Site Tools


crpl:docs:getwall

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
crpl:docs:getwall [2018/05/01 20:22] – add example Grabzcrpl:docs:getwall [2018/05/10 22:18] (current) – removed mistakenly added SetWall example, added a GetWall example Grabz
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 heightRepair these walls every 10 secondseffectively making them Crazonium (invinciblewalls.+This script will check if there is any single wall piece under the CRPL core this script is attached toIf there isit will trace 1 (TRUE), if not, it will trace 0 (FALSE).
 <code> <code>
-GetTimer0 eq0 if +CurrentX ->x 
- 300 SetTimer0+CurrentY ->y
  
- CurrentX ->x +Self CONST_CELLWIDTH GetUnitAttribute ->cellWidth 
- CurrentY ->y+Self CONST_CELLHEIGHT GetUnitAttribute ->cellHeight
  
- Self CONST_CELLWIDTH GetUnitAttribute ->cellWidth +<-cellWidth 2 div ->cellWidthRadius 
- Self CONST_CELLHEIGHT GetUnitAttribute ->cellHeight+<-cellHeight 2 div ->cellHeightRadius
  
- <-cellWidth 2 div ->cellWidthRadius +FALSE ->isAnyWallUnderMe
- <-cellHeight 2 div ->cellHeightRadius+
  
- <-y <-cellHeightRadius add 1 add <-y <-cellHeightRadius sub do +#iterate over all cells occupied by me 
- <-x <-cellWidthRadius add 1 add <-x <-cellWidthRadius sub do +<-y <-cellHeightRadius add 1 add <-y <-cellHeightRadius sub do 
- I J 1 SetWall + <-x <-cellWidthRadius add 1 add <-x <-cellWidthRadius sub do 
- loop+ I J GetWall ->wall 
 + <-wall 0 gt if 
 + TRUE ->isAnyWallUnderMe 
 + endif
  loop  loop
-endif +loop 
-</code> + 
 +ShowTraceLog 
 +<-isAnyWallUnderMe Trace 
 +</code>
crpl/docs/getwall.txt · Last modified: 2018/05/10 22:18 by Grabz