Jump to content

Where can I find the correct path for the target parameter of the various SKSE UI.Get/Set/Invoke functions?


C4P0N3

Recommended Posts

Hi,

I'm having trouble accessing a variable using UI.GetInt(), particularly iPageSetIndex from BookMenu.as, which I believe is the number of the current page of the book that the player is currently reading.

Looking through the Unofficial Skyrim UI SDK files, I found BookMenu_mc, which seems to be what I'm looking for, but when I put that on the target parameter like this:

UI.GetInt("Book Menu", "_root.BookMenu_mc.iPageSetIndex")

it always returns 0.

I've searched around and found some examples like this one and the one included in the SKSE UI.psc script and they seem to work just fine, but for some reason, I can't get any variables from the Book Menu. I think it might be the path of the target parameter that is wrong, but maybe there is something else that I'm missing. Here's a simple test script I've been using:

 

 

Scriptname UITestScript extends Form

int KeyCodeG = 34

Event OnInit()
	RegisterForKey(KeyCodeG)
	
	; This works
	UI.InvokeString("HUD Menu", "_root.HUDMovieBaseInstance.ShowMessage", "UI Test Script started")
EndEvent

Event OnKeyDown(int KeyCode)	
	If (KeyCode == KeyCodeG)
		If (UI.IsMenuOpen("MagicMenu"))
			; This also works
			Debug.Notification("Height: " + UI.GetInt("MagicMenu", "_root.Menu_mc._height"))
			
			; This does not work, always returns 0
		ElseIf (UI.IsMenuOpen("Book Menu"))
			Debug.Notification("iPageSetIndex: " + UI.GetInt("Book Menu", "_root.BookMenu_mc.iPageSetIndex"))
		EndIf
		
	EndIf
	
EndEvent

 



Any help would be appreciated, thanks.

Link to comment
Share on other sites

Your problem is essentially that "Book Menu" does not refer to BookMenu_mc (movie clip in the interface file book.swf) but instead BottomBar_mc (BottomBar.swf). There is apparently no string you can pass as the first parameter of UI geters to acess the actual interface file handling the paging and such.

 

This is information I was given when asking another modder about a similar matter and I'm passing it along, I don't know my way around interface modding so can't really offer any help as to how to acomplish what you want besides the "bad news" I just gave.

Edited by FrankFamily
Link to comment
Share on other sites

That's unfortunate. I was hoping to use that to make bookmarks so that you can reopen a book on the same page you closed it. I found that by directly setting iPageSetIndex to something like 4 and then calling UpdatePages() you can open any book on that specific page, but without a way to set that via papyrus will make this difficult, to say the least.

 

Thanks for letting me know, though!

Link to comment
Share on other sites

I'm no expert at this either, but try "_global.BookMenu.BookMenuInstance.iPageSetIndex" which probably won't work either. But that's my best guess if there is a way to do it. Since the book menu itself doesn't contain the book I'm hoping that the actual book being read gets dropped into the global context and that's why the BookMenuInstance class variable is being set.

Link to comment
Share on other sites

I'm no expert at this either, but try "_global.BookMenu.BookMenuInstance.iPageSetIndex" which probably won't work either. But that's my best guess if there is a way to do it. Since the book menu itself doesn't contain the book I'm hoping that the actual book being read gets dropped into the global context and that's why the BookMenuInstance class variable is being set.

 

Yep, tried it, doesn't work. However, I was looking into other possible ways to access the class and I came across this bit of code from the source code of SkyrimSouls, which suggests that it can be done via SKSE plugins. I've never written any SKSE plugins before, but it does seem to be the way to go in this case, so I might look into it later.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...