Message Box

Post » Sun Nov 18, 2012 2:44 am

If I made a message box, and I want it to start while the game is loaded (when player is in game, not in menu), How to I do it?
Thank you.
User avatar
Matthew Aaron Evans
 
Posts: 3361
Joined: Wed Jul 25, 2007 2:59 am

Post » Sun Nov 18, 2012 12:50 am

I assume that you mean that you want the message box to display when the player is not crafting or viewing an inventory. The methods for detecting whether a menu is displayed depends upon the menu as there are different kinds of menus. Some menus pause the game, while others do not.

Menus that pause the game (for example the player's inventory):
If the script either activates something, causing the menu to show, or is run when something is activated (when a menu is displayed), then simply use the Wait function. Once the menu is closed, the Wait function and the rest of the script will execute. The duration does not matter.

Menus that do not pause the game (for example crafting menus):
The only way I've discovered is to have some kind of repeating check (while-loop or OnUpdate events) that checks what the IsLookingControlsEnabled function returns (false means you are in the menu).
User avatar
Dalia
 
Posts: 3488
Joined: Mon Oct 23, 2006 12:29 pm

Post » Sun Nov 18, 2012 9:01 am

I assume that you mean that you want the message box to display when the player is not crafting or viewing an inventory. The methods for detecting whether a menu is displayed depends upon the menu as there are different kinds of menus. Some menus pause the game, while others do not.

Menus that pause the game (for example the player's inventory):
If the script either activates something, causing the menu to show, or is run when something is activated (when a menu is displayed), then simply use the Wait function. Once the menu is closed, the Wait function and the rest of the script will execute. The duration does not matter.

Menus that do not pause the game (for example crafting menus):
The only way I've discovered is to have some kind of repeating check (while-loop or OnUpdate events) that checks what the IsLookingControlsEnabled function returns (false means you are in the menu).

And where do I use this script? I cant find in in the Functions...
User avatar
neen
 
Posts: 3517
Joined: Sun Nov 26, 2006 1:19 pm

Post » Sun Nov 18, 2012 8:32 am

What is the context in which the message box should be shown? What causes the message box to show?
User avatar
c.o.s.m.o
 
Posts: 3419
Joined: Sat Aug 12, 2006 9:21 am

Post » Sun Nov 18, 2012 1:17 am

What is the context in which the message box should be shown? What causes the message box to show?

All I did was create a message and write something and an option to click "OK". What do I do next?
User avatar
Vincent Joe
 
Posts: 3370
Joined: Wed Sep 26, 2007 1:13 pm

Post » Sun Nov 18, 2012 12:11 pm

Depending on what you have attached the script to, you will have to find an event that can trigger the script. For example if you attach the script to an activator, then you can use the OnActivate event. If your script is a part of a spell, then you can use the OnEffectStart and OnEffectFinish events.

Example (this script could be attached to, for example, a container (barrel/chest/etc.) or a lever):

Scriptname SomeKindOfNameHere extends ObjectReferenceMessage Property Popup Auto ;Sets up a property of the type Message. The exact message this refers to has to be defined in the script's Properties window.Event OnActivate(ObjectReference akActionRef) ;An event sent when for example a container, like a barrel, is opened. akActionRef is the reference that activated the object.if(akActionRef == Game.GetPlayer()) ;If the reference that activates the object is the player, then do the following.  int Menu = Popup.Show() ;Create a variable (Menu) that receives the value of the button pressed when showing the message (Popup).  if(Menu == 0) ;If the first button is pressed.   ;Do something here.  elseif(Menu == 1) ;If the second button is pressed.   ;Do something else here.  endifendifEndEvent
User avatar
Siobhan Wallis-McRobert
 
Posts: 3449
Joined: Fri Dec 08, 2006 4:09 pm


Return to V - Skyrim