Difference between revisions of "MessageBox Tutorial"

108 bytes added ,  10:37, 15 April 2010
no edit summary
imported>Haama
(→‎Activator Disadvantages: Moved set Working to top to stop infinite looping)
imported>Darkness X
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Tools|req0=[[The Elder Scrolls Construction Set|Construction Set]]|opt0=[[OBSE]]}}
==Intro==
==Intro==
Most MessageBox mistakes are made when simple scripts are used as a base for more complex menu scripts. To prevent this, this tutorial will work towards a single all-purpose script that can be used and expanded for any situation. By the end, you will know the problems that can pop-up in a menu script, how to prevent them, and why every line of the all-purpose script is needed.
Most MessageBox mistakes are made when simple scripts are used as a base for more complex menu scripts. To prevent this, this tutorial will work towards a single all-purpose script that can be used and expanded for any situation. By the end, you will know the problems that can pop-up in a menu script, how to prevent them, and why every line of the all-purpose script is needed.
Line 176: Line 177:
   endif
   endif
end</pre>
end</pre>
Note that each menu has a pair of corresponding numbers: Main menu, -1/1; Armor menu, -10/10; Weapon menu, -11/11. When you set Choosing to the corresponding number, that menu will be shown. You can find more information in the [[MessageBox Tutorial#Moving Between Multiple Menus]] section.
Note that each menu has a pair of corresponding numbers: Main menu, -1/1; Armor menu, -10/10; Weapon menu, -11/11. When you set Choosing to the corresponding number, that menu will be shown. You can find more information in the [[MessageBox Tutorial#Moving Between Multiple Menus|Moving Between Multiple Menus]] section.


===Running the same choice for multiple frames===
===Running the same choice for multiple frames===
Line 275: Line 276:
<pre>short Working
<pre>short Working
...
...
begin onActiavte
begin onActivate
...
...
   set Working to 1
   set Working to 1
Line 294: Line 295:


====Other methods====
====Other methods====
* [[MessageBox_Tutorial:_Quest_Scripts|Quests]]
* [[MessageBox_Tutorial/Quest_Scripts|Quests]]
* [[MessageBox_Tutorial:_Token_Scripts|Tokens]]
* [[MessageBox_Tutorial/Token_Scripts|Tokens]]
* [[MessageBox_Tutorial:_Spell_Scripts|Spells]]
* [[MessageBox_Tutorial/Spell_Scripts|Spells]]


===What you'll need===
===What you'll need===
Line 412: Line 413:
Begin GameMode
Begin GameMode
   If Working
   If Working
    Set Working to 1
     If (Choosing == 0) ;meaning it shouldn't be running
     If (Choosing == 0) ;meaning it shouldn't be running
       Set Working to 0
       Set Working to 0
Line 521: Line 524:
       Endif
       Endif
     Endif
     Endif
    Set Working to 1
   Endif
   Endif
End</pre>
End</pre>
Line 528: Line 529:
==Extras==
==Extras==
That will take care of most menu systems you'll ever want to create. However, there is still more functioniality you can add to your menus. From here, you can either get it all by using the following script, or pick and choose using the mini-tutorials:
That will take care of most menu systems you'll ever want to create. However, there is still more functioniality you can add to your menus. From here, you can either get it all by using the following script, or pick and choose using the mini-tutorials:
<br>[[MessageBox_Tutorial:_Centralized_Decision_Catching|Centalizing your decision catching]]
<br>[[MessageBox_Tutorial/Centralized_Decision_Catching|Centalizing your decision catching]]
<br>[[Messagebox_Tutorial:_GameMode_And_MenuMode|Running menus in both GameMode and MenuMode when your script is too large]]
<br>[[Messagebox_Tutorial/GameMode_And_MenuMode|Running menus in both GameMode and MenuMode when your script is too large]]
<br>[[MessageBox_Tutorial:_Ensuring_Your_Menu_Is_Seen|Ensuring your menus are seen]]
<br>[[MessageBox_Tutorial/Ensuring_Your_Menu_Is_Seen|Ensuring your menus are seen]]
<br>[[Messagebox_Tutorial:_Set_Variables|Allowing the player to set a variable to any number]]
<br>[[Messagebox_Tutorial/Set_Variables|Allowing the player to set a variable to any number]]
<br>[[MessageBox_Tutorial:_External_Menu_Selection|Controlling the menu system via external scripts]]
<br>[[MessageBox_Tutorial/External_Menu_Selection|Controlling the menu system via external scripts]]


==Applying it all==
==Applying it all==
Line 566: Line 567:
Begin GameMode ;Running menus in both GameMode and MenuMode
Begin GameMode ;Running menus in both GameMode and MenuMode
   If Working
   If Working
    Set Working to 1
     If (Choosing == 0)
     If (Choosing == 0)
       Set GMRun to 0
       Set GMRun to 0
Line 606: Line 609:
       Set Choosing to 0
       Set Choosing to 0
     Endif
     Endif
    Set Working to 1
   Endif
   Endif
End
End
Line 614: Line 616:
Begin MenuMode
Begin MenuMode
   If Working
   If Working
    Set Working to 1
     If (Choosing == 0)
     If (Choosing == 0)
       Set GMRun to 0 ;Running menus in both GameMode and MenuMode
       Set GMRun to 0 ;Running menus in both GameMode and MenuMode
Line 712: Line 716:
           endif
           endif
     Endif
     Endif
    Set Working to 1
   Endif
   Endif
End</pre>
End</pre>
[[Category: Scripting Tutorials]]
[[Category: Scripting Tutorials]]
Anonymous user