Anyway to force a MessageBox closed?

Post » Fri Feb 18, 2011 9:27 pm

I'd like a series of Message Boxes to flip through automatically-- the script for doing that is fine, but the closing of the messageboxes is the problem: does anyone know how to do this without making the Player press "OK" every time?
User avatar
Tai Scott
 
Posts: 3446
Joined: Sat Jan 20, 2007 6:58 pm

Post » Sat Feb 19, 2011 3:07 am

I'd like a series of Message Boxes to flip through automatically-- the script for doing that is fine, but the closing of the messageboxes is the problem: does anyone know how to do this without making the Player press "OK" every time?
Simulate that the player presses "OK". I do it a lot in my mods. OBSE's "ClickMenuButton" is the function to use.
User avatar
Jimmie Allen
 
Posts: 3358
Joined: Sun Oct 14, 2007 6:39 am

Post » Sat Feb 19, 2011 1:50 am

Thanks for the suggestion :) Could you explain a bit more about how I'd do that, please?

According to the wiki...
Simulates the user clicking on the specified UI component. Pass the fully qualified component name as described above, or pass the trait of the desired component as specified in the XML, preceded by a '#'; i.e. "#32" to click the button with ID 32. Note that specifying the name results in much better performance than specifying an ID.


But how do I identify the ID of a button in a MessageBox? And if I do it like this, can I still have user input for another button, if necessary?
User avatar
Erika Ellsworth
 
Posts: 3333
Joined: Sat Jan 06, 2007 5:52 am

Post » Sat Feb 19, 2011 7:41 am

Thanks for the suggestion :) Could you explain a bit more about how I'd do that, please?

Here's a part of a script from Enhanced Economy, where the mod opens and immediately closes the haggle menu (a trick forcing the engine to re-calculate prices):
Begin MenuMode 1025	if autoCloseHaggle		ClickMenuButton "negotiate_background\negotiate_button_okay\" 1025		DebugPrint "EE:Auto-close haggle menu"                ...


Note that I here used the fullly qualified name of the button instead of the ID.


But how do I identify the ID of a button in a MessageBox?

Look up the xml, or make a quest script something like this:

ScriptName showUIdatastring_var fullPathshort currentMenufloat fQuestDelayTimeBegin MenuMode	let fQuestDelayTime := 0.001		if OnKeyDown 38  ; when L is pressed		let fullPath := GetActiveUIComponentFullName		let currentMenu := GetActiveMenuMode		PrintC "Menumode %.0f: %z", currentMenu, fullPath		PrintTileInfo $fullPath currentMenu	endifEnd

To use it, point at a button and press "L", and all the info you need will be printed to the console.

And if I do it like this, can I still have user input for another button, if necessary?
Of course, and of that specific button as well, if you want.
User avatar
Judy Lynch
 
Posts: 3504
Joined: Fri Oct 20, 2006 8:31 am

Post » Sat Feb 19, 2011 9:43 am

Thanks :D
User avatar
aisha jamil
 
Posts: 3436
Joined: Sun Jul 02, 2006 11:54 am


Return to IV - Oblivion