kasichyko Posted May 4, 2017 Share Posted May 4, 2017 Is there a script line to close crafting menus?^ |I'm finishing a quick quest mod (which is to add a new power to the game but i felt that a quest to get it would be nicer) and as requirement to some crafting recipes I put the quest stage level so they craft 1 of said item. Problem is that as the crafting menu doesn't shut they can keep crafting as long as they dont close this menu. I did it this way because the items to craft them are quest items until they craft the following ones (with other ingredients) and replace the alias of the previous ones in the quest; this because apparently there's no way to use a quest item as ingredient. Anyway, a simple command to close this menu would be enough for me as I can add it to the lines of the just crafted item.(also thought of clearing the alias during these crafting menus but that seemed like a lot of trouble) Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 4, 2017 Share Posted May 4, 2017 I know of no specific line of code that will close the crafting menus. A work around with SKSE using papyrus would be to get the player's key bind for the exit button, then with a check to ensure that the crafting menu has been opened, tap the exit button key once the player obtains the targeted crafted item. May or may not work with game pad controllers. Might need to do specific code for keyboard and then again for game pad. Not sure on that, you'll need to investigate the commands. GetMappedKeyTapKeyIsMenuOpen Link to comment Share on other sites More sharing options...
kasichyko Posted May 4, 2017 Author Share Posted May 4, 2017 I mean yeah, maybe I was more specific than what i meant, to close any menu in general would work, I tried disabling and enabling player controls and play an idle but doesn't seem to do the trick xD. Link to comment Share on other sites More sharing options...
kasichyko Posted May 4, 2017 Author Share Posted May 4, 2017 (edited) Ok so i tried (after I updated skse just in case) but can't get these lines to work :sint exitkey = input.GetMappedKey("Tween Menu")input.TapKey(exitkey)And i get (12,14): variable input is undefined(12,20): none is not a known user-defined type(12,4): type mismatch while assigning to a int (cast missing or types unrelated)(13,0): variable input is undefined(13,6): none is not a known user-defined typeThen I try again first declaring "input" as an int property and I get(12,20): int is not a known user-defined type(12,4): type mismatch while assigning to a int (cast missing or types unrelated)(13,6): int is not a known user-defined typeThen I changed the exitkey variable to string and the mismatch stopped appearing, and at that point I knew i was f***ed up and lost XD... I mean I was only supposed to assign a numeric value from the getmappedkey and then press it with tapkey, how hard can that be!?Anyway, from a different point of view, does this only work in certain scripts? cause in my case this is an objectreference since im triggering lots of different actions through it (like changing alias and stages in quest and so on)... otherwise I'm not quite sure where my fault is (I'm not yet used to scripting on ck sorry x.x) Edit:Tried changing input to form and now:(13,16): GetMappedKey is not a function or does not exist(14,6): TapKey is not a function or does not existLike... for real? ... sorry I'm trying to solve it on my own but I seriously have no idea what's missing xD Edited May 4, 2017 by kasichyko Link to comment Share on other sites More sharing options...
PeterMartyr Posted May 4, 2017 Share Posted May 4, 2017 I used the below code to open Console Menu & close it, but I am no way proficient, I just adapted it to suite my needs. I needed to pause VM for a certain code to work correctly. Function SetConsoleAndWait(float fWait) debug.ToggleMenus() Utility.Wait(0.5) UI.InvokeString("HUD Menu", "_global.skse.OpenMenu", "Console") utility.WaitMenuMode(fWait) UI.InvokeString("HUD Menu", "_global.skse.CloseMenu", "Console") Utility.Wait(1) debug.ToggleMenus() EndFunction I am just point out that you need the UI.PSC codes to achieve your goal of closing a Menu like Crafting. UI.InvokeString("HUD Menu", "_global.skse.CloseMenu", "Crafting Menu") It's untested for closing Crafting Menu, but my SetConsoleAndWait works 100% for Form & Function. Hopefully some one better than me with UI Scripts will help. Cause that all I got. It obvious requires SKSE has well. Cheeers Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 4, 2017 Share Posted May 4, 2017 Ok so i tried (after I updated skse just in case) but can't get these lines to work :sint exitkey = input.GetMappedKey("Tween Menu")input.TapKey(exitkey)And i get (12,14): variable input is undefined(12,20): none is not a known user-defined type(12,4): type mismatch while assigning to a int (cast missing or types unrelated)(13,0): variable input is undefined(13,6): none is not a known user-defined typeThen I try again first declaring "input" as an int property and I get(12,20): int is not a known user-defined type(12,4): type mismatch while assigning to a int (cast missing or types unrelated)(13,6): int is not a known user-defined typeThen I changed the exitkey variable to string and the mismatch stopped appearing, and at that point I knew i was f***ed up and lost XD... I mean I was only supposed to assign a numeric value from the getmappedkey and then press it with tapkey, how hard can that be!? Anyway, from a different point of view, does this only work in certain scripts? cause in my case this is an objectreference since im triggering lots of different actions through it (like changing alias and stages in quest and so on)... otherwise I'm not quite sure where my fault is (I'm not yet used to scripting on ck sorry x.x) Edit:Tried changing input to form and now:(13,16): GetMappedKey is not a function or does not exist(14,6): TapKey is not a function or does not existLike... for real? ... sorry I'm trying to solve it on my own but I seriously have no idea what's missing xD How did you install SKSE? Manually? With Steam installer? With installer downloaded from SKSE site? I've always used the manual method and so cannot speak to what happens with the others. However, your errors indicate that the source scripts (PSC) files are not present where your CK is able to see them. You may need to re-install SKSE manually to ensure that you also get the PSC files in place. Link to comment Share on other sites More sharing options...
kasichyko Posted May 4, 2017 Author Share Posted May 4, 2017 How did you install SKSE? Manually? With Steam installer? With installer downloaded from SKSE site? I've always used the manual method and so cannot speak to what happens with the others. However, your errors indicate that the source scripts (PSC) files are not present where your CK is able to see them. You may need to re-install SKSE manually to ensure that you also get the PSC files in place. OH my, thank you, apparently the installer did miss some files xDIf I get it running I'm soon to release this mod! (which I'm actually making to practice CK while having some fun and I'll go back to my main "project" xD) anyway I think I can take it from here so thanks. Link to comment Share on other sites More sharing options...
Recommended Posts