Difference between revisions of "Bethesda Tutorial Basic Quest Scripting"

m
imported>AlexanderKenneth
(→‎Writing the Script: Adding code that should have been there.)
imported>Lmstearn
 
(5 intermediate revisions by 4 users not shown)
Line 105: Line 105:
Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)
Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)
if (newContainer == Game.GetPlayer())
if (newContainer == Game.GetPlayer())
                GSQ01.SetObjectivedisplayed(30)
GSQ01.SetStage(30)
GSQ01.SetStage(30)
endif
endif
EndEvent
EndEvent
</source>
</source>
Ignore it once again. It will be explained in the section about objectives.


There a few things to note in this script:
There a few things to note in this script:
Line 120: Line 123:
You can now play through the quest from start to finish, checking the console with [[ShowQuestVars|SQV]] to see its stage changing.  
You can now play through the quest from start to finish, checking the console with [[ShowQuestVars|SQV]] to see its stage changing.  


Players can't use the console, though, so we'll learn how to give them better feedback about the quest in the next chapter.  
Players can't be expected to use the console, though, so we'll learn how to give them better feedback about the quest in the next chapter.  


{{ProTip|The scripts for Skyrim are just text files that live in your data directory before they get compiled into bytecode. This means that if you've got a favorite text editor, you can use it to work on scripts. We've included setups for both [[Sublime Text Setup|Sublime Text]] and [[Notepad++ Setup|Notepad++]] that provide syntax highlighting, some basic autocompletion, and compilation shortcuts. If you're going to get heavily into scripting, these tools can make your life a lot easier.}}
{{ProTip|The scripts for Skyrim are just text files that live in your data directory before they get compiled into bytecode. This means that if you've got a favorite text editor, you can use it to work on scripts. We've included setups for both [[Sublime Text Setup|Sublime Text]] and [[Notepad++ Setup|Notepad++]] that provide syntax highlighting, some basic autocompletion, and compilation shortcuts. If you're going to get heavily into scripting, these tools can make your life a lot easier.}}


=Notes=
* Papyrus boxes can be [http://forums.bethsoft.com/topic/1513334-no-viable-alternative-at-input/ temperamental] after the wrong code is inserted. Okaying the form and returning to it and possibly restarting the CK can resolve.
* Removing a saved script from a papyrus box may not automatically remove the associated compiled pex in the script folder, which has an impact on testing in-game.


{{Tutorial_Bottom_Bar
{{Tutorial_Bottom_Bar
Line 129: Line 137:
|Next=Bethesda_Tutorial_Quest_Objectives
|Next=Bethesda_Tutorial_Quest_Objectives
}}
}}
{{Languages}}
Anonymous user