Background for Fallout 4
Member of the Game script
ObjectReferencefunctionFindRandomReferenceOfTypeFromRef(FormarBaseObject, ObjectReferencearCenter, floatafRadius)Global

Description

Wiki Description

Finds a random ObjectReference of the given type from the center of the target ObjectReference and within the given radius.

Documentation Comment

Finds a random reference of a given base object within a given radius of a reference


Caveats


Parameters

FormarBaseObject

CK Wiki Description

The type of base object to look for

ObjectReferencearCenter

CK Wiki Description

The ObjectReference to use as the center of the search

floatafRadius

CK Wiki Description

Maximum distance from center to look for a ObjectReference


Examples

; Find a random diamond reference near the player, limiting the search to 5 units
ObjectReference randomDiamond = Game.FindRandomReferenceOfTypeFromRef(Diamond, Game.GetPlayer(), 5.0)

Auto-Generated Example

Form myForm__arBaseObject
ObjectReference myObjectReference__arCenter
float myFloat__afRadius

ObjectReference returnedValue = Game.FindRandomReferenceOfTypeFromRef(myForm__arBaseObject, myObjectReference__arCenter, myFloat__afRadius)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.