Difference between revisions of "MessageBox Tutorial/External Menu Selection"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Haama
(Added Generalization disclaimer)
imported>Haama
(Removed from category)
 
(2 intermediate revisions by 2 users not shown)
Line 20: Line 20:
Also, if you want to allow the menu to be reset if it's still trying to catch the player's choice ([[GetButtonPressed]] keeps returning -1), then use
Also, if you want to allow the menu to be reset if it's still trying to catch the player's choice ([[GetButtonPressed]] keeps returning -1), then use
<pre>  if (Choosing >= 0)</pre>
<pre>  if (Choosing >= 0)</pre>
instead.
instead of
 
<pre>  if (Choosing == 0)</pre>
 
[[Category: Scripting Tutorials]]

Latest revision as of 18:06, 3 June 2008

This is a subsection of the MessageBox Tutorial, and uses this script as a base. The following code may or may not require certain aspects of that script to work, however the information should prove useful for any script (it will take a bit of care to make it work, though).


As it's setup now, the first menu the player sees will always be the same. If you want to start with a different menu, set Choosing to your desired menu, as such:

set YourActivator.Choosing to -2 ;the "Food" menu in the example
YourActivator.Activate player, 1

You need to make one small change to your menu script as well. Change

begin onActivate
  set Choosing to -1
...

to

begin onActivate
  if (Choosing == 0)
    set Choosing to -1
  endif
...

Also, if you want to allow the menu to be reset if it's still trying to catch the player's choice (GetButtonPressed keeps returning -1), then use

  if (Choosing >= 0)

instead of

  if (Choosing == 0)