Multiple ShowMessage Menu's

Post » Tue Mar 15, 2011 12:01 am

Evening!

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

User avatar
Setal Vara
 
Posts: 3390
Joined: Thu Nov 16, 2006 1:24 pm

Post » Mon Mar 14, 2011 8:08 pm

You might want to add some commands to make the script skip everything if it's waiting for input, and have the waiting for input enabled only when a message is newly displayed.

Here's a good tutorial: http://www.cipscis.com/fallout/tutorials/menu.aspx


scn TARDISdataStorageSCRIPTshort Buttonshort menuChoice	short AwaitingInput								begin onactivate playerShowMessage TARDISdatastoreStartupset AwaitingInput to 1endbegin gameMode		if (AwaitingInput)			set Button to GetButtonPressed			if (Button > -1)       			set AwaitingInput to 0			else				return			endif                 endif			if menuChoice == 0				if ( Button == 0 ) 					set menuChoice to 1					showmessage TARDISdatastore1					set AwaitingInput to 1				elseif ( Button == 1 ) 					set menuChoice to 3					showmessage TARDISdatastore1					set AwaitingInput to 1								... etc

User avatar
Niisha
 
Posts: 3393
Joined: Fri Sep 15, 2006 2:54 am

Post » Mon Mar 14, 2011 3:02 pm

You don't need to "await input".


A snip from my own script. This is only a 2 menu level script however. To make it 3 levels you would need a second menu variable, or assign more values for the 3rd level menus.
SCN EBCScriptShort ButtonShort Menu;0 - N/A;1 - Main Menu;2 - Fission Batteries (FB);3 - Micro Fusion Cells (MFC);4 - Small Energy Cells (SEC);5 - Electron Charge Packs (EPC);6 - Special Conversions (SC)Short iTempA ;How many you have totalShort iTempB ;How many to giveShort iTempC ;How many to takeBegin OnActivate	ShowMessage EchoBCMain	Set Menu to 1EndBegin GameMode	If Menu == 1		Set Button To GetButtonPressed			If Button == -1				Return			Elseif Button == 0 ;Fission Batteries				ShowMessage EchoBCFB				Set Menu To 2			Elseif Button == 1 ;Micro Fusion Cells				ShowMessage EchoBCMFC				Set Menu To 3			Elseif Button == 2 ;Small Energy Cells				ShowMessage EchoBCSEC				Set Menu To 4			Elseif Button == 3 ;Electron Charge Packs				ShowMessage EchoBCECP				Set Menu To 5			Elseif Button == 4 ; Special Conversions				ShowMessage EchoBCSC				Set Menu To 6			Elseif Button == 5 ; Pick-up				Set Menu To 0				Activate					EndIf						If Menu == 2 ;Fission Batteries				Set Button To getButtonPressed					If Button == -1						Return					ElseIf Button == 0						If Player.GetItemCount AmmoMicroFusionCell >= 25							Player.RemoveItem AmmoMicroFusionCell 25							Player.AddItem FissionBattery 1						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 1						If Player.GetItemCount AmmoMicroFusionCell >= 125							Player.RemoveItem AmmoMicroFusionCell 125							Player.AddItem FissionBattery 5						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 2						Set iTempA To Player.GetItemCount AmmoMicroFusionCell						Set iTempB To iTempA/25						Set iTempC To iTempB*25						If iTempA >= 25							Player.RemoveItem AmmoMicroFusionCell iTempC							Player.AddItem FissionBattery iTempB						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 3						If Player.GetItemCount AmmoSmallEnergyCell >= 50							Player.RemoveItem AmmoSmallEnergyCell 50							Player.AddItem FissionBattery 1						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 4						If Player.GetItemCount AmmoSmallEnergyCell >= 250							Player.RemoveItem AmmoSmallEnergyCell 250							Player.AddItem FissionBattery 5						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 5						Set iTempA To Player.GetItemCount AmmoSmallEnergyCell						Set iTempB To iTempA/25						Set iTempC To iTempB*25						If iTempA >= 25							Player.RemoveItem AmmoSmallEnergyCell iTempC							Player.AddItem FissionBattery iTempB						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 6						If Player.GetItemCount AmmoSmallEnergyCell >= 75							Player.RemoveItem AmmoSmallEnergyCell 75							Player.AddItem FissionBattery 1						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 7						If Player.GetItemCount AmmoSmallEnergyCell >= 375							Player.RemoveItem AmmoSmallEnergyCell 375							Player.AddItem FissionBattery 5						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 8						Set iTempA To Player.GetItemCount AmmoElectronChargePack						Set iTempB To iTempA/25						Set iTempC To iTempB*25						If iTempA >= 25							Player.RemoveItem AmmoElectronChargePack iTempC							Player.AddItem FissionBattery iTempB						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 9						ShowMessage EchoBCMain						Set Meno To 1					EndIf			EndIf...etc.

