Message button conditions? Is this a joke?

Post » Thu Jun 21, 2012 1:00 am

Do message boxes with multiple buttons, and different conditions on the buttons, not always return the same number for a certain button when using show()?


I noticed that my message box has 0-5 as different options, but I only wanted them to appear based on certain conditions. Button 6 is a "exit" button to leave the menu. I noticed that when this message box comes up, the buttons with conditions work properly, I can only see the buttons I want to see. However, when I click exit, it is acting as if I have pressed a button other than button 6, because my script is not getting the value 6 in my variably when I do ButtonPressed = Message.Show().

Does it seriously number the buttons AFTER the conditions are checked? So if I have 4 buttons, A, B, C, and D in slots 0, 1, 2, 3 in the editor, and the conditions for button A and B are not met in game, then when the user clicks on C it will return 0 and when they click D it will return 1?

Is that what is happening? If so, who is the genius that thought that was a good idea. That completely precludes the whole premise of having conditions in the messages, because now you have to go back and do some complex scripting to determine what the hell the number that got returned even means!


Someone please help.
User avatar
Benito Martinez
 
Posts: 3470
Joined: Thu Aug 30, 2007 6:33 am

Post » Wed Jun 20, 2012 3:35 pm

Unless they changed it, that shouldn't be how it works... I had messages in Fallout 3, and New Vegas where option 0 had conditions, but option 1 was ALWAYS shown, and even when 0 wasn't displayed, 1 still fired. (Which would, if it was programmed poorly like you suggest, make it button 0, not 1)

I doubt they would change that, thus breaking the entire system and making it all useless... Can anyone confirm/deny?
User avatar
Liii BLATES
 
Posts: 3423
Joined: Tue Aug 22, 2006 10:41 am

Post » Thu Jun 21, 2012 2:36 am

MessageBoxes are listed numerically in order from 0-9, if they are disabled they are still numbered 0-9, just the disabled ones will be left out, no shifting of the indexes occurs. I've used MessageBoxes extensively as a menu system, with conditioned and non-conditioned elements.


Op1 Op2 Op3 Op4 Op5 Exit
0 -- 1 -- 2 -- 3 -- 4 -- 5

If Op3 is disabled the indexing remains the same

Op1 Op2 Op4 Op5 Exit
0 -- 1 -- 3 -- 4 -- 5
User avatar
Claire Vaux
 
Posts: 3485
Joined: Sun Aug 06, 2006 6:56 am

Post » Wed Jun 20, 2012 4:10 pm

+1 for what PurpleLunchbox said. I was using menus as an interface in my alt-start mod and it always worked perfectly fine. At least until the menu text stretched off screen and it became clear that it wasn't going to get fixed.
User avatar
Becky Cox
 
Posts: 3389
Joined: Thu Jun 22, 2006 8:38 am

Post » Thu Jun 21, 2012 3:06 am

Yeah, the button indices don't change, so even if 0-8 are hidden and 9 is the "Done" button, hitting button 9 will still execute the "Done" code even if its the only button displayed.

*adds note to http://www.creationkit.com/Options_Menu#Notes*
User avatar
JESSE
 
Posts: 3404
Joined: Mon Jul 16, 2007 4:55 am

Post » Thu Jun 21, 2012 6:00 am

Cast your variable as a String and put it in Debug.MessageBox to see what value you get. According to the gentlemen above it should be 6, so best confirm what you actually get. Something else may be wrong.
User avatar
BRAD MONTGOMERY
 
Posts: 3354
Joined: Mon Nov 19, 2007 10:43 pm

Post » Thu Jun 21, 2012 12:13 am

I have resorted to making 'multi-menu' menu's. I only allow 0-5 buttons per menu, so the buttons don't get truncated off the screen. Button 5 is a 'next' button, which then shows the next 0-5 menu buttons, and so on.
I also keep the button text as short as I can. If I use abbreviations, I put them in the question text above the buttons since its a wrapping text box.
User avatar
naome duncan
 
Posts: 3459
Joined: Tue Feb 06, 2007 12:36 am

Post » Thu Jun 21, 2012 4:53 am

Notification() text seems to scale. Would be nice if the same were true of button text or, even better, if we could just list buttons from top to bottom by using a parameter for Show() or something. Imagine http://i.imgur.com/xPBTt.jpg on a 4:3 ...
User avatar
Jinx Sykes
 
Posts: 3501
Joined: Sat Jan 20, 2007 11:12 pm

Post » Wed Jun 20, 2012 8:23 pm

Turns out I was an idiot and wrote my if statements incorrectly, which was what was giving me this behavior. My bad!
User avatar
Kirsty Wood
 
Posts: 3461
Joined: Tue Aug 15, 2006 10:41 am


Return to V - Skyrim