Difference between revisions of "Messagebox Tutorial/Set Variables"
no edit summary
imported>Haama (New page: Though not a necessary part of every menu, this is a nice bit of code. This allows the player to use a menu to set a variable to any number (I suppose it's limited by the short/long variab...) |
imported>Haama |
||
|
Though not a necessary part of every menu, this is a nice bit of code. This allows the player to use a menu to set a variable to any number (I suppose it's limited by the short/long variable limits). Basically, the player is given the current number the variable is set to, and is allowed to change it from -2 to +2. If they want to change it by more than that, they can modify it by -10, -5, +5, or +10 and then the menu is displayed again, with the new number. This allows the player to select any number (i.e., if they want -3, they would choose "-5" and then "+2"). Due to the limit of the number of choices available, there can only be one other option. For most, this option should be "Return to Previous Menu". Here's an example: (NumNewIngsDefault is the variable that the player is setting. Also, due to wiki limitations, the messagebox has several line breaks even though these wouldn't be in the CS script)
<pre> elseif (Choosing == -22)
messagebox "Set the default number of essences to be created.
(Currently %g)", NumNewIngsDefault,
"About 10 fewer (-12 to -8)"
"About 5 fewer (-7 to -3)"
"Default to that amount -2"
"Default to that amount -1"
"Default to that amount"
"Default to that amount +1"
"Default to that amount +2"
"About 5 more (+3 to +7)"
"About 10 more (+8 to +12)"
"Return to previous menu"
set Choosing to 22
set Choice to GetButtonPressed
| |||