Difference between revisions of "MessageBox Tutorial"

Jump to navigation Jump to search
348 bytes removed ,  00:18, 15 September 2007
→‎Activator Script: Using Variable-Loaded method, changed around extra button info
imported>Haama
(→‎Activator: Note on Reference Editor ID)
imported>Haama
(→‎Activator Script: Using Variable-Loaded method, changed around extra button info)
Line 335: Line 335:
===Activator Script===
===Activator Script===
<pre>scn YourMenuScript
<pre>scn YourMenuScript
Short Working
Short Choosing
Short Choosing
Short Choice
Short Choice
short Reset




Line 343: Line 343:
Begin onActivate
Begin onActivate
   Set Choosing to -1
   Set Choosing to -1
   Set Reset to 1
   Set Working to 1
  If (GetInSameCell player == 0) ;always keep it near the player
    MoveTo player
  Endif
End
End


Line 352: Line 349:


Begin GameMode
Begin GameMode
If Working
   If (Choosing == 0) ;meaning it shouldn't be running
   If (Choosing == 0) ;meaning it shouldn't be running
     If Reset
     Set Working to 0
      ;Add anything that needs to be re-initialized,
    ;Add anything that needs to be re-initialized,
      ;  or that you changed in the onActivate block that needs to be reset
      
      Set Reset to 0
    Endif
     If (GetInSameCell YourXMarker == 0)
      MoveTo YourXMarker
    Endif
 
 
   Elseif (Choosing == -1) ;Display your menu
   Elseif (Choosing == -1) ;Display your menu
     Messagebox "Which option?" "First Option" "Second 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
Line 377: Line 368:
       ;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
;...  
;...
;Further illustrations of more options
;    Elseif (Choice == 9) ;Tenth Option
;    Elseif (Choice == #) ;Nth Option
      ;run your code for the tenth decision
      ;run your code for the nth decision
;      Set Choosing to 0 ;to finish up
;      Set Choosing to 0
 
;    Elseif (Choice == 9) ;Final/Tenth Option
      ;run your code for the tenth decision
;      Set Choosing to 0
     Endif
     Endif
   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 <pr>YourActivatorsReferenceEditorID.Activate player, 1</pre>.
Anonymous user

Navigation menu