Difference between revisions of "FindAllReferencesWithKeyword - ObjectReference"

→‎Notes: Found easier non pulling method to remove the player from the array.
imported>Digitalparanoid
imported>Scrivener07
(→‎Notes: Found easier non pulling method to remove the player from the array.)
 
(2 intermediate revisions by the same user not shown)
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 can remove it via [[Find - Array]] and then [[Remove - Array]]:
<source lang="papyrus">
Actor Player = Game.GetPlayer()
ObjectReference[] kActors = Player.FindAllReferencesWithKeyword(ActorTypeNPC, 2048.0)
int playerIndex = kActors.Find(Player as Actor)
kActors.Remove(playerIndex)
</source>
</source>


Anonymous user