Hjorr Posted December 22, 2019 Share Posted December 22, 2019 Hello Everyone, I'm trying to get the formID of the item that has got mouse focus on while in the inventory, In other words, the item which is highlighted, not necessarily activated. I've done some research, and I think that I have found what I need, but I can't seem to make it work properly. My script compiles with no errors but the notification displays Item = None on the "activate" while in inventory Keyup event. Other users seem to have used the same path (_root.Menu_mc.inventoryLists.itemList.selectedEntry.formId) with success Any idea of what I'm doing wring here? I could really use some help. Thanks in advance! Here's my script: Event OnInit() IKey = Input.GetMappedKey("Activate") RegisterForKey(IKey) EndEvent Event OnKeyUp(Int KeyCode, Float HoldTime) If KeyCode == IKey Form ValuableItem = Game.GetFormEx(UI.GetInt("InventoryMenu", "_root.Menu_mc.inventoryLists.itemList.selectedEntry.formId")) debug.Notification("Item = " + ValuableItem) EndIf EndEvent Link to comment Share on other sites More sharing options...
Hjorr Posted December 23, 2019 Author Share Posted December 23, 2019 Ok, solved. The script works with SKYUI installed. I just needed to extract and copy the SKYUI .psc and .pex scripts into the data/scripts folder and then to import them in my script like so. Scriptname AYF_BardQuestScript extends Quest import ski_activeeffectswidgetimport SKI_ConfigBaseimport SKI_ConfigManagerimport ski_configmenuimport ski_favoritesmanagerimport ski_mainimport SKI_PlayerLoadGameAliasimport ski_qf_configmanagerinstanceimport SKI_QuestBaseimport ski_settingsmanagerimport ski_widgetbaseimport ski_widgetmanager MiscObject Property Lute AutoMiscObject Property Flute Auto MiscObject Property Flute01 Auto MiscObject Property DancersFlute Auto MiscObject Property Drum Auto string itemName Int IKey Event OnInit()IKey = Input.GetMappedKey("Activate")RegisterForKey(IKey ) EndEvent Event OnKeyDown(Int KeyCode) If KeyCode == IKey itemName = UI.GetString("InventoryMenu", "_root.Menu_mc.inventoryLists.itemList.selectedEntry.text") debug.Notification("Item = " + itemName ) EndIfEndEvent Link to comment Share on other sites More sharing options...
Recommended Posts