Difference between revisions of "FindRandomActorFromRef - Game"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Rhavlovick
m (1 revision: Clobber re-import by Henning)
 
imported>Thingy Person
Line 8: Line 8:
<source lang="papyrus">
<source lang="papyrus">
Actor Function FindRandomActorFromRef(ObjectReference arCenter, float afRadius) global
Actor Function FindRandomActorFromRef(ObjectReference arCenter, float afRadius) global
return FindRandomActor(arCenter.X, arCenter.Y, arCenter.Z, afRadius)
endFunction
</source>
</source>



Revision as of 18:31, 29 June 2013

Member of: Game Script

Finds a random actor within a given radius of a reference.

Syntax

Actor Function FindRandomActorFromRef(ObjectReference arCenter, float afRadius) global
	return FindRandomActor(arCenter.X, arCenter.Y, arCenter.Z, afRadius)
endFunction

Parameters

  • arCenter: The reference to search around
  • afRadius: Maximum distance from center to look for an actor

Return Value

A random actor found, none if no actor in the area.

Examples

; Find a random actor near the player, limiting the search to 5 units
Actor randomActor = Game.FindRandomActorFromRef(Game.GetPlayer(), 5.0)

See Also