Difference between revisions of "MessageBox Tutorial"

Jump to navigation Jump to search
50 bytes added ,  00:19, 15 September 2007
m
imported>Haama
(→‎Activator Script: Using Variable-Loaded method, changed around extra button info)
imported>Haama
Line 349: Line 349:


Begin GameMode
Begin GameMode
If Working
  If Working
  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
    ;Add anything that needs to be re-initialized,
      ;Add anything that needs to be re-initialized,
      
      
  Elseif (Choosing == -1) ;Display your menu
    Elseif (Choosing == -1) ;Display your menu
    Messagebox "Which option?" "First Option" "Second Option" ... "Tenth Option"
      Messagebox "Which option?" "First Option" "Second Option" ... "Tenth Option"
    Set Choosing to 1
      Set Choosing to 1
    Set Choice to -1
      Set Choice to -1


  Elseif (Choosing == 1) ;Catch the player's decision
    Elseif (Choosing == 1) ;Catch the player's decision
    If (Choice == -1) ;No choice yet
      If (Choice == -1) ;No choice yet
      Set Choice to GetButtonPressed
        Set Choice to GetButtonPressed
    Elseif (Choice == 0) ;First Option
      Elseif (Choice == 0) ;First Option
      ;run your code for the first decision
        ;run your code for the first decision
      Set Choosing to 0 ;to finish up
        Set Choosing to 0 ;to finish up
    Elseif (Choice == 1) ;Second Option
      Elseif (Choice == 1) ;Second Option
      ;run your code for the second decision
        ;run your code for the second decision
      Set Choosing to 0 ;to finish up
        Set Choosing to 0 ;to finish up
;...
;...
;   Elseif (Choice == 9) ;Tenth Option
;     Elseif (Choice == 9) ;Tenth Option
      ;run your code for the tenth decision
        ;run your code for the tenth decision
;     Set Choosing to 0 ;to finish up
;       Set Choosing to 0 ;to finish up


      Endif
     Endif
     Endif
    Set Working to 1
   Endif
   Endif
  Set Working to 1
Endif
End</pre>
End</pre>
You can start your menus from any script with <pr>YourActivatorsReferenceEditorID.Activate player, 1</pre>.
You can start your menus from any script with <pre>YourActivatorsReferenceEditorID.Activate player, 1</pre>.


==Moving Between Multiple Menus==
==Moving Between Multiple Menus==
Anonymous user

Navigation menu