Difference between revisions of "Messagebox Tutorial/Set Variables"
Jump to navigation
Jump to search
Added Generalization disclaimer
imported>Qazaaq (Unfinished Article) |
imported>Haama (Added Generalization disclaimer) |
||
Line 1: | Line 1: | ||
This is a subsection of the [[MessageBox Tutorial]], and uses [[MessageBox_Tutorial#Activator_Script|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). | |||
---- | |||
This code 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 <u>'''''Return to Previous Menu'''''</u>. 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) | This code 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 <u>'''''Return to Previous Menu'''''</u>. 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>... | <pre>... | ||
Line 93: | Line 97: | ||
[[Category: | [[Category: Scripting Tutorials]] |