Background for Fallout 4
Member of the EncounterZone script
intfunctionCountActors(KeywordapRequiredLinkedRefKeyword=NONE, KeywordapExcludeLinkedRefKeyword=NONE)Native

Description

Wiki Description

Gets the number of instantiated Actors (across all process levels) who belong to this encounter zone. Skips over dead, disabled, or deleted actors. Can optionally specify keywords for a linkedref that they MUST have, and/or a linkedref they must NOT have.

Documentation Comment

Get the count of all instantiated Actors (across all process levels) who belong to this encounter zone.
Can optionally specify a keyword for a linkedref that they must have (apRequiredLinkedRefKeyword), and/or a linkedref keyword they must NOT have (apExcludeLinkedRefKeyword).
(Presence or absence of the keywordless linkedref cannot be checked.)
(NOTE: if you're also necessarily going to call GetActors, just do that and check its size, instead of calling this.)


Parameters

  1. KeywordapRequiredLinkedRefKeyword=NONE

    CK Wiki Description

    If specified, Actors MUST have a LinkedRef using this Keyword, in order to be counted. If None, don't require any linkedref.

    • Default:None
  2. KeywordapExcludeLinkedRefKeyword=NONE

    CK Wiki Description

    If specified, SKIP OVER Actors that have a LinkedRef using this Keyword when doing the count. If None, don't exclude on the basis of any linkedref.

    • Default:None

Examples

;Count the number of instantiated non-"lookout" Actors (across all process levels) in the encounter zone "Warehouse101"
int actorCount = Warehouse101Zone.CountActors( None, LookoutKeyword )

Auto-Generated Example

Keyword myKeyword__apRequiredLinkedRefKeyword
Keyword myKeyword__apExcludeLinkedRefKeyword

int returnedValue = myEncounterZone__toCallFunctionOn.CountActors(myKeyword__apRequiredLinkedRefKeyword, myKeyword__apExcludeLinkedRefKeyword)

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.