Resource: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)
Syntax[edit]
int Function CountLinkedRefChain(keyword apKeyword = None, int maxExpectedLinkedRefs = 100) native
Parameters[edit]
- 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[edit]
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.
Examples[edit]
; 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)
