Background for Fallout 4
Member of the ObjectReference script
intfunctionCountActorsLinkedToMe(KeywordapLinkKeyword=NONE, KeywordapExcludeKeyword=NONE)Native

Description

Wiki Description

Returns the number of instantiated Actors (across all process levels) who have a LinkedRef (with a specified keyword) to this reference. Does not count dead, disabled, or deleted actors. Can optionally specify an "exclude" keyword; actors with a linkedref using that keyword will not be counted.

Documentation Comment

Get the count of all instantiated Actors (across all process levels) that link to this reference.
The actor must link to this ref with a keyworded linkedref using the keyword (apLinkKeyword).
Can optionally specify another keyword (apExcludeKeyword); actors with a linkedref using that keyword will be skipped when building the array.
(NOTE: if you're also necessarily going to call GetActorsLinkedToMe, just do that and check its size, instead of calling this.)


Caveats

CK Wiki - Notes

If you're going to get all of the actors anyway, just use ObjectReference.GetActorsLinkedToMe(...) and ask the returned array for its size instead.


Parameters

  1. KeywordapLinkKeyword=NONE

    CK Wiki Description

    In order to be counted, an actor must link to this ref with a LinkedRef using this Keyword. Can be None.

    • Default:None
  2. KeywordapExcludeKeyword=NONE

    CK Wiki Description

    In order to be counted, an actor must NOT have a keyworded LinkedRef that uses this Keyword. (If None, don't exclude on the basis of any keyword.)

    • Default:None

Examples

;Get a count of instantiated (across all process levels) non-"lookout" Actors linked to the "turf" reference "Warehouse101Ref" via the "Turf" TurfKeyword
int warehouseCount = Warehouse101Ref.CountActorsLinkedToMe( TurfKeyword, LookoutKeyword )

Auto-Generated Example

Keyword myKeyword__apLinkKeyword
Keyword myKeyword__apExcludeKeyword

int returnedValue = myObjectReference__toCallFunctionOn.CountActorsLinkedToMe(myKeyword__apLinkKeyword, myKeyword__apExcludeKeyword)

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.