My latest experimental script's gone a tad awry, and I can't fathom why.
What Im essentially trying to do is the following:
- Player activates button. Button hits up script (see below). The script essentially calls up a message window with 3 options.
Clicking the first option will take you to another message window. There are 9 buttons in this window, and each button runs off a condition. If the condition is true, the button is displayed (in this instance, only once button out of the 9 will ever be displayed when the message box opens). Clicking any of these buttons in this message window will set a global variable. This global variable is then conditionalised in a terminal and shown if true.
This is my complexed way of storing locations for my mod.
Now. My problem is two fold and I can't fathom why.
To explain it better, let's get descriptive.
Hitting the button brings up the Menu window. Hitting option 1 shows another window. There'll be 8 buttons to choose from here (but only one of these 8 will be shown due to a condition - this part works fine), but then the 9th button for this message box is a sort of 'next page' button. Hitting it will open a Second message box with a further 8 options as before (minus the 9th 'Next Page') button.
Now this 'seems' to work fine if you take out the first message box with the 3 options.
But the way I've worked it, is this.
Menu 1: 3 options. Hitting option 1 takes you to "Option 1's First Menu". Hitting option 2 takes you to "Option 2 Menu"
Option 1's First Menu: There are 9 buttons, 8 of these will set a global variable to an amount (each one different), the 9th will take you to "Option 1's 2nd Menu".
Option 1's 2nd Menu: The same as the first menu, with different amounts, but this time, no 9th option.
Menu 2 does the same as the above, but it change's the global variable you are setting. So essentially, it doesn't affect it.
The way I'm calling this is through a series of If statements.
I'll drop the code below. If you could take a look, throw abuse at me for my terrible scripting grammar and jog some assistance. I know what I need to do and how to go about it, but bringing it together in perfction is pretty tricky.
Thanks guyss

scn TARDISdataStorageSCRIPTshort Buttonshort menuChoice begin onActivate playerShowMessage TARDISdatastoreStartupendbegin gameModeset Button to GetButtonPressedif menuChoice == 0if ( Button == 0 ) set menuChoice to 1 showmessage TARDISdatastore1elseif ( Button == 1 ) set menuChoice to 3 showmessage TARDISdatastore1 elseif ( Button == 2 ) set menuChoice to 5 showmessage TARDISdatastore1elseif ( Button == 3 ) endifendifif menuChoice == 1if ( Button == 0 ) set tardisdstore1 to 1 showmessage TARDISdstore1setelseif ( Button == 1 ) set tardisdstore1 to 2 ShowMessage TARDISdstore1set elseif ( Button == 2 ) set tardisdstore1 to 3 ShowMessage TARDISdstore1setelseif ( Button == 3 ) set tardisdstore1 to 4 ShowMessage TARDISdstore1setelseif ( Button == 4 ) set tardisdstore1 to 5 ShowMessage TARDISdstore1setelseif ( Button == 5 ) set tardisdstore1 to 6 ShowMessage TARDISdstore1set elseif ( Button == 6 ) set tardisdstore1 to 7 ShowMessage TARDISdstore1set elseif ( Button == 7 ) set tardisdstore1 to 8 ShowMessage TARDISdstore1set elseif ( Button == 8 ) set menuChoice to 2 ShowMessage TARDISdatastore1aelseif ( Button == 9 ) set menuChoice to 0endifendifif menuChoice == 2 if ( Button == 0 ) set menuChoice to 0 set tardisdstore1 to 9 showmessage TARDISdstore1setelseif ( Button == 1 ) set menuChoice to 0 set tardisdstore1 to 10 ShowMessage TARDISdstore1set elseif ( Button == 2 ) set menuChoice to 0 set tardisdstore1 to 11 ShowMessage TARDISdstore1setelseif ( Button == 3 ) set menuChoice to 0 set tardisdstore1 to 12 ShowMessage TARDISdstore1set elseif ( Button == 4 ) set menuChoice to 0 set tardisdstore1 to 13 ShowMessage TARDISdstore1set elseif ( Button == 5 ) set menuChoice to 0 set tardisdstore1 to 14 ShowMessage TARDISdstore1set elseif ( Button == 6 ) set menuChoice to 0 set tardisdstore1 to 15 ShowMessage TARDISdstore1set elseif ( Button == 7 ) set menuChoice to 0 set tardisdstore1 to 17 ShowMessage TARDISdstore1setelseif ( Button == 8 ) set menuChoice to 0 set tardisdstore1 to 18 ShowMessage TARDISdstore1setelseif ( Button == 9 ) set menuChoice to 0endifendifif menuChoice == 3 if ( Button == 0 ) set menuChoice to 0 set tardisdstore2 to 1 showmessage TARDISdstore1setelseif ( Button == 1 ) set menuChoice to 0 set tardisdstore2 to 2 ShowMessage TARDISdstore1set elseif ( Button == 2 ) set menuChoice to 0 set tardisdstore2 to 3 ShowMessage TARDISdstore1setelseif ( Button == 3 ) set menuChoice to 0 set tardisdstore2 to 4 ShowMessage TARDISdstore1set elseif ( Button == 4 ) set menuChoice to 0 set tardisdstore2 to 5 ShowMessage TARDISdstore1set elseif ( Button == 5 ) set menuChoice to 0 set tardisdstore2 to 6 ShowMessage TARDISdstore1set elseif ( Button == 6 ) set menuChoice to 0 set tardisdstore2 to 7 ShowMessage TARDISdstore1set elseif ( Button == 7 ) set menuChoice to 0 set tardisdstore2 to 8 ShowMessage TARDISdstore1set elseif ( Button == 8 ) set menuChoice to 4 ShowMessage TARDISdatastore1aelseif ( Button == 9 ) set menuChoice to 0endifendifif menuChoice == 4 if ( Button == 0 ) set menuChoice to 0 set tardisdstore2 to 9 showmessage TARDISdstore1setelseif ( Button == 1 ) set menuChoice to 0 set tardisdstore2 to 10 ShowMessage TARDISdstore1set elseif ( Button == 2 ) set menuChoice to 0 set tardisdstore2 to 11 ShowMessage TARDISdstore1setelseif ( Button == 3 ) set menuChoice to 0 set tardisdstore2 to 12 ShowMessage TARDISdstore1set elseif ( Button == 4 ) set menuChoice to 0 set tardisdstore2 to 13 ShowMessage TARDISdstore1set elseif ( Button == 5 ) set menuChoice to 0 set tardisdstore2 to 14 ShowMessage TARDISdstore1set elseif ( Button == 6 ) set menuChoice to 0 set tardisdstore2 to 15 ShowMessage TARDISdstore1set elseif ( Button == 7 ) set menuChoice to 0 set tardisdstore2 to 17 ShowMessage TARDISdstore1setelseif ( Button == 8 ) set menuChoice to 0 set tardisdstore2 to 18 ShowMessage TARDISdstore1setelseif ( Button == 9 ) set menuChoice to 0endifendifend