FindAllReferencesWithKeyword - ObjectReference

Revision as of 13:43, 11 May 2016 by imported>Digitalparanoid (→‎Examples)

Member of: ObjectReference Script

Finds all references with any required keywords in the loaded area within the given radius of the calling ref.

Syntax

ObjectReference[] Function FindAllReferencesWithKeyword(Form arKeywordOrList, float afRadius) native

Parameters

  • arKeywordOrList: Keyword to look for or form list of keywords which ref must have all of
  • afRadius: Maximum distance from ref to look for a reference

Return Value

An array of references with the required keywords within the radius, empty if none was found.

Examples

; Find all references with the ActorTypeAnimal keyword within 200 distance units of the player
ObjectReference[] kActorArray = Game.GetPlayer().FindAllReferencesWithKeyword(ActorTypeAnimal, 200.0)

; Find all references that match ALL keywords in the actor type formlist within 200 distance units of the player
ObjectReference[] kActorArray = Game.GetPlayer().FindAllReferencesWithKeyword(ActorTypeFormlist, 200.0)

; Find all references that match ANY keyword in the actor type formlist within 200 distance units of the player
Int i = 0
While i < ActorTypeFormlist.GetSize()
    ObjectReference[] kActorArray = Game.GetPlayer().FindAllReferencesWithKeyword(ActorTypeFormlist.GetAt(i), 200.0)
    i += 1
EndWhile

See Also