User avatar
Anthony Santillan
 
Posts: 3461
Joined: Sun Jul 01, 2007 6:42 am

Post » Mon Mar 14, 2011 2:29 pm

You don't need to "await input".


You're using 'If Menu == ' to isolate the GetButtonPressed in the Gamemode block. I'm using 'AwaitingInput'. The 'returns' are what really perform the 'waiting for input'.
User avatar
pinar
 
Posts: 3453
Joined: Thu Apr 19, 2007 1:35 pm

Post » Mon Mar 14, 2011 3:50 pm

I don't understand exactly what's breaking for you, I'm not a god with multi-level messageboxes.

But I have a working set of menued messageboxes and it does not look like yours. You don't have button being -1 like, ever. I followed a Cipscis tutorial on it (probably on www.cipscis.com).

This is the one I use in Phalanx and it is known-good, maybe it will help you.

This is related to a follower. All variables in the code are SHORT type (I don't list them below, they are just in the code as they are used).

Begin OnActivate Player	if Followers.CharonHired		If DenyActivate		ElseIf IsInCombat			Set Followers.FollowerIsInCombat to 1			ShowMessage CharonCombatMSG			Set awaitinginput to 1 ;  <--------------------------- this is what makes my messagebox start working		Else			Set Followers.FollowerIsInCombat to 0			Activate		EndIf	else		activate	endifEndbegin GAMEMODE	;Charon's combat-only menu-based activation	If awaitinginput ; <---------------------------- my message box conditional start thingie		If Menulevel == 0			Set button0 to GetButtonPressed			If button0 == -1				Return			ElseIf button0 == 0 ; group				ShowMessage PhalanxGroupMSG				Set menulevel to 1			ElseIf button0 == 1 ; group2				ShowMessage PhalanxGroup2MSG				Set menulevel to 2			ElseIf button0 == 2 ; medical				StartQuest FollowersE				Set FollowersE.CharonMed to 1				Set awaitinginput to 0				RemoveMe ; <-------------- "RemoveMe" makes the messagebox self cancel and disappear			ElseIf button0 == 3; trade				StartQuest FollowersD				Set FollowersD.CharonT to 1				Set awaitingInput to 0				RemoveMe 			ElseIf button0 == 4 ; talk				Activate Player				Set awaitinginput to 0				StopQuest FollowersC				RemoveMe			ElseIf button0 == 5				Set awaitingInput to 0				StopQuest FollowersC				RemoveMe			EndIf		ElseIf menulevel == 2			Set button1 to GetButtonPressed			If button1 == -1				Return			ElseIf button1 == 0 ; no weapswitch				set PhNoWeapMan to 1				Set awaitinginput to 0				Set menulevel to 0				RemoveMe			ElseIf button1 == 1 ; weapswitch				set PhNoWeapMan to 0				Set awaitinginput to 0				Set menulevel to 0				RemoveMe			ElseIf button1 == 2 ; back level				ShowMessage CharonCombatMSG				Set menulevel to 0				Return			ElseIf button1 == 3				Set awaitinginput to 0				Set menulevel to 0				RemoveMe			EndIf		ElseIf menulevel == 1			Set button1 to GetButtonPressed			If button1 == -1				Return			ElseIf button1 == 0 ; fallback				StartQuest FollowersC				Set FollowersC.GFallBack to 1				Set awaitinginput to 0				Set menulevel to 0				RemoveMe			ElseIf button1 == 1 ; push				StartQuest FollowersC				Set FollowersC.GPush to 1				Set awaitinginput to 0				Set menulevel to 0				RemoveMe			ElseIf button1 == 2 ; retreat				StartQuest FollowersC				Set FollowersC.GRetreat to 1				Set awaitinginput to 0				Set menulevel to 0				RemoveMe			ElseIf button1 == 3 ; hold				StartQuest FollowersC				Set FollowersC.GHold to 1				Set awaitinginput to 0				Set menulevel to 0				RemoveMe			ElseIf button1 == 4 ; hide				StartQuest FollowersC				Set FollowersC.GHide to 1				Set awaitinginput to 0				Set menulevel to 0				RemoveMe			ElseIf button1 == 5 ; stop hold				StartQuest FollowersC				Set FollowersC.GStopHold to 1				Set awaitinginput to 0				Set menulevel to 0				RemoveMe			ElseIf button1 == 6 ; stop hide				StartQuest FollowersC				Set FollowersC.GStopHide to 1				Set awaitinginput to 0				Set menulevel to 0				RemoveMe			ElseIf button1 == 7 ; back level				ShowMessage CharonCombatMSG				Set menulevel to 0				Return			ElseIf button1 == 8				Set awaitinginput to 0				Set menulevel to 0				RemoveMe			EndIf		EndIf	EndIfEND

User avatar
Lizbeth Ruiz
 
Posts: 3358
Joined: Fri Aug 24, 2007 1:35 pm

Post » Tue Mar 15, 2011 12:50 am

You don't need to "await input".


A snip from my own script. This is only a 2 menu level script however. To make it 3 levels you would need a second menu variable, or assign more values for the 3rd level menus.
SCN EBCScriptShort ButtonShort Menu;0 - N/A;1 - Main Menu;2 - Fission Batteries (FB);3 - Micro Fusion Cells (MFC);4 - Small Energy Cells (SEC);5 - Electron Charge Packs (EPC);6 - Special Conversions (SC)Short iTempA ;How many you have totalShort iTempB ;How many to giveShort iTempC ;How many to takeBegin OnActivate	ShowMessage EchoBCMain	Set Menu to 1EndBegin GameMode	If Menu == 1		Set Button To GetButtonPressed			If Button == -1				Return			Elseif Button == 0 ;Fission Batteries				ShowMessage EchoBCFB				Set Menu To 2			Elseif Button == 1 ;Micro Fusion Cells				ShowMessage EchoBCMFC				Set Menu To 3			Elseif Button == 2 ;Small Energy Cells				ShowMessage EchoBCSEC				Set Menu To 4			Elseif Button == 3 ;Electron Charge Packs				ShowMessage EchoBCECP				Set Menu To 5			Elseif Button == 4 ; Special Conversions				ShowMessage EchoBCSC				Set Menu To 6			Elseif Button == 5 ; Pick-up				Set Menu To 0				Activate					EndIf						If Menu == 2 ;Fission Batteries				Set Button To getButtonPressed					If Button == -1						Return					ElseIf Button == 0						If Player.GetItemCount AmmoMicroFusionCell >= 25							Player.RemoveItem AmmoMicroFusionCell 25							Player.AddItem FissionBattery 1						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 1						If Player.GetItemCount AmmoMicroFusionCell >= 125							Player.RemoveItem AmmoMicroFusionCell 125							Player.AddItem FissionBattery 5						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 2						Set iTempA To Player.GetItemCount AmmoMicroFusionCell						Set iTempB To iTempA/25						Set iTempC To iTempB*25						If iTempA >= 25							Player.RemoveItem AmmoMicroFusionCell iTempC							Player.AddItem FissionBattery iTempB						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 3						If Player.GetItemCount AmmoSmallEnergyCell >= 50							Player.RemoveItem AmmoSmallEnergyCell 50							Player.AddItem FissionBattery 1						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 4						If Player.GetItemCount AmmoSmallEnergyCell >= 250							Player.RemoveItem AmmoSmallEnergyCell 250							Player.AddItem FissionBattery 5						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 5						Set iTempA To Player.GetItemCount AmmoSmallEnergyCell						Set iTempB To iTempA/25						Set iTempC To iTempB*25						If iTempA >= 25							Player.RemoveItem AmmoSmallEnergyCell iTempC							Player.AddItem FissionBattery iTempB						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 6						If Player.GetItemCount AmmoSmallEnergyCell >= 75							Player.RemoveItem AmmoSmallEnergyCell 75							Player.AddItem FissionBattery 1						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 7						If Player.GetItemCount AmmoSmallEnergyCell >= 375							Player.RemoveItem AmmoSmallEnergyCell 375							Player.AddItem FissionBattery 5						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 8						Set iTempA To Player.GetItemCount AmmoElectronChargePack						Set iTempB To iTempA/25						Set iTempC To iTempB*25						If iTempA >= 25							Player.RemoveItem AmmoElectronChargePack iTempC							Player.AddItem FissionBattery iTempB						Else							ShowMessage EchoBCError						EndIf					ElseIf Button == 9						ShowMessage EchoBCMain						Set Meno To 1					EndIf			EndIf...etc.



That look's like the angle I was going with. Maybe my code's untidy and I just need to rework it. I'll have another look this evening and fathom it out then.

Edit: Just glanced over Tarrant's code and that also looks like something I could incorp. The GetButton with a unique Button var for each one could be of use.
User avatar
Mandi Norton
 
Posts: 3451
Joined: Tue Jan 30, 2007 2:43 pm

Post » Mon Mar 14, 2011 10:14 pm

That look's like the angle I was going with. Maybe my code's untidy and I just need to rework it. I'll have another look this evening and fathom it out then.

Edit: Just glanced over Tarrant's code and that also looks like something I could incorp. The GetButton with a unique Button var for each one could be of use.


I still can't fathom what I'm doing wrong.

Whenever I set one datastore for the first time, then go to set a second one, it doesnt even display the message window. I hit the activator and it completely cocks the whole thing up. It doesnt seem to be reinitialising the menuChoice back to 0, despite the code being in it and stating set menuChoice to 0.

Any ideas?

scn TARDISdataStorageSCRIPTshort Buttonshort menuChoice	;menuChoice 1 == Datastore 1 screen 1;menuChoice 2 == Datastore 1 screen 2;menuChoice 3 == Datastore 2 screen 1;menuChoice 4 == Datastore 2 screen 2;menuChoice 5 == Datastore 3 screen 1;menuChoice 6 == Datastore 3 screen 2		begin onActivate player	ShowMessage TARDISdatastoreStartupendbegin gameMode	set Button to GetButtonPressed	if menuChoice == 0		if ( Button == 0 )			set menuChoice to 1			showmessage TARDISdatastore1		elseif ( Button == 1 )			set menuChoice to 3			showmessage TARDISdatastore1		elseif ( Button == 2 )			set menuChoice to 5			showmessage TARDISdatastore1		elseif ( Button == 3 )					endif	endif	if menuChoice == 1		if ( Button == 0 )			set tardisdstore1 to 1			showmessage TARDISdstore1set		elseif ( Button == 1 )			set tardisdstore1 to 2			ShowMessage TARDISdstore1set		elseif ( Button == 2 )			set tardisdstore1 to 3			ShowMessage TARDISdstore1set		elseif ( Button == 3 )			set tardisdstore1 to 4			ShowMessage TARDISdstore1set		elseif ( Button == 4 )			set tardisdstore1 to 5			ShowMessage TARDISdstore1set		elseif ( 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 TARDISdatastore1a		elseif ( Button == 9 )			set menuChoice to 0		endif	endif	if menuChoice == 2		if ( Button == 0 )			set menuChoice to 0			set tardisdstore1 to 9			showmessage TARDISdstore1set		elseif ( Button == 1 )			set menuChoice to 0			set tardisdstore1 to 10			ShowMessage TARDISdstore1set		elseif ( Button == 2 )			set menuChoice to 0			set tardisdstore1 to 11			ShowMessage TARDISdstore1set		elseif ( 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 TARDISdstore1set		elseif ( Button == 8 )			set menuChoice to 0			set tardisdstore1 to 18			ShowMessage TARDISdstore1set		elseif ( Button == 9 )			set menuChoice to 0		endif	endifif menuChoice == 3		if ( Button == 0 )			set tardisdstore2 to 1			showmessage TARDISdstore1set		elseif ( Button == 1 )			set tardisdstore2 to 2			ShowMessage TARDISdstore1set		elseif ( Button == 2 )			set tardisdstore2 to 3			ShowMessage TARDISdstore1set		elseif ( Button == 3 )			set tardisdstore2 to 4			ShowMessage TARDISdstore1set		elseif ( Button == 4 )			set tardisdstore2 to 5			ShowMessage TARDISdstore1set		elseif ( Button == 5 )			set tardisdstore2 to 6			ShowMessage TARDISdstore1set		elseif ( Button == 6 )			set tardisdstore2 to 7			ShowMessage TARDISdstore1set		elseif ( Button == 7 )			set tardisdstore2 to 8			ShowMessage TARDISdstore1set		elseif ( Button == 8 )			set menuChoice to 4			ShowMessage TARDISdatastore1a		elseif ( Button == 9 )			set menuChoice to 0		endif	endif	if menuChoice == 4		if ( Button == 0 )			set menuChoice to 0			set tardisdstore2 to 9			showmessage TARDISdstore1set		elseif ( Button == 1 )			set menuChoice to 0			set tardisdstore2 to 10			ShowMessage TARDISdstore1set		elseif ( Button == 2 )			set menuChoice to 0			set tardisdstore2 to 11			ShowMessage TARDISdstore1set		elseif ( 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 TARDISdstore1set		elseif ( Button == 8 )			set menuChoice to 0			set tardisdstore2 to 18			ShowMessage TARDISdstore1set		elseif ( Button == 9 )			set menuChoice to 0		endif	endifend

User avatar
jadie kell
 
Posts: 3497
Joined: Sat Jul 29, 2006 3:54 pm

Post » Mon Mar 14, 2011 1:43 pm

Its not a wise idea to put your GetButtonPressed in the GameMode all by itself.

This has the 'Main Menu', The first menu choices which you can duplicate for how many menu's you include. The next set would be to perform the actions from the second menu choices (which for now I just add 100 caps no matter what).

scn TARDISdataStorageSCRIPTshort Buttonshort menuChoice	begin onActivate player	if menuChoice == 0		ShowMessage TARDISdatastoreStartup		set menuChoice to 1	endifendbegin gameMode; Main menu	if menuChoice == 1		set Button to GetButtonPressed		if Button < 0			return		endif		if Button == 0			set menuChoice to 10			showmessage TARDISdatastore1		elseif Button == 1			set menuChoice to 20			showmessage TARDISdatastore1		elseif Button == 2			set menuChoice to 30			showmessage TARDISdatastore1		elseif Button == 3			set menuChoice to 0			return		endif	endif; Menu 1 choices	if menuChoice == 10		set Button to GetButtonPressed		if Button < 0			return		endif		if Button == 0			set menuChoice to 11			showmessage TARDISdatastore1		elseif Button == 1			set menuChoice to 12			showmessage TARDISdatastore1		elseif Button == 2			set menuChoice to 13			showmessage TARDISdatastore1		elseif Button == 3			set menuChoice to 0			return		endif	endif; Menu 1 choice 1 selections	if menuChoice == 11		set Button to GetButtonPressed		if Button < 0			return		endif		if Button == 0			set menuChoice to 0			Player.AddItem Caps001 100		elseif Button == 1			set menuChoice to 0			Player.AddItem Caps001 100		elseif Button == 2			set menuChoice to 0			Player.AddItem Caps001 100		elseif Button == 3			set menuChoice to 0			return		endif	endif; Menu 1 choice 2 selections	if menuChoice == 12		set Button to GetButtonPressed		if Button < 0			return		endif		if Button == 0			set menuChoice to 0			Player.AddItem Caps001 100		elseif Button == 1			set menuChoice to 0			Player.AddItem Caps001 100		elseif Button == 2			set menuChoice to 0			Player.AddItem Caps001 100		elseif Button == 3			set menuChoice to 0			return		endif	endif; Menu 1 choice 3 selections	if menuChoice == 12		set Button to GetButtonPressed		if Button < 0			return		endif		if Button == 0			set menuChoice to 0			Player.AddItem Caps001 100		elseif Button == 1			set menuChoice to 0			Player.AddItem Caps001 100		elseif Button == 2			set menuChoice to 0			Player.AddItem Caps001 100		elseif Button == 3			set menuChoice to 0			return		endif	endifend

User avatar
Anthony Rand
 
Posts: 3439
Joined: Wed May 09, 2007 5:02 am

Post » Mon Mar 14, 2011 1:23 pm

Heya,

In the end I opted out of all that struggle and fuss and opted in for 3 single activators, which works brilliantly. It was all down to an aestheticism thing, but I've overcome that self-critique and gone for the easy route. Thanks for all the suggestions though.
User avatar
Margarita Diaz
 
Posts: 3511
Joined: Sun Aug 12, 2007 2:01 pm


Return to Fallout 3