Jump to content

Multiple Message Boxes


Woverdude

Recommended Posts

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 messages

MESSAGE Property ChoiceMessage01 auto

MESSAGE Property ChoiceMessage02auto

MESSAGE Property ChoiceMessageDamage auto

MESSAGE Property ChoiceMessageUnarmored auto

MESSAGE Property ChoiceMessageAttacks auto

 

;list of perk messages

MESSAGE Property D1 auto

MESSAGE Property D2 auto

MESSAGE Property D3 auto

MESSAGE Property DS1 auto

MESSAGE Property DS2 auto

MESSAGE Property DS3 auto

MESSAGE Property DF1 auto

MESSAGE Property DF2 auto

MESSAGE Property DF3 auto

MESSAGE Property U1 auto

MESSAGE Property U2 auto

MESSAGE Property U3 auto

MESSAGE Property US1 auto

MESSAGE Property US2 auto

MESSAGE Property US3 auto

MESSAGE Property PA auto

MESSAGE Property UE1 auto

MESSAGE Property UE2 auto

MESSAGE Property UE3 auto

MESSAGE Property A1 auto

MESSAGE Property A2 auto

MESSAGE Property A3 auto

MESSAGE Property G1 auto

MESSAGE Property G2 auto

MESSAGE Property G3 auto

MESSAGE Property C1 auto

MESSAGE Property C2 auto

MESSAGE Property C3 auto

 

int message

int category

int 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

endEvent

EndState

 

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

EndEvent

EndState

 

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

EndEvent

EndState

 

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

EndEvent

EndState

 

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

EndEvent

EndState

 

State D1

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State D2

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State D3

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State DS1

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State DS2

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State DS3

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State DF1

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State DF2

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State DF3

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State U1

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State U2

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State U3

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State US1

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State US2

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State US3

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State PA

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State UE1

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State UE2

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State UE3

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State A1

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State A2

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State A3

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State G1

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State G2

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State G3

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State C1

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State C2

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

State C3

Event OnActivate(ObjectReference akActionRef)

if (choice == 0)

;return

int choice = ChoiceMessage02.Show()

GotoState("Message01")

if (choice == 1)

;close, do nothing

endif

EndEvent

EndState

 

 

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")

endif

ENDEVENT

 

 

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

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

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

Thanks, ya'll. :-)

 

I used fg109's method and it worked great, Thanks!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...