Messagebox: What are the possible setups?

Post » Mon Jun 18, 2012 2:11 pm

From all examples on Creation Kit wiki, the Message seems to be conceived just as an "output".

In fact, you could only give an input to the player, which he could see on-screen or be forced to give "ok" to go on...

However, I was wondering if was possible to setup a message to give a textbox (receiving an in-game feedback from the player) or to make a selection with options which aren't just "ok" (or "cancel"). Unluckily the only textbox I've seen was from the Race menu, which seems to be somewhat "hard-coded"...I mean...you cannot call just the naming textbox... :(

However, not having a non-hardcoded textbox would be really a pity, because it would "cut" any possibility to receive in-game inputs as writing. :(

What do you think? Any hint of this possibility?
Jashkar

P.S.: But console users how manage the naming textbox after the race menu? Pc has keyboard, but it's unclear to me how console controllers deal with that...
User avatar
matt oneil
 
Posts: 3383
Joined: Tue Oct 09, 2007 12:54 am

Post » Mon Jun 18, 2012 7:10 am

I don't think there's any sort of way to receive player input like that.

But messages can have whatever buttons you like on it.

And console players type using a virtual keyboard.
User avatar
Jade
 
Posts: 3520
Joined: Mon Jul 10, 2006 6:42 am

Post » Mon Jun 18, 2012 9:04 pm

It is very doable to create in-game menus, just like it worked with MessageBoxes in oblivion. In fact, if I get what you're trying to do right (messageboxes with several buttons and the ability for the player to pick an option and then have a script react to the options the player picked) I implemented exactly that yesterday in my latest version of Deadly Combat :tongue:

In my case, the menu is activated by a magic effect (through a scroll), so that's why I extend activemagiceffect. This is the entire script which handles the menu:

Scriptname DCCustomizationMenuEffectScript extends activemagiceffect  Message Property DCCustomizationMenuMain autoMessage Property DCCustomizationMenuStaggering autoMessage Property DCCustomizationMenuOtherFeatures autoScroll Property DCCustomizationMenuScroll autoDCInitQuestScript Property questScript autoEvent OnEffectStart(Actor akTarget, Actor akCaster)If(akCaster== Game.GetPlayer())    ;Should some NPC obtain and use this scroll, do not unexpectedly pop up the menu for the player!    int chosenOption = DCCustomizationMenuMain.Show()    If(chosenOption==0)            ;Staggering chosen        chosenOption=-1        chosenOption = DCCustomizationMenuStaggering.Show()        If(chosenOption==0)        ;Prevent player stagger option chosen            questScript.DCPreventPlayerStaggerSpamFunction()        ElseIf(chosenOption==1)    ;Prevent enemy stagger option chosen            questScript.DCPreventEnemyStaggerSpamFunction()        EndIf    ElseIf(chosenOption==1)        ;Other Features chosen        chosenOption = DCCustomizationMenuOtherFeatures.Show()        If(chosenOption==0)        ;Toggle Timed blocking option chosen            questScript.DCTimedBlockingFunction()        EndIf                                    EndIf    Game.GetPlayer().addItem(DCCustomizationMenuScroll,1)EndIfEndEvent

Now, of course you also need to set the properties correctly and have actual Message objects (found in Object window under Miscellaneous --> Message). Each Message object just has the message text and text for up to 9 buttons (though if you have more than a few letters text on each button, I've found that the buttons won't fit on my screen in game if you use more than about 3 or 4 buttons)
User avatar
roxxii lenaghan
 
Posts: 3388
Joined: Wed Jul 05, 2006 11:53 am

Post » Mon Jun 18, 2012 11:10 am

Here's the skeleton of [BORG].ESM's 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)		Else			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)		Else			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)		Else			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)		Else			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)		Else			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)		Else			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)		Else			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)		Else			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)		Else			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)		Else			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
Roy Harris
 
Posts: 3463
Joined: Tue Sep 11, 2007 8:58 pm

Post » Mon Jun 18, 2012 8:52 am

Beware of http://i.imgur.com/xPBTt.jpg happening.
I'm quite peeved that there isn't a way to set the button to be vertical. Would work so much better for what I'm doing with em.
User avatar
jadie kell
 
Posts: 3497
Joined: Sat Jul 29, 2006 3:54 pm

Post » Mon Jun 18, 2012 5:41 pm


I'm quite peeved that there isn't a way to set the button to be vertical. Would work so much better for what I'm doing with em.
Yeah, I'm hoping something is done about it, 'cause it'll be murder on a 4:3. That one's overflowing on a 16:10.
User avatar
Timara White
 
Posts: 3464
Joined: Mon Aug 27, 2007 7:39 am

Post » Mon Jun 18, 2012 7:36 am

It is very doable to create in-game menus, just like it worked with MessageBoxes in oblivion. In fact, if I get what you're trying to do right (messageboxes with several buttons and the ability for the player to pick an option and then have a script react to the options the player picked) ...

In truth I just wanted to be able to rename a npc in-game...it's a very simple thing, but without a textbox is quite daunting...

This is the entire script which handles the menu...

Sorry if I ask silly question, but, looking at your code...mmmh...the "Properties" within the Message ends up being buttons, right? Or I am wrong? :-?



Here's the skeleton of [BORG].ESM's menu:

....

Could have more than 100 buttons if needed...


So, if I don't get it wrong, with the above code you'll be able to circumvent the 9 button messagebox limit by opening distinct menus with other buttons on it...I am getting it right?

So may be my idea could be turned either into a multi-message keyboard or into something like a cellphone keyboard (with more letters associated with a single button)...

Mmmh...ok...another question guys:

Do you think that Message Properties could be made into arrays?

I mean...it's just a raw brainstorming idea, but associating a matrix to a single property sounds like an array variable, so may be if I can make a button into an array property I could make a button which is "A", "B" and "C"
at the same time... what do you think? Am I ravening? :blush: :blush: :blush:
Jashkar
User avatar
Claire Lynham
 
Posts: 3432
Joined: Mon Feb 12, 2007 9:42 am

Post » Mon Jun 18, 2012 12:29 pm

10 buttons per box * 10 boxes. It loops, so unless you press a "Done" button, you stay in the menu.
User avatar
Brad Johnson
 
Posts: 3361
Joined: Thu May 24, 2007 7:19 pm

Post » Mon Jun 18, 2012 8:35 am

In truth I just wanted to be able to rename a npc in-game...it's a very simple thing, but without a textbox is quite daunting...

Ah yes getting text input would be pretty hard..

Sorry if I ask silly question, but, looking at your code...mmmh...the "Properties" within the Message ends up being buttons, right? Or I am wrong? :-?

No, the Message properties are basically just entire menus, the Message objects found under Miscellaneous --> Message in object window. Each Message (=''menu'') can have up to 9 buttons
User avatar
zoe
 
Posts: 3298
Joined: Sun Nov 12, 2006 1:09 pm

Post » Mon Jun 18, 2012 6:01 pm

up to 9 buttons
10 buttons/box are possible, just like Oblivion and the Fallouts.
User avatar
Danel
 
Posts: 3417
Joined: Tue Feb 27, 2007 8:35 pm

Post » Mon Jun 18, 2012 6:22 pm

10 buttons/box are possible, just like Oblivion and the Fallouts.

Ah yes right :P although they probably never fit on the screen :P Just accidentally wrote 9 because the buttons start counting at 0 :P
User avatar
Emily Martell
 
Posts: 3469
Joined: Sun Dec 03, 2006 7:41 am

Post » Mon Jun 18, 2012 8:14 pm

Ah yes right :P although they probably never fit on the screen :P Just accidentally wrote 9 because the buttons start counting at 0 :P
Easy to get thrown off by that. You could probably iButton = (YourMESG.Show() - 1) to offset it by one so 1 = 1 instead of 0, etc. but the CK is gonna list 'em starting w/ 0 in the messages window no matter what.
User avatar
Taylor Tifany
 
Posts: 3555
Joined: Sun Jun 25, 2006 7:22 am


Return to V - Skyrim