Woverdude Posted March 24, 2012 Share Posted March 24, 2012 How do I create a message box that brings up another message box when a button is clicked? I've tried several ways of doing this already, but have not found a way. Here is the rather long script that I wrote today to try to do this: Scriptname WoMPillarProgressScript extends ObjectReference ;list of main messagesMESSAGE Property ChoiceMessage01 autoMESSAGE Property ChoiceMessage02autoMESSAGE Property ChoiceMessageDamage autoMESSAGE Property ChoiceMessageUnarmored autoMESSAGE Property ChoiceMessageAttacks auto ;list of perk messagesMESSAGE Property D1 autoMESSAGE Property D2 autoMESSAGE Property D3 autoMESSAGE Property DS1 autoMESSAGE Property DS2 autoMESSAGE Property DS3 autoMESSAGE Property DF1 autoMESSAGE Property DF2 autoMESSAGE Property DF3 autoMESSAGE Property U1 autoMESSAGE Property U2 autoMESSAGE Property U3 autoMESSAGE Property US1 autoMESSAGE Property US2 autoMESSAGE Property US3 autoMESSAGE Property PA autoMESSAGE Property UE1 autoMESSAGE Property UE2 autoMESSAGE Property UE3 autoMESSAGE Property A1 autoMESSAGE Property A2 autoMESSAGE Property A3 autoMESSAGE Property G1 autoMESSAGE Property G2 autoMESSAGE Property G3 autoMESSAGE Property C1 autoMESSAGE Property C2 autoMESSAGE Property C3 auto int messageint categoryint choice State Message01 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;view owned perks int message = 2 ;set message to the second one endif if (choice == 1) ;do nothing endif endEventEndState State Message02 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;Damage int category = 1 endif if (choice == 1) ;Unarmored int category = 2 endif if (choice == 2) ;Attacks int category = 3 endif if (choice == 3) ;Close ;do nothing endif EndEventEndState State Category1 Event OnActivate(ObjectReference akActionRef) if (choice == 0) int choice = D1.Show() GotoState("D1") endif if (choice == 1) int choice = D2.Show() GotoState("D2") endif if (choice == 2) int choice = D3.Show() GotoState("D3") endif if (choice == 3) int choice = DS1.Show() GotoState("DS1") endif if (choice == 4) int choice = DS2.Show() GotoState("DS2") endif if (choice == 5) int choice = DS3.Show() GotoState("DS3") endif if (choice == 6) int choice = DF1.Show() GotoState("DF1") endif if (choice == 7) int choice = DF2.Show() GotoState("DF2") endif if (choice == 8) int choice = DF3.Show() GotoState("DF3") endif EndEventEndState State Category2 Event OnActivate(ObjectReference akActionRef) if (choice == 0) int choice = U1.Show() GotoState("U1") endif if (choice == 1) int choice = U2.Show() GotoState("U2") endif if (choice == 2) int choice = U3.Show() GotoState("U3") endif if (choice == 3) int choice = US1.Show() GotoState("US1") endif if (choice == 4) int choice = US2.Show() GotoState("US2") endif if (choice == 5) int choice = US3.Show() GotoState("US3") endif if (choice == 6) int choice = PA.Show() GotoState("PA") endif if (choice == 7) int choice = UE1.Show() GotoState("UE1") endif if (choice == 8) int choice = UE2.Show() GotoState("UE2") endif if (choice == 9) int choice = UE3.Show() GotoState("UE3") endif EndEventEndState State Category3 Event OnActivate(ObjectReference akActionRef) if (choice == 0) int choice = A1.Show() GotoState("A1") endif if (choice == 1) int choice = A2.Show() GotoState("A2") endif if (choice == 2) int choice = A3.Show() GotoState("A3") endif if (choice == 3) int choice = G1.Show() GotoState("G1") endif if (choice == 4) int choice = G2.Show() GotoState("G2") endif if (choice == 5) int choice = G3.Show() GotoState("G3") endif if (choice == 6) int choice = C1.Show() GotoState("C1") endif if (choice == 7) int choice = C2.Show() GotoState("C2") endif if (choice == 8) int choice = C3.Show() GotoState("C3") endif EndEventEndState State D1 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State D2 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State D3 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State DS1 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State DS2 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State DS3 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State DF1 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State DF2 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State DF3 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State U1 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State U2 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State U3 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State US1 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State US2 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State US3 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State PA Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State UE1 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State UE2 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State UE3 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State A1 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State A2 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State A3 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State G1 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State G2 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State G3 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State C1 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State C2 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState State C3 Event OnActivate(ObjectReference akActionRef) if (choice == 0) ;return int choice = ChoiceMessage02.Show() GotoState("Message01") if (choice == 1) ;close, do nothing endif EndEventEndState EVENT OnActivate(ObjectReference akActionRef) int choice = ChoiceMessage01.Show() GotoState("Message01") if (message == 2) int choice = ChoiceMessage02.Show() GotoState("Message02") endif if (category == 1) int choice = ChoiceMessageDamage.Show() GotoState("Category1) endif if (category == 2) int choice = ChoiceMessageUnarmored.Show() GotoState("Category2") endif if (category == 3) int choice = ChoiceMessageUnarmored.Show() GotoState("Category3") endifENDEVENT The idea was that I would use States to mark the closing of one Message Box and the opening of another. Have I got the right idea but am just doing something wrong? Am I totally off the rails? Please help. :smile. This is a part of the Way of the Monk mod, which has a WIP thread here: Link to comment Share on other sites More sharing options...
fg109 Posted March 24, 2012 Share Posted March 24, 2012 I'm sure there's a better way to do this, but I've been making a function for each menu. So something like: Event OnActivate(objectReference akActivateRef) ShowMenu01() EndEvent Function ShowMenu01() int choice = Menu01.Show() if (choice == 0) ShowMenu02() elseif (choice == 1) ShowMenu03() endif EndFunction Function ShowMenu02() int choice = Menu02.Show() if (choice == 0) ShowMenu01() elseif (choice == 1) ShowMenu04() elseif (choice == 2) ShowMenu05() endif EndFunction Function ShowMenu03() int choice = Menu03.Show() if (choice == 0) ShowMenu01() elseif (choice == 1) ShowMenu06() elseif (choice == 2) ShowMenu07() endif EndFunction ;etc. Link to comment Share on other sites More sharing options...
eltucu Posted March 24, 2012 Share Posted March 24, 2012 You make each message box separated, and check the pressed options in the script to bring the next message box, like you did. There isnt a way to make each option redirect to another message box automatically, you have to script in that behavior. Probably cuz message boxes arent designed to be complex, just a "yes or no" popup and something happens afterward. Link to comment Share on other sites More sharing options...
barnard401 Posted March 24, 2012 Share Posted March 24, 2012 what fg109 posted is completely right, and its the method i use. I also believe its the only way, or at least the best, as it is the mothod used in the bethesda scripts Link to comment Share on other sites More sharing options...
Woverdude Posted March 24, 2012 Author Share Posted March 24, 2012 Thanks, ya'll. :-) I used fg109's method and it worked great, Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts