InvokeBool, InvokeString, etc: How to use them ?

Post » Tue Nov 19, 2013 9:31 pm

Hi everyone.

Can someone help me with http://www.creationkit.com/UI_Script# ? For example, how do I know which one to use for each valid menu name ?

Thanks a lot :smile:

Spoiler
User avatar
Darian Ennels
 
Posts: 3406
Joined: Mon Aug 20, 2007 2:00 pm

Post » Wed Nov 20, 2013 2:44 am

Those functions can be used to call functions that exist in the ActionScript of the Flash files. Here's https://github.com/Mardoxx/skyrimui/tree/master/src repository of ActionScript for Skyrim's Flash files. https://github.com/schlangster/skyui.plugins/blob/master/PapyrusScaleform/UI.psc are a few examples by Schlangster on how the functions can be used.

Some ActionScript functions will require a certain type of argument, hence the various versions of the Invoke function. I use some of those functions in All Geared Up and Project Ilmarinen. Here's an example from All Geared Up:

UI.InvokeString("HUD Menu", "_global.skse.OpenMenu", "InventoryMenu")

This function call opens up the player's inventory. The first argument is the menu that is currently being displayed, which in this case is the HUD. The second argument contains the path, "_global.skse", to the function I'm calling, "OpenMenu". The final argument is a string with the name of the menu I wish to open. Hence the use of InvokeString().

I use the following line in Project Ilmarinen to update the barter menu when I add items to the NPC providing a service.

UI.InvokeNumber("BarterMenu", "_root.Menu_mc.doTransaction", 0.0)

First argument: The menu that is currently being displayed/the one I want to manipulate.

Second argument: The path to the function I wish to call.

Third argument: The number I want to pass to doTransaction.

If I didn't call doTransaction(), then the barter menu wouldn't update and show the added item until the player bought/sold an item or left the menu and opened it again. There are probably other ActionScript functions that could be invoked in order to update the inventory list.

https://github.com/Mardoxx/skyrimui/blob/master/src/bartermenu/BarterMenu.as the ActionScript for the barter menu. There's a function called doTransaction that looks like this:

function doTransaction(aiAmount: Number): Void        {                GameDelegate.call("ItemSelect", [aiAmount, ItemCard_mc.itemInfo.value, IsViewingVendorItems()]);        }

This function has a single argument, which is a number, and thus InvokeNumber() must be used.

Mardoxx's repository is awesome for finding out about the inner workings of the various menus and how they can be manipulated via Papyrus.

User avatar
SexyPimpAss
 
Posts: 3416
Joined: Wed Nov 15, 2006 9:24 am

Post » Tue Nov 19, 2013 6:54 pm

Thank you for this very detailed answer ! I'll study that, thank you again :)

User avatar
Katharine Newton
 
Posts: 3318
Joined: Tue Jun 13, 2006 12:33 pm


Return to V - Skyrim