User Tools

Site Tools


4rpl:commands:nearestspecialtarget

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:nearestspecialtarget [2023/09/24 12:42] – LOS mention Vertu4rpl:commands:nearestspecialtarget [2024/03/28 20:22] (current) – Moved Karsten75
Line 1: Line 1:
-~~NOTOC~~ 
-<=[[4rpl:start| Index]] 
  
-:!: Available in version 1.3 and later. 
-====== GetNearestSpecialTarget====== 
-GetNearestSpecialTarget(<-specialTarget <-worldPosition <-range <-includeIsBuilding) ->unit 
- 
-===== Description ===== 
-Finds the nearest unit that is tagged as a special target within range (a float) from worldPosition (a vector3). The 'specialTarget' argument is a V4 that specifies the target types. See [[GetUnitSpecialTarget]]. 
- 
-If no unit matching the special target parameter is found, -1 is returned. 
- 
-:NOTE: For clarification: Line Of Sight is not factored. If you want to use this API with LOS restrictions, see [[4rpl:commands:getterrainlos|GetTerrainLOS]]. 
-             
-===== Examples ===== 
-<code 4rpl> 
-GetNearestSpecialTarget(V4(1 1 0 0) GetUnitPosition(self) GetUnitRange(self) false) ->unit 
-</code> 
- 
-<=[[4rpl:start| Index]] 
4rpl/commands/nearestspecialtarget.1695573755.txt.gz · Last modified: 2023/09/24 12:42 by Vertu