CountRefsLinkedToMe - ObjectReference

From Creation Kit
Jump to: navigation, search

Member of: ObjectReference Script

Returns the number of instantiated ObjectReferences who have a LinkedRef (with a specified keyword) to this reference. Can optionally specify an "exclude" keyword; refs with a linkedref using that keyword will not be counted.


int Function CountRefsLinkedToMe (Keyword apLinkKeyword = None, Keyword apExcludeKeyword = None) native


  • apLinkKeyword: In order to be counted, a ref must link to this ref with a LinkedRef using this Keyword. Can be None.
    • Default: None
  • apExcludeKeyword: In order to be counted, a ref must NOT have a keyworded LinkedRef that uses this Keyword. (If None, don't exclude on the basis of any keyword.)
    • Default: None

Return Value

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


;Get a count of instantiated non-"lookout" refs linked to the "turf" reference "Warehouse101Ref" via the "Turf" TurfKeyword
int warehouseCount = Warehouse101Ref.CountRefsLinkedToMe( TurfKeyword, LookoutKeyword )


If you're going to need the array of refs anyway, just use GetRefsLinkedToMe and ask the returned array for its size instead.

See Also