Complete Example Scripts: Difference between revisions

Jump to navigation Jump to search
m
→‎A Fully Functional Dwemer Button: GetPlayer swapped for PlayerREF | Removed extraneous/unused ObjSelf property
imported>JustinOther
imported>JustinOther
m (→‎A Fully Functional Dwemer Button: GetPlayer swapped for PlayerREF | Removed extraneous/unused ObjSelf property)
Line 228: Line 228:
<source lang="papyrus">Scriptname DwemerButtonExampleScript extends ObjectReference   
<source lang="papyrus">Scriptname DwemerButtonExampleScript extends ObjectReference   


ObjectReference property objSelf auto hidden
Actor Property PlayerREF Auto
Sound property QSTAstrolabeButtonPressX auto
Sound Property QSTAstrolabeButtonPressX Auto


Event OnCellAttach() ; this event runs when cell is loaded containing this scripted object
Event OnCellAttach() ; this event runs when cell is loaded containing this scripted object
Line 236: Line 236:


Event OnActivate(ObjectReference akActionRef)
Event OnActivate(ObjectReference akActionRef)
if akActionRef == Game.GetPlayer()
If akActionRef == PlayerREF
PlayAnimationAndWait("Trigger01", "done") ;--- sound and animation
PlayAnimationAndWait("Trigger01", "done") ; sound and animation
        if (QSTAstrolabeButtonPressX)
        If QSTAstrolabeButtonPressX
    QSTAstrolabeButtonPressX.Play(Self)
    QSTAstrolabeButtonPressX.Play(Self)
        endif
        EndIf
        Debug.MessageBox("Joy!") ;actual code for what button should do
        Debug.MessageBox("Joy!") ; actual code for what button should do
endif
EndIf
EndEvent</source>
EndEvent</source>


Anonymous user

Navigation menu