Complete Example Scripts: Difference between revisions

Jump to navigation Jump to search
m
→‎Making a Cool Cut-Scene: Indentation + PlayerREF Property
imported>JustinOther
(Added Maintenance/Update examples)
imported>JustinOther
m (→‎Making a Cool Cut-Scene: Indentation + PlayerREF Property)
Line 715: Line 715:


<Source lang="Papyrus">
<Source lang="Papyrus">
Scriptname Cutscene Extends ObjectReference
ScriptName Cutscene Extends ObjectReference
 


Actor Property PlayerREF Auto
ObjectReference Property Point1 Auto
ObjectReference Property Point1 Auto
ObjectReference Property Point2 Auto
ObjectReference Property Point2 Auto
ObjectReference Property Point3 Auto
ObjectReference Property Point3 Auto


Event OnTriggerEnter(ObjectReference akActionRef)
Event OnTriggerEnter(ObjectReference akActionRef)
        If akActionRef == Game.GetPlayer() ; Limit this trigger to the player only.
If akActionRef == PlayerREF ; Limit this trigger to the player only.
                  Game.GetPlayer().SetAlpha(0)
PlayerREF.SetAlpha(0)
                  Game.GetPlayer().SetGhost(True)
PlayerREF.SetGhost(True)
                  Game.DisablePlayerControls(true, true, true, false, true, false, true) ;Disables all controls except looking.
Game.DisablePlayerControls(True, True, True, False, True, False, True) ; Disable all controls except looking.
        Utility.Wait(0.1) ;Give the script time...
Utility.Wait(0.1) ; Give the script time...
                  Game.GetPlayer().TranslateToRef(Point1, 100)
PlayerREF.TranslateToRef(Point1, 100)
        Utility.Wait(5.0) ;After 5 seconds, proceed to next point.
Utility.Wait(5.0) ; After 5 seconds, proceed to next point.
                  Game.GetPlayer().TranslateToRef(Point2, 50)
PlayerREF.TranslateToRef(Point2, 50)
        Utility.Wait(10.0) ; After 10 seconds, go to next area
Utility.Wait(10.0) ; After 10 seconds, go to next area
                  Game.GetPlayer().TranslateToRef(Point3, 200)
PlayerREF.TranslateToRef(Point3, 200)
        Utility.Wait(20.0) ;Watch the final scene, and then...
Utility.Wait(20.0) ; Watch the final scene, and then...
                  Game.GetPlayer().SetAlpha(1)
PlayerREF.SetAlpha(1)
                  Game.GetPlayer().SetGhost(False)
PlayerREF.SetGhost(False)
                  Game.EnablePlayerControls()
Game.EnablePlayerControls()
        Endif
EndIf
EndEvent
EndEvent</Source>
</Source>


'''How to use this script''': Make a new trigger box, and then add this script to it. Make 3 XMarkers, and define them in the Properties Window. Enter your new trigger, and see your cool cut-scene!
'''How to use this script''': Make a new trigger box, and then add this script to it. Make 3 XMarkers, and define them in the Properties Window. Enter your new trigger, and see your cool cut-scene!
Anonymous user

Navigation menu