Jump to content

Multiple choice message-box


DwemerHunter

Recommended Posts

Hi, sorry it's another question from me. I've made a message box but I don't know how to make the buttons do things. I've made an activator and put the following script in it:

 

Scriptname MyMessageScript extends ObjectReference  

Message Property MyMessage  Auto

Event OnActivate(ObjectReference akActionRef)
       If(akActionRef == Game.GetPlayer()) 
	MyMessage.Show()
       Endif
EndEvent

 

But how do I make it so that the buttons make things happen afterwards?

 

I've looked at this but I don't understand it, and when I paste it in my script it fails.

 

Thanks again for help!

Link to comment
Share on other sites

I think you'll find the CK wiki's options menu page more easy to understand and implement

 

http://www.creationk...om/Options_Menu

 

This is the basic version, there are several other examples on the page. The main clue is storing the message.show() results (the player choice of option 0,1,2,whatever) into an int - then you can act on that.

 

ScriptName OptionsMenuScript Extends ObjectReference

Actor Property PlayerREF Auto
Armor Property MenuARMO Auto
Message Property OptionsMESG Auto

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
If akNewContainer == PlayerREF ; Only the player
  	Int iButton = OptionsMESG.Show() ; Shows your menu.
	PlayerREF.RemoveItem(MenuARMO, 1, True) ; Silently remove token. 'Self' does not work in this context, thus the property
	If iButton == 0  ; Mage
		Debug.Notification("Mage selected")
	ElseIf iButton == 1 ; Thief
		Debug.Notification("Thief selected")
	ElseIf iButton == 2 ; Warrior
		Debug.Notification("Warrior selected")
	EndIf
EndIf
EndEvent

 

Int iButton = OptionsMESG.Show()

This will store the results for you.

Edited by acidzebra
Link to comment
Share on other sites

  • Recently Browsing   0 members

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