Difference between revisions of "FindAllReferencesWithKeyword - ObjectReference"

Player is added to the array if the passed in keywords matches that of the keywords of the player.
imported>Digitalparanoid
imported>Scrivener07
(Player is added to the array if the passed in keywords matches that of the keywords of the player.)
Line 31: Line 31:
     i += 1
     i += 1
EndWhile
EndWhile
</source>
== Notes ==
* If wanting to grab all actors in the loaded area using the keywords, ActorTypeNPC or ActorTypeHuman, the player will also be added to the array as its race contains both of those keywords. If having the player be in the array is not intended, you need can remove it by checking for its formID of 20(decimal).
<source lang="papyrus">
int index = actorArray.Length
while index
    index -= 1
    if actorArray[index].GetFormID() == 20
        actorArray.Remove(index)
    endif
endWhile
</source>
</source>


Anonymous user