[OBSE] ClickMenuButton

Post » Wed Mar 17, 2010 6:59 am

I'm trying to expand on another modder's mod by adding the ability to press the A key to auto attempt lockpicking and press the D key to exit. Here's what I have so far...

float fQuestDelayTimeshort curkeybegin MenuMode 1014	if (fQuestDelayTime == 0)		set fQuestDelayTime to 0.01	endif	if ( curKey && isKeyPressed3 curkey ) ; key still being held down		return ; wait until it's released	else		set curkey to 0	endif	if ( isKeyPressed3 30 )		ClickMenuButton "#5" 1014		set curKey to 30	endifend


Unfortunately, it has no effect. I confirmed that the code does get processed (using debug text outputs), but pressing the A key (30) does nothing. This code works great on containers, just not on the lockpicking menu.

Anyone know why?

My only idea is that this is a minigame, not a menu. Not sure if that makes a diff.
User avatar
Sarah MacLeod
 
Posts: 3422
Joined: Tue Nov 07, 2006 1:39 am

Post » Wed Mar 17, 2010 9:39 am

Unfortunately, it has no effect. I confirmed that the code does get processed (using debug text outputs), but pressing the A key (30) does nothing. This code works great on containers, just not on the lockpicking menu.

Anyone know why?

My only idea is that this is a minigame, not a menu. Not sure if that makes a diff.
I think your problem is the line:
ClickMenuButton "#5" 1014


I haven't checked the XML layout of the lockpick menu, but I would be surprised if the fully qualified name of the button is "#5". As an example, here is my code line from Enhanced Economy where I auto-close the haggle menu:
ClickMenuButton "negotiate_background\negotiate_button_okay\" 1025


"negotiate_background\negotiate_button_okay\" is the string that GetActiveUIComponentFullName returns, so make a little script that prints out what GetActiveUIComponentFullName returns when your mouse is pointing at the button you want to click on, and use that text in your call.
User avatar
Jodie Bardgett
 
Posts: 3491
Joined: Sat Jul 29, 2006 9:38 pm

Post » Wed Mar 17, 2010 5:31 am

It's a known problem, most likely due to the special properties of the lockpick menu.

TheNiceOne: You can use #buttonID instead of the qualified name.
User avatar
Emma Parkinson
 
Posts: 3401
Joined: Wed Jul 26, 2006 5:53 pm

Post » Tue Mar 16, 2010 6:03 pm

Niceone: Kyoma is correct, you can use the #buttonId also. The qualified name is more efficient though, so I might eventually upgrade my current mod that way. (thx for the suggestion)

I spent all of last night adding keyboard functionality to ALL the menues, using the A and D keys. A = actions (take all, activate persuasion minigame, etc.). D = Done (exit, quit, bye, close). I've added the ability to navigate between tabs on the Character stats screens and the Maps/Quest screens using both those keys (A & D). Also, when on the pause menu and the save/load/options menues, pressing ESC will send you back to the previous menu.

I'm testing the mod today, but so far it's wayyy smoother than using that darn mouse. It's really appealing to the lazy bastard in me! lol. Just wish I could access that lockpick menu. :P

If any of you are interested in this mod let me know, I'll archive it and post it on theNexus.
User avatar
Sarah Bishop
 
Posts: 3387
Joined: Wed Oct 04, 2006 9:59 pm


Return to IV - Oblivion