Skip to content

Lua: openmw.input bugs during main menu on scripts attached to MENU

Triggers/actions made during the main menu do not persist when loading into the game, whether using new game or loading a saved game.

using openmw .49-RC5

No other mods than my test mod

Test mod: https://pastebin.com/ZfXCC5dT

Logs: https://pastebin.com/MmabfksL

reproduction steps:

  1. attach test mod to MENU
  2. load into main menu
  3. make bindings for the test action and trigger in settings->scripts
  4. load into the game
  5. try and use the bindings (nothing happens)
  6. console -> reloadlua
  7. try the bindings again (should work now)

When loading into the game the following errors appear in the log

[17:23:51.784 I] Changing to interior
[17:23:51.785 I] Loading cell Seyda Neen, Foryn Gilnith's Shack
[17:23:51.793 E] Menu[example/menu.lua] onFrame failed. Lua error: Unknown action key: "TestAction"
[17:23:51.793 E] stack traceback:
[17:23:51.793 E] 	[C]: in function 'getBooleanActionValue'
[17:23:51.793 E] 	[string "example/menu.lua"]:85: in function <[string "example/menu.lua"]:75>
[17:23:51.793 E] 	[C]: in ?
[17:23:51.793 I] L@0x1[scripts/omw/input/actionbindings.lua]:	Skipping invalid binding TestTrigger: trigger TestTrigger doesn't exist
[17:23:51.793 I] L@0x1[scripts/omw/input/actionbindings.lua]:	Skipping invalid binding TestAction: action TestAction doesn't exist

The error that "TestAction" does not exist is spammed every frame since my test script checks it every frame.

Edited by Mads Buvik Sandvei