This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
4rpl:commands:getunitposition [2021/01/24 14:53] – added get/set tabs Sanian | 4rpl:commands:getunitposition [2022/06/21 10:18] – [Examples] workaround for no return value Karsten75 | ||
---|---|---|---|
Line 13: | Line 13: | ||
Get the 3D position of a unit. A vector is returned. | Get the 3D position of a unit. A vector is returned. | ||
is the height, or elevation, of the unit. | is the height, or elevation, of the unit. | ||
+ | |||
+ | Note: If this call is attempted on an non-existing unit, nothing will be put on the stack. | ||
===== Examples ===== | ===== Examples ===== | ||
Line 20: | Line 22: | ||
< | < | ||
+ | |||
+ | A " | ||
+ | |||
+ | <code 4rpl> | ||
+ | Trace (@UnitPos(7) ) | ||
+ | |||
+ | :unitPos | ||
+ | StackSize -> | ||
+ | GetUnitPosition | ||
+ | If (Stacksize < | ||
+ | Return | ||
+ | else | ||
+ | V3(-1 -1 -1) | ||
+ | endif | ||
+ | </ |