FindRandomReferenceOfAnyTypeInListFromRef - Game

From Creation Kit
Jump to: navigation, search

Member of: Game Script

Finds a random reference of any of the types in the list from the given reference location and within the given radius.


ObjectReference Function FindRandomReferenceOfAnyTypeInListFromRef(FormList arBaseObjectsA, ObjectReference arCenter, \
  float afRadius) global


  • arBaseObjectsA: The list of valid base objects to look for
  • arCenter: The reference to use as a center of the search
  • afRadius: Maximum distance from center to look for a reference

Return Value

A random reference of of any of the types within the radius or the center reference, none if none was found.


; Find a random gem reference near the player, limiting the search to 5 units
ObjectReference randomGem = Game.FindRandomReferenceOfAnyTypeInListFromRef(GemList, Game.GetPlayer(), 5.0)

See Also