authorblues / bizhawk-shuffler-2

A script to randomly shuffle between games played in Bizhawk, with plugins to enhance the experience
MIT License
58 stars 21 forks source link

NLua.Exceptions.LuaException: unprotected error in call to Lua API (0) #47

Closed nameless01234567 closed 2 years ago

nameless01234567 commented 2 years ago

After using the shuffler for a while and reseting a couple of times due to unrelated audio issues, this message appeared NLua.Exceptions.LuaException: unprotected error in call to Lua API (0) em NLua.Lua.PanicCallback(IntPtr luaState) em lua_error(lua_State ) em NLua.ObjectTranslator.throwError(IntPtr luaState, Object e) em NLua.Lua.SetPendingException(Exception e) em NLua.LuaMethodWrapper.call(IntPtr luaState) em NLua.MetaFunctions.runFunctionDelegate(IntPtr luaState) em lua_resume(lua_State , Int32 ) em BizHawk.Client.EmuHawk.Win32LuaLibraries.ResumeScript(LuaFile lf) em BizHawk.Client.EmuHawk.LuaConsole.<>c__DisplayClass61_1.b__1() em BizHawk.Client.Common.LuaSandbox.Sandbox(Action callback, Action exceptionCallback) then it stopped working.

OS: Windows 10 Bizhawk Version: 2.6.2 message.log image

nameless01234567 commented 2 years ago

Some more information that I discovered yesterday. The error happens if the core is changed after there is a savestate in a different core. Only solution I can think of is deleting all saves of a specific core if there is ever a need to change it.

authorblues commented 2 years ago

Interesting. Savestates from different cores are always going to mutually incompatible, but I wonder if there is some way to easily identify such a mistake. Can probably save core information in the config file to announce the problem before the error happens.

nameless01234567 commented 2 years ago

I'm aware of that, but glad if this helps somehow.