DisableLinkChain - ObjectReference: Difference between revisions

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Scornett
m (Reverted edits by Scornett-Bot (talk) to last revision by Jlundin)
 
m (Convert source tags to syntaxhighlight)
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:


== Syntax ==
== Syntax ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
Function DisableLinkChain(Keyword apKeyword = None)
Function DisableLinkChain(Keyword apKeyword = None, bool abFadeOut = false)
</source>
ObjectReference CurrentLink = GetLinkedRef(apKeyword)
While CurrentLink
CurrentLink.Disable(abFadeOut)
CurrentLink = CurrentLink.GetLinkedRef(apKeyword)
endWhile
endFunction
</syntaxhighlight>


== Parameters ==
== Parameters ==
Line 19: Line 25:


== Examples ==
== Examples ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; Disable every ref linked to startRef in a chain
; Disable every ref linked to startRef in a chain
startRef.DisableLinkChain()
startRef.DisableLinkChain()
</source>
</syntaxhighlight>
<br>
<br>
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
; disable every ref linked to startRef using the special keyword
; disable every ref linked to startRef using the special keyword
startRef.DisableLinkChain(SpecialKeyword)
startRef.DisableLinkChain(SpecialKeyword)
</source>
</syntaxhighlight>


== Notes ==
== Notes ==

Latest revision as of 19:56, 5 September 2026

Member of: ObjectReference Script

This function disables all the linked refs, linked in a chain, from this reference.

Syntax[edit | edit source]

Function DisableLinkChain(Keyword apKeyword = None, bool abFadeOut = false)
	ObjectReference CurrentLink = GetLinkedRef(apKeyword)
	While CurrentLink
		CurrentLink.Disable(abFadeOut)
		CurrentLink = CurrentLink.GetLinkedRef(apKeyword)
	endWhile
endFunction

Parameters[edit | edit source]

  • apKeyword: Keyword to check ref link against (see GetLinkedRef.)
    • Default: None

Return Value[edit | edit source]

None

Examples[edit | edit source]

; Disable every ref linked to startRef in a chain
startRef.DisableLinkChain()


; disable every ref linked to startRef using the special keyword
startRef.DisableLinkChain(SpecialKeyword)

Notes[edit | edit source]

Do not use this on a link chain that is linked in a loop or it will cause an endless loop.

See Also[edit | edit source]