Messagebox: Some questions...

Post » Mon Jun 18, 2012 4:39 pm

I have understood that the Messagebox opens an object that looks like a menu, but I was wondering about a couple of things:

- How could be done, using just the standard Papyrus synthax, to keep a menu open until one specific button is pushed, so that you can push all other buttons how many times you want?
- How could a button in the Messagebox set to work as a switch (pushing once is "0", pushing twice is "1")? There's any way to do that?
- How could different Messagebox be opened at the same time (not in sequence) and kept open until a button in one of them is pushed? There's any way to do it?
- Is it possible to set a Messagebox to work truly as a menu, so opening a drop-down list after being pushed (still I mean with the standard Papyrus synthax)?

Could anyone help me with these doubts? :blush:

Thanks,
Jashkar

P.S.: Moreover, I'd like, if possible to understand a couple of things about SKSE:
1) There's any document to see which functions are added by SKSE?
2) How could one launch CK with SKSE active?
User avatar
Gavin Roberts
 
Posts: 3335
Joined: Fri Jun 08, 2007 8:14 pm

Post » Tue Jun 19, 2012 1:01 am

I have understood that the Messagebox opens an object that looks like a menu, but I was wondering about a couple of things:

- How could be done, using just the standard Papyrus synthax, to keep a menu open until one specific button is pushed, so that you can push all other buttons how many times you want?
A while loop could work here. Just have it end once the proper button is pressed (Messages I believe return the index of the button pressed). You'd probably have to call Show() at the beginning of every iteration.

- How could a button in the Messagebox set to work as a switch (pushing once is "0", pushing twice is "1")? There's any way to do that?
Edit: completely misread. I do that alot it seems...

- How could different Messagebox be opened at the same time (not in sequence) and kept open until a button in one of them is pushed? There's any way to do it?
No clue.

- Is it possible to set a Messagebox to work truly as a menu, so opening a drop-down list after being pushed (still I mean with the standard Papyrus synthax)?
I don't think so. But I'm not entirely sure. Haven't worked much with them.

Could anyone help me with these doubts? :blush:

Thanks,
Jashkar

P.S.: Moreover, I'd like, if possible to understand a couple of things about SKSE:
1) There's any document to see which functions are added by SKSE?
2) How could one launch CK with SKSE active?
The SKSE team hasn't added anything to the CK/Papyrus yet.
User avatar
Harinder Ghag
 
Posts: 3405
Joined: Wed Jan 17, 2007 11:26 am

Post » Tue Jun 19, 2012 1:51 am

A while loop could work here. Just have it end once the proper button is pressed (Messages I believe return the index of the button pressed). You'd probably have to call Show() at the beginning of every iteration.

So you mean that Show() isn't needed to have the Message give the index number of the button when pushed? You'd only have to run it when the loop "begins" (after While)?
Sorry if the question could seem silly, but it's not much clear to me how the system is checking when a button is pushed... :(

Moreover...is it possible to have the system check how many times a button is pushed?
I mean...if the loop method was used, each time I push the button the Message would close and it's the loop which re-opens it (if I am not misunderstanding), so checking on how many times the button is pushed would be just a sort of counter? :-?

Thanks,
Jashkar
User avatar
Alexx Peace
 
Posts: 3432
Joined: Thu Jul 20, 2006 5:55 pm

Post » Tue Jun 19, 2012 6:57 am

Here's [BORG].ESM's menu skeleton. It loops so pressing only a "Done" button leaves the menu.

Spoiler
ScriptName InfinimenuScript extends Quest  Import DebugImport UtilityInt iVar = 0Int iButton = 0Int iMessageMessage Property InfinimenuOptions01MESG AutoMessage Property InfinimenuOptions02MESG AutoMessage Property InfinimenuOptions03MESG AutoMessage Property InfinimenuOptions04MESG AutoMessage Property InfinimenuOptions05MESG AutoMessage Property InfinimenuOptions06MESG AutoMessage Property InfinimenuOptions07MESG AutoMessage Property InfinimenuOptions08MESG AutoMessage Property InfinimenuOptions09MESG AutoMessage Property InfinimenuOptions10MESG AutoEvent OnInit()	RegisterForSingleUpdate(1)EndEvent;=============================Event OnUpdate()	If Game.GetPlayer().IsEquipped(InfinimenuARMO)		iMessage = 1		RegisterForUpdate(0.1)		Game.GetPlayer().UnequipItem(InfinimenuARMO, False, True)	ElseIf (iMessage == 0)		iVar = Game.GetPlayer().GetItemCount(InfinimenuARMO)		If (iVar > 0)			If (iVar == 1)				If (SKSE.GetValue() > 1)					Game.GetPlayer().RemoveItem(InfinimenuARMO, iVar, True)				EndIf			Else				iVar -= 1				Game.GetPlayer().RemoveItem(InfinimenuARMO, iVar, True)			EndIf		Else			Game.GetPlayer().AddItem(InfinimenuARMO, 1, True)			Stop() ; Start externally with ^		EndIf	ElseIf (iMessage == 1)		iMessage = 0		iButton = InfinimenuOptions01MESG.Show()		If (iButton != -1)			iMessage = 1			If (iButton == 0)			ElseIf (iButton == 1)			ElseIf (iButton == 4)			ElseIf (iButton == 5)			ElseIf (iButton == 6)			ElseIf (iButton == 7)			ElseIf (iButton == 8)				iMessage = 2			ElseIf (iButton == 9)				iMessage = 0				Stop()			EndIf		EndIf	ElseIf (iMessage == 2)		iMessage = 0		iButton = InfinimenuOptions02MESG.Show()		If (iButton != -1)			iMessage = 2			If (iButton == 0)			ElseIf (iButton == 1)			ElseIf (iButton == 2)			ElseIf (iButton == 3)			ElseIf (iButton == 4)			ElseIf (iButton == 5)			ElseIf (iButton == 6)			ElseIf (iButton == 7) ; Back				iMessage = 1			ElseIf (iButton == 8) ; More				iMessage = 3			ElseIf (iButton == 9) ; Done				iMessage = 0				Stop()			EndIf		EndIf	ElseIf (iMessage == 3)		iMessage = 0		iButton = InfinimenuOptions03MESG.Show()		If (iButton != -1)			iMessage = 3			If (iButton == 0)			ElseIf (iButton == 1)			ElseIf (iButton == 2)			ElseIf (iButton == 3)			ElseIf (iButton == 4)			ElseIf (iButton == 5)			ElseIf (iButton == 6)			ElseIf (iButton == 7) ; Back				iMessage = 2			ElseIf (iButton == 8) ; More				iMessage = 4			ElseIf (iButton == 9) ; Done				iMessage = 0				Stop()			EndIf		EndIf	ElseIf (iMessage == 4)		iMessage = 0		iButton = InfinimenuOptions04MESG.Show()		If (iButton != -1)			iMessage = 4			If (iButton == 0)			ElseIf (iButton == 1)			ElseIf (iButton == 2)			ElseIf (iButton == 3)			ElseIf (iButton == 4)			ElseIf (iButton == 5)			ElseIf (iButton == 6)			ElseIf (iButton == 7) ; Back				iMessage = 3			ElseIf (iButton == 8) ; More				iMessage = 5			ElseIf (iButton == 9) ; Done				iMessage = 0				Stop()			EndIf		EndIf	ElseIf (iMessage == 5)		iMessage = 0		iButton = InfinimenuOptions05MESG.Show()		If (iButton != -1)			iMessage = 5			If (iButton == 0)			ElseIf (iButton == 1)			ElseIf (iButton == 2)			ElseIf (iButton == 3)			ElseIf (iButton == 4)			ElseIf (iButton == 5)			ElseIf (iButton == 6)			ElseIf (iButton == 7) ; Back				iMessage = 4			ElseIf (iButton == 8) ; More				iMessage = 6			ElseIf (iButton == 9) ; Done				iMessage = 0				Stop()			EndIf		EndIf	ElseIf (iMessage == 6)		iMessage = 0		iButton = InfinimenuOptions06MESG.Show()		If (iButton != -1)			iMessage = 6			If (iButton == 0)			ElseIf (iButton == 1)			ElseIf (iButton == 2)			ElseIf (iButton == 3)			ElseIf (iButton == 4)			ElseIf (iButton == 5)			ElseIf (iButton == 6)			ElseIf (iButton == 7) ; Back				iMessage = 5			ElseIf (iButton == 8) ; More				iMessage = 7			ElseIf (iButton == 9) ; Done				iMessage = 0				Stop()			EndIf		EndIf	ElseIf (iMessage == 7)		iMessage = 0		iButton = InfinimenuOptions07MESG.Show()		If (!iButton != -1)			iMessage = 7			If (iButton == 0)			ElseIf (iButton == 1)			ElseIf (iButton == 2)			ElseIf (iButton == 3)			ElseIf (iButton == 4)			ElseIf (iButton == 5)			ElseIf (iButton == 6)			ElseIf (iButton == 7) ; Back				iMessage = 6			ElseIf (iButton == 8) ; More				iMessage = 8			ElseIf (iButton == 9) ; Done				iMessage = 0				Stop()			EndIf		EndIf	ElseIf (iMessage == 8)		iMessage = 0		iButton = InfinimenuOptions08MESG.Show()		If (iButton != -1)			iMessage = 8			If (iButton == 0)			ElseIf (iButton == 1)			ElseIf (iButton == 2)			ElseIf (iButton == 3)			ElseIf (iButton == 4)			ElseIf (iButton == 5)			ElseIf (iButton == 6)			ElseIf (iButton == 7) ; Back				iMessage = 7			ElseIf (iButton == 8) ; More				iMessage = 9			ElseIf (iButton == 9) ; Done				iMessage = 0				Stop()			EndIf		EndIf	ElseIf (iMessage == 9)		iButton = InfinimenuOptions09MESG.Show()		If (iButton != -1)			iMessage = 9			If (iButton == 0)			ElseIf (iButton == 1)			ElseIf (iButton == 2)			ElseIf (iButton == 3)			ElseIf (iButton == 4)			ElseIf (iButton == 5)			ElseIf (iButton == 6)			ElseIf (iButton == 7) ; Back				iMessage = 8			ElseIf (iButton == 8) ; More				iMessage = 10			ElseIf (iButton == 9) ; Done				iMessage = 0				Stop()			EndIf		EndIf	ElseIf (iMessage == 10)		iButton = InfinimenuOptions10MESG.Show()		If (iButton != -1)			iMessage = 10			If (iButton == 0)			ElseIf (iButton == 1)			ElseIf (iButton == 2)			ElseIf (iButton == 3)			ElseIf (iButton == 4)			ElseIf (iButton == 5)			ElseIf (iButton == 6)			ElseIf (iButton == 7)			ElseIf (iButton == 8) ; Back				iMessage = 9			ElseIf (iButton == 9) ; Done				iMessage = 0				Stop()			EndIf		EndIf	EndIfEndEvent

Could have more than 100 buttons if needed...

Beware of http://i.imgur.com/xPBTt.jpg happening.
User avatar
NAtIVe GOddess
 
Posts: 3348
Joined: Tue Aug 15, 2006 6:46 am

Post » Tue Jun 19, 2012 2:50 am

How would I enable these message boxes to be opened when the player casts a certain spell?? I can only see a function for GetEquippedSpell() for the actor. I suppose the spell could just add a token to the player??
User avatar
Sarah Kim
 
Posts: 3407
Joined: Tue Aug 29, 2006 2:24 pm

Post » Tue Jun 19, 2012 5:36 am

How would I enable these message boxes to be opened when the player casts a certain spell?? I can only see a function for GetEquippedSpell() for the actor. I suppose the spell could just add a token to the player??
Something like
ScriptName ShowAMenu extends ActiveMagicEffectMessage Property MyMessage Autoevent OnEffectStart(actor target, actor caster)  ;menu code goes here  ;something like  if caster == Game.GetPlayer()	int res	while res != 2   ;im assuming your third button is the one you want to stop on	  res = MyMessage.show()	  if res == 0		;user picked the first option	  elseif res == 1		;user picked the second option	  endif	  Utility.wait(0.8) ;you'll want to do this between iterations	endwhile  endifendevent
User avatar
stevie critchley
 
Posts: 3404
Joined: Sat Oct 28, 2006 4:36 pm

Post » Tue Jun 19, 2012 7:08 am

Thanks, that worked :D.
User avatar
Isabel Ruiz
 
Posts: 3447
Joined: Sat Nov 04, 2006 4:39 am


Return to V - Skyrim