This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| crpl:docs:getallunitsinrange [2013/10/27 05:13] – discovered what the bool is ThirdParty | crpl:docs:getallunitsinrange [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ~~DISCUSSION~~ | + | |
| <- [[crpl: | <- [[crpl: | ||
| ===== GetAllUnitsInRange | ===== GetAllUnitsInRange | ||
| + | (or GAUIR) | ||
| ^Arguments^Result^Notation^ | ^Arguments^Result^Notation^ | ||
| - | |Coordinates, | + | |Coordinates, |
| === Description === | === Description === | ||
| - | Returns | + | |
| + | Returns | ||
| If " | If " | ||
| === Examples === | === Examples === | ||
| + | Find all CRPL cores on the map | ||
| + | |||
| < | < | ||
| - | put example here | + | #Standard Notation |
| + | once | ||
| + | 0 0 9999 TRUE GetAllUnitsInRange 0 do | ||
| + | -> | ||
| + | |||
| + | <-unit GetUnitType " | ||
| + | " | ||
| + | endif | ||
| + | loop | ||
| + | endonce | ||
| + | </ | ||
| + | < | ||
| + | #Warp Notation | ||
| + | once | ||
| + | GetAllUnitsInRange(0 0 9999 TRUE) 0 do | ||
| + | -> | ||
| + | if(GetUnitType(< | ||
| + | Trace2(" | ||
| + | endif | ||
| + | loop | ||
| + | endonce | ||
| </ | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | Destroy every unit in range of the core this script is attached to | ||
| + | < | ||
| + | #Standard Notation | ||
| + | CurrentCoords 10 FALSE GetAllUnitsInRange 0 do | ||
| + | ->unit | ||
| + | |||
| + | <-unit CONST_DESTROYMODE GetUnitAttribute -> | ||
| + | |||
| + | <-unit < | ||
| + | loop | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | After 10 seconds, on coordinates (50, 50), if there is an Emitter there, destroy it, even if there are multiple units occupying that cell. | ||
| + | |||
| + | < | ||
| + | once | ||
| + | 300 SetTimer0 | ||
| + | endonce | ||
| + | |||
| + | GetTimer0 eq0 if | ||
| + | once | ||
| + | 50 50 0 TRUE GetAllUnitsInRange 0 do | ||
| + | -> | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | endif | ||
| + | loop | ||
| + | endonce | ||
| + | endif | ||
| + | </ | ||