Background for Fallout 4
Member of the ObjectReference script
ObjectReference[]functionGetLinkedRefChain(KeywordapKeyword=NONE, intiMaxExpectedLinkedRefs=100)Native

Description

Wiki Description

This function returns an array of objectreferences representing the "linked ref chain" hanging of the reference it is called on. For example. If myObject has linkedref to ObjectA which has a linkedref to ObjectB which has a linkedref to ObjectC, and you call myObject.GetLinkedRefChain() it will return an array holding ObjectA, ObjectB, and ObjectC.

Documentation Comment

Returns a chain of linked refs as an array,
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. intiMaxExpectedLinkedRefs=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

; get the refs in a linked ref chain to us
ObjectReference[] LinkedRefs = GetLinkedRefChain()
; Get the refs in a linked ref chain, following the keyword
ObjectReference[] LinkedRefs = GetLinkedRefChain(LightKeyword)
; Enable the refs in a linked ref chain
ObjectReference[] LinkedRefs = GetLinkedRefChain()
int i = LinkedRefs.length
while (i > 0)
    i -= 1
    LinkedRefs[i].EnableNoWait()
endwhile

Auto-Generated Example

keyword myKeyword__apKeyword
int myInt__iMaxExpectedLinkedRefs

ObjectReference[] returnedValue = myObjectReference__toCallFunctionOn.GetLinkedRefChain(myKeyword__apKeyword, myInt__iMaxExpectedLinkedRefs)

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.