Grimaer Posted July 2, 2020 Share Posted July 2, 2020 I'm basically looking for the inverse of Container.Activate(PlayerRef), that closes the container and kicks you out of the inventory UI window. I read that there was a way to close player inventory by disabling the controls and re-enabling them. That didn't kick me out of the container UI, so I left the controls disabled (for science!) when i closed out manually and had to alt-F4 because everything was locked, so I know i did it right, it just didn't work for this particular scenario. I've had no luck with Google - is this at all possible? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 2, 2020 Share Posted July 2, 2020 Theoretically, you can use SKSE to tap the key that closes the container UI. If you want to avoid SKSE, then I am not sure if what you want is possible. Link to comment Share on other sites More sharing options...
Grimaer Posted July 2, 2020 Author Share Posted July 2, 2020 I had no idea it was a thing, and I already have SKSE installed so it's a great suggestion. It doesn't seem to do anything at all though. I play on PC with a PS4 controller. No issues with it but I wasn't sure how the buttons mapped, so I used Debug.Notification(Input.GetMappedControl(277)to confirm that "Tween Menu" is assigned to scancode 277 (the same button is used to close out of menus and inventories that opens that menu) But Input.TapKey(Input.GetMappedKey("Tween Menu", 0xFF)) does nothing. I checked it with the keyboard scancode too (it's 15, the Tab key apparently, which the game ignores) - nothing. I tried it in an onPlayerLoadGame event (after a few seconds' wait), with no UI open and no other buttons being pressed. It's compiling with no errors, and the debug.notification on the previous line is showing up as expected. I even enabled Papyrus logs, which don't have anything to say about it. What am I missing? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 2, 2020 Share Posted July 2, 2020 Try not to nest it. Assign it to a variable then tap it. Something like: Int TweenKey = Input.GetMappedKey("Tween Menu",0xFF) Input.TapKey(TweenKey)Hopefully that solves the issue. Link to comment Share on other sites More sharing options...
Grimaer Posted July 2, 2020 Author Share Posted July 2, 2020 (edited) I wouldn't have even thought of that being an issue. I had previously tried calling it directly with Input.TapKey(277) but that didn't seem to do anything different. I tried your method just to be sure though. It also finally occurred to me to register for keypress events to see if it was even firing - it is, I get notifications every time I enter the menu, cancel out of a container or the menu, and also when the script fires the appropriate TapKey. Apparently the game's just ignoring it. (Tested it with Jump, too. Same thing, tapping the key via script does nothing in-game, but the script picks up that the key was pressed.) Is there any reason the game engine would fail to receive keypresses via script? It's working on the Papyrus side, it just doesn't seem to be getting sent to the engine. Edited July 2, 2020 by Grimaer Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 2, 2020 Share Posted July 2, 2020 Can you see if it works properly with keyboard? I'm finding some google results that seem to indicate issues with it when using a controller. So much so that a mod was made for original Skyrim to correct the issue: https://www.nexusmods.com/skyrim/mods/71444. Sadly, I know of no SSE variant. Link to comment Share on other sites More sharing options...
Grimaer Posted July 3, 2020 Author Share Posted July 3, 2020 Yeah, it worked with controls set to mouse/keyboard, so it's the same bug from before. At least I know what the issue is now, even if there's nothing I can do about it. It's not gamebreaking or anything, and it's still possible to detect controller vs mouse/keyboard inputs so a conditional in-game heads up can be incorporated. All in all, not so bad. Thanks for all the help! Link to comment Share on other sites More sharing options...
Recommended Posts