FindClosestActorFromRef

From GECK
Jump to: navigation, search


A function added by the SUP NVSE Plugin.

Description

Finds the closest actor to a given reference.

Syntax

[help]
(Actor:ref) FindClosestActorFromRef includeDead:int includeTeammates:int fDistance:float

Example

set RandomActorRef to PlayerRef.FindClosestActorFromRef

Will try to find closest actor to Player.

set RandomActorRef to ObjectRef.FindClosestActorFromRef 1 0 3000

Will try to find closest actor to ObjectRef within 3000 radius (including dead).

Notes

  • This function will look for actors in the currently loaded interior cell or set of exterior cells adjacent to (and including) the player's current cell (with processing-Levels of 0).
  • The player is not included in the search. Consider using GetDistance3D to check if the "closest actor" given by this function is closer than the player.

See Also