besteon / Ironmon-Tracker

A Lua script for the Bizhawk/mGBA emulator compatible with Pokemon Fire Red, Leaf Green, Ruby, Sapphire, and Emerald that tracks relevant data for the IronMon challenge.
MIT License
129 stars 45 forks source link

[Bug]: Pokemon sometimes having additional characters in Team Viewer when you don't nickname #380

Closed chandlerbogolin closed 1 year ago

chandlerbogolin commented 1 year ago

Describe the bug

Seems a bit random if it happens or not, but occasionally, after acquiring a pokemon (starter included) and being prompted with the nickname screen, if you try to skip it and just go to done to not nickname it, it sometimes adds additional characters to the end of the name, and only does this in the team viewer. Running Pokemon Emerald with the patch.

Steps to Reproduce

  1. acquire starter from professor
  2. be prompted with nickname screen
  3. press enter to exit
  4. name in team view sometimes gets additional characters

What tracker version are you using?

v7.5.3

What operating system are you using?

Windows 10

What emulator(s) are you seeing the problem on?

Bizhawk 2.8

Relevant log output

No response

Additional Information

2023-05-09@12-35-27__RSE_Standard_v3_AutoRandomized_ Gameboy_Advance _-

Fellshadow commented 1 year ago

Thanks for the bug report! I was able to reproduce this pretty easily (it occurs even before opening the nickname menu, as soon as you get the mon), and added a fix on the dev branch (commit: eb67ca8). It's also now on the beta-test branch so you can try it out via the "dev branch" updates in the tracker.

To give more info (to the other devs mainly): Essentially what was happening was when reading the Pokémon's nickname (which is what's displayed on the team viewer) the tracker was only checking for ~=0xFF on the character bytes for looking for the end of sequence, and it turned out for whatever reason there were garbage characters after the "end of sequence" which were getting added on.

The commit changes it to just break out of the loop at the end of sequence, so it doesn't read those extra characters. Done some testing and it seemed to work fine (both when I gave nicknames and skipped to use default)

chandlerbogolin commented 1 year ago

awesome, appreciate the quick response!

chandlerbogolin commented 1 year ago

hmm, I keep getting this when trying to do the update through the tracker Settings > Update > toggle 'Dev Branch Updates' > Install Now; could definitely be just me not doing something right 😅

Loading Ironmon Tracker for Bizhawk (Gen 3) Ironmon Tracker v7.5.3 successfully loaded Previously saved Tracker data for this game has been loaded attempt to yield across metamethod/C-call boundary NLua.Exceptions.LuaException: unprotected error in call to Lua API (0) at NLua.Lua.PanicCallback(IntPtr luaState) at lua_error(lua_State ) at NLua.ObjectTranslator.throwError(IntPtr luaState, Object e) at NLua.Lua.SetPendingException(Exception e) at NLua.LuaMethodWrapper.call(IntPtr luaState) at NLua.MetaFunctions.runFunctionDelegate(IntPtr luaState) at lua_resume(lua_State , Int32 ) at BizHawk.Client.EmuHawk.Win32LuaLibraries.ResumeScript(LuaFile lf) at BizHawk.Client.EmuHawk.LuaConsole.<>c__DisplayClass61_1.b__1() at BizHawk.Client.Common.LuaSandbox.Sandbox(Action callback, Action exceptionCallback)

Fellshadow commented 1 year ago

oh that's strange, just tried it from a fresh release and it happened to me too, not just you 🤔 Will look into it

Fellshadow commented 1 year ago

@chandlerbogolin ok so it worked for me on bizhawk 2.9, it might be a bizhawk 2.8 thing. No idea what the cause is exactly but at least that's a way for you to get the dev branch update in the meantime if you wanted it

chandlerbogolin commented 1 year ago

I know this isn't the right place probably, but is there a way to update bizhawk from inside the app, or would I just need to download the newest version?

Fellshadow commented 1 year ago

there isn't a built-in way, you'll have to download it separately yeah