Difference between revisions of "FindAllReferencesWithKeyword - ObjectReference"

imported>Gawdl3y
 
imported>Digitalparanoid
Line 19: Line 19:
== Examples ==
== Examples ==
<source lang="papyrus">
<source lang="papyrus">
; Find all refs that match the keywords in the merchant listwithin 200 units of the activator
; Find all references with the ActorTypeAnimal keyword within 200 distance units of the player
ObjectReference[] sellarray = ActiRef.FindAllReferencesOfType(MerchantKeywordList, 200.0)
ObjectReference[] kActorArray = Game.GetPlayer().FindAllReferencesWithKeyword(ActorTypeAnimal, 200.0)


; Find all refs with keyword Raider within 200 units of the activator
; Find all references that match ALL keywords in the actor type formlist within 200 distance units of the player
ObjectReference[] raiderrefarray = ActiRef.FindAllReferencesOfType(Raider, 200.0)
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
</source>
</source>