Background for Fallout 4
Member of the ObjectReference script
ObjectReferencefunctionGetNthLinkedRef(intaiLinkedRef, KeywordapKeyword=NONE)Native

Description

Wiki Description

Gets the Nth linked ref from this object.

Documentation Comment

Returns the Nth linked ref from this reference (0 = self, 1 = GetLinkedRef, 2 = GetLinkedRef.GetLinkedRef, etc)


Caveats

CK Wiki - Notes

If you are operating on multiple linked refs in a chain it is generally faster to use ObjectReference.GetLinkedRefChain(...) and use the resulting array directly.


Parameters

intaiLinkedRef

CK Wiki Description

The linked ref to get. 0 will return this object, 1 will return the same as ObjectReference.GetLinkedRef(...) with no keyword parameter, 2 will return essentially "GetLinkedRef().GetLinkedRef()", and so on.

KeywordapKeyword=NONE

CK Wiki Description

The keyword chain to follow (see ObjectReference.GetLinkedRef(...)).

  • Default:None

Examples

; Assume Item3 is the linked ref of Item2, which is the linked ref of Item1
ObjectReference linkedRef1 = Item1.GetNthLinkedRef(0) ; Returns Item1
ObjectReference linkedRef2 = Item1.GetNthLinkedRef(1) ; Returns Item2
ObjectReference linkedRef3 = Item1.GetNthLinkedRef(2) ; Returns Item3
; Assume Item3 is the linked ref of Item2, which is the linked ref of Item1, all through the special keyword
ObjectReference linkedRef1 = Item1.GetNthLinkedRef(0, SpecialKeyword) ; Returns Item1
ObjectReference linkedRef2 = Item1.GetNthLinkedRef(1, SpecialKeyword) ; Returns Item2
ObjectReference linkedRef3 = Item1.GetNthLinkedRef(2, SpecialKeyword) ; Returns Item3

Auto-Generated Example

int myInt__aiLinkedRef
Keyword myKeyword__apKeyword

ObjectReference returnedValue = myObjectReference__toCallFunctionOn.GetNthLinkedRef(myInt__aiLinkedRef, myKeyword__apKeyword)

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.