Background for Starfield
Member of the ObjectReference script
intfunctionCountLinkedRefChain(KeywordapKeyword=NONE, intmaxExpectedLinkedRefs=100)Native

Description

Wiki Description

This function counts the number of linked refs that are in a linked Ref chain (example: A is linked to B is linked to C - this function will return 3)

Documentation Comment

This function counts the number of linked refs that are in a linked Ref chain (ie object is linked to A, A is linked to B, etc. this then counts all the linked refs.)
Aborts early if it detects a loop


Parameters

  1. KeywordapKeyword=NONE

    CK Wiki Description

    Keyword to check ref link against (see ObjectReference.GetLinkedRef(...).)

    • Default:None
  2. intmaxExpectedLinkedRefs=100

    CK Wiki Description

    Maximum number of expected links. The function stops checking after it finds this many or finishes finding all of them.

    • Default:100

Examples

; Count the number of refs in a linked ref chain to us
int numLinkedRefs = countLinkedRefChain()
; Count the number of refs in a linked ref chain, following the specified keyword for each one
int numLinkedRefs = countLinkedRefChain(LightKeyword)

Auto-Generated Example

Keyword myKeyword__apKeyword
int myInt__maxExpectedLinkedRefs

int returnedValue = myObjectReference__toCallFunctionOn.CountLinkedRefChain(myKeyword__apKeyword, myInt__maxExpectedLinkedRefs)

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.