CountActorsLinkedToMe - ObjectReference

Member of: ObjectReference Script

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.

SyntaxEdit

int Function CountActorsLinkedToMe ( apLinkKeyword = None, apExcludeKeyword = None ) native

ParametersEdit

  • apLinkKeyword: In order to be counted, an actor must link to this ref with a LinkedRef using this Keyword. Can be None.
    • Default: None
  • apExcludeKeyword: 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

Return ValueEdit

The number of instantiated Actors (across all process levels) who are linked to this reference, using a LinkedRef with the specified keyword (and who meet the exclude keyword criteria, if one is provided).

ExamplesEdit

;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 )

NotesEdit

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

See AlsoEdit