Complete Example Scripts: Difference between revisions

Jump to navigation Jump to search
m
imported>JustinOther
m (→‎Set Quest Stage When Picked Up By Player: Removed extra line breaks/parenthesis)
imported>JustinOther
Line 242: Line 242:


=A Fully Functional Dwemer Button=
=A Fully Functional Dwemer Button=
<source lang="papyrus">
<source lang="papyrus">Scriptname DwemerButtonExampleScript extends ObjectReference   
Scriptname DwemerButtonExampleScript extends ObjectReference   


ObjectReference property objSelf auto hidden
ObjectReference property objSelf auto hidden
Sound property QSTAstrolabeButtonPressX auto
Sound property QSTAstrolabeButtonPressX auto


;==================
Event OnCellAttach() ; this event runs when cell is loaded containing this scripted object
 
;this event runs when cell is loaded containing
;this scripted object
 
Event OnCellAttach()
PlayAnimation("Open")
PlayAnimation("Open")
EndEvent
EndEvent
;==================


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


'''To Make This Script Work'''
'''To Make This Script Work'''
* You must create this script on a Activator object, probably a dwemer button :)
* You must create this script on a Activator object, probably a dwemer button :)
* You must then set the property for the QST sound effect property, the sound file has the same name as the property in the script above.
* You must then set the property for the QST sound effect property, the sound file has the same name as the property in the script above.


'''To make your own dwemer button and avoid messing with the original Skyrim scripts/activators:'''  
'''To make your own dwemer button and avoid messing with the original Skyrim scripts/activators:'''  
* Extract the dwemer button .nif file from the Meshes.bsa and create a new activator using that .nif file (picking the mesh to use is an option in the activator edit window).  
* Extract the dwemer button .nif file from the Meshes.bsa and create a new activator using that .nif file (picking the mesh to use is an option in the activator edit window).  
* You must put your extracted .nif file in the skyrim/Data/meshes directory structure if you want the Creation Kit to be able to find and use it.
* You must put your extracted .nif file in the skyrim/Data/meshes directory structure if you want the Creation Kit to be able to find and use it.
To extract files from the Skyirm .BSA files you must download something like the Fallout3 Archive Utility, do a google search for this.
To extract files from the Skyirm .BSA files you must download something like the Fallout3 Archive Utility, do a google search for this.


=Set Quest Stage When Picked Up By Player=
=Set Quest Stage When Picked Up By Player=
Anonymous user

Navigation menu