Background for Starfield
Member of the ObjectReference script
intfunctionCountRefsLinkedToMe(KeywordapLinkKeyword=NONE, KeywordapExcludeKeyword=NONE)Native

Description

Wiki Description

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.

Documentation Comment

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


Caveats

CK Wiki - Notes

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


Parameters

  1. KeywordapLinkKeyword=NONE

    CK Wiki Description

    In order to be counted, a ref 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, 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

Examples

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

Auto-Generated Example

Keyword myKeyword__apLinkKeyword
Keyword myKeyword__apExcludeKeyword

int returnedValue = myObjectReference__toCallFunctionOn.CountRefsLinkedToMe(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.