Mod:Creation Kit/CountLinkedRefChain - ObjectReference

Member of: ObjectReference Script

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)

Parameters

 * apKeyword: Keyword to check ref link against (see GetLinkedRef.)
 * Default: None
 * maxExpectedLinkedRefs: Maximum number of expected links. The function stops checking after it finds this many or finishes finding all of them.
 * Default: 100

Return Value
The total number of linked refs chained together or maxExpectedLinkedRefs, whichever is less. It will also stop and return the current count if it detects a loop.