Difference between revisions of "Complete Example Scripts"

Jump to navigation Jump to search
1,081 bytes added ,  06:20, 3 November 2014
Added an array for enabling aliases.
imported>Terra Nova2
imported>Terra Nova2
(Added an array for enabling aliases.)
Line 788: Line 788:
EndIf
EndIf
EndEvent
EndEvent
</source>
== Enabling ReferenceAlias using an array ==
'''Requires basic knowledge in Quest creation.'''
Say you want to enable currently disabled ReferenceAliases in the quest but you don't feel like a ton of typing and need more than one to be enabled.
That's easy to do with an array.
<source lang=papyrus>
Function EnableActorsArray(ReferenceAlias[] myAliasArray, Bool abSpecifyQuest=false, Quest akQuest=none, int aiStage=0)
; Enable aliases when needed. Make sure "ALLOW DISABLED" box checked, and the REFERENCE's "Initially Disabled" box is checked!
; Can optionally have them enable on a specific quest stage of a quest that is different from the alias' parent quest. Requires that abSpecificQuest is set to the true.
int i = 0
if abSpecifyQuest == false
While i < myAliasArray.length
myAliasArray[i].GetReference().Enable()
i += 1
debug.trace("Iterating:" + i)
EndWhile
else
if (akQuest.GetCurrentStageID() == aiStage)
    While i < myAliasArray.length
        myAliasArray[i].GetReference().Enable()
        i +=1
    EndWhile
endif
endif
EndFunction
</source>
</source>
{{Languages}}
{{Languages}}
[[Category: Papyrus]]
[[Category: Papyrus]]
Anonymous user

Navigation menu