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 | |||
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 == PlayerREF ; Limit this trigger to the player only. | |||
PlayerREF.SetAlpha(0) | |||
PlayerREF.SetGhost(True) | |||
Game.DisablePlayerControls(True, True, True, False, True, False, True) ; Disable all controls except looking. | |||
Utility.Wait(0.1) ; Give the script time... | |||
PlayerREF.TranslateToRef(Point1, 100) | |||
Utility.Wait(5.0) ; After 5 seconds, proceed to next point. | |||
PlayerREF.TranslateToRef(Point2, 50) | |||
Utility.Wait(10.0) ; After 10 seconds, go to next area | |||
PlayerREF.TranslateToRef(Point3, 200) | |||
Utility.Wait(20.0) ; Watch the final scene, and then... | |||
PlayerREF.SetAlpha(1) | |||
PlayerREF.SetGhost(False) | |||
Game.EnablePlayerControls() | |||
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! | ||