User Tools

Site Tools


4rpl:commands:getunits

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
4rpl:commands:getunits [2021/10/13 10:48] – Grammar Karsten754rpl:commands:getunits [2024/03/21 18:05] (current) – Fixed minor conflation of UID with GUID qople
Line 8: Line 8:
 ===== Description ===== ===== Description =====
 Returns list of units in range of a given position. The returned list is sorted so that the first item in the list is the closest.\\  Returns list of units in range of a given position. The returned list is sorted so that the first item in the list is the closest.\\ 
- 
- 
-For short range searches refer to the [[cw4:4rpl_unit_search_analysis|unit search analysis]] to see how the different parameters interact with finding units in a short range. 
  
   ? unitType:   ? unitType:
-  : a string indicating the [[unit types|unit type]]((Unit Type can also be the UID of a CMOD)) to return. If empty string (""), then all units are searched.+  : a string indicating the [[unit types|unit type]]((Unit Type can also be the GUID of a CMOD)) to return. If empty string (""), then all units are searched.
   ? startPos:   ? startPos:
   : a V3 (vector3) indicating the point to search outwards from.   : a V3 (vector3) indicating the point to search outwards from.
Line 19: Line 16:
   : a floating point number that is the maximum distance from startPos.   : a floating point number that is the maximum distance from startPos.
   ? isSquare:   ? isSquare:
-  : a boolean. It means to check in a square rather than a circle around startPos. For 3D checks, the vertical displacement is also checked (so the range is effectivly a cube rather than a sphere). +  : a boolean. It means to check in a square rather than a circle around startPos. For 3D checks, the vertical displacement is also checked (so the range is effectivly a cube rather than a sphere). :!: __Bug__: if isSquare is true, then the startPos vector will ignore the Z-value.
   ? is3D:   ? is3D:
   : a boolean. It determines if a true 3d distance is used for range, or if only the X and Z components (2D) distance calculation is used.   : a boolean. It determines if a true 3d distance is used for range, or if only the X and Z components (2D) distance calculation is used.
Line 30: Line 27:
   ? imperviousState:   ? imperviousState:
   : an int (either 0,1,2). 0 = ignore impervious state. 1 = Only find units that are not impervious. 2 = Only find units that are impervious. Things like ore deposits are impervious.   : an int (either 0,1,2). 0 = ignore impervious state. 1 = Only find units that are not impervious. 2 = Only find units that are impervious. Things like ore deposits are impervious.
 +
 +For short range searches refer to the [[cw4:4rpl_unit_search_analysis|unit search analysis]] to see how the different parameters interact with finding units in a short range.
  
 ===== Examples ===== ===== Examples =====
4rpl/commands/getunits.1634136531.txt.gz · Last modified: 2021/10/13 10:48 by Karsten75