Difference between revisions of "MessageBox Tutorial/Quest Scripts"

Fixed
imported>Speedo
(Add errors tag - see Talk)
imported>Haama
(Fixed)
{{Errors}}
 
==Some background==
Quest scripts are very similar to the activator script. However, just like the activator script the quest script will require a bit of extra coding.
Short Choice
Short Working
Float fQuestDelayTime
 
 
 
If (Choosing == 0) ;meaning it shouldn't be running
StopQuest YourMenuYourMenuScript▼
;Add anything that needs to be re-initialized
Return
 
# Make sure to save the script as a Quest Script.
# Attach the script to the quest.
# You can start your menus from any script with <pr>set YourMenu.Working to 1</pre>.
<pre>set YourMenu.WorkingfQuestDelayTime to 1.01▼
set YourMenu.Working to 1
StartQuest YourMenu</pre>▼
 
==Notes on using StartQuest/StopQuest==
YouThe canabove useuses StopQuest and StartQuest to control when the quest is running. This will prevent the extra '''if''' testslines from running, but:when they doesn't need to be. [StartQuest#Notes|Be careful when using StartQuest and make sure you don't start it when it's already running.]
 
# You will need to remember to stop it
The other option is to let the script run all the time. Use the same scripts as above but get rid of the StartQuest and StopQuest lines and set the quest to '''Start Game Enabled'''.
<pre>...
if (Choosing == 0)
▲ StopQuest YourMenu
...</pre>
# You will need to remember to use
▲<pre>set YourMenu.Working to 1
▲StartQuest YourMenu</pre>
every time you want to use it.
# It will take a couple of seconds after using [[StartQuest]] before the quest starts up.
# Using ''StartQuest'' can be dangerous, as using ''StartQuest'' on a quest that is already running will reset all of it's variables to 0.
 
[[Category:Scripting Tutorials]]
Anonymous user