Mod:Creation Kit/FindRandomReferenceOfAnyTypeInListFromRef - Game

Member of: Mod:Creation Kit/Game Script

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

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

Parameters

 * 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 any of the types within the radius or the center reference, none if none was found.

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