TASEmulators / TASEmulators/BizHawk

Lua client.getconfig object indexing issues

Open
#2,368 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

re: Lua API/scripting Repro: Affects 2.5 Repro: Regression from 2.4 Waiting on dev consensus
Dominant language
C#
Stars
2.8k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

Summary

As of 2.5.0 the client.getconfig().CoreSettings or CoreSyncSettings objects do not accept 'BizHawk.Emulation.Cores.Sony.PSX.Octoshock' as a valid index. Looking at config.ini the structure remains the same and it is listed the same way as before, so it seems like it should work just fine. I am using this to detect the display mode automatically for my script. Furthermore attempting to index CommonToolSettings with 'BizHawk.Client.EmuHawk.LuaConsole' does work without issues, so the problem seems to only be with CoreSettings or at least not all properties inside the settings object.

Note: In 2.4 and 2.3 a few users had the following issue, though the majority did not. I was not able to replicate that issue on both my Win7 and Win10 systems.

NLua.Exceptions.LuaScriptException: [string "main"]:34: attempt to call field 'getconfig' (a nil value)
Repro
client.getconfig().CoreSettings['BizHawk.Emulation.Cores.Sony.PSX.Octoshock'].ResolutionMode
Output
NLua.Exceptions.LuaScriptException: attempt to index field 'BizHawk.Emulation.Cores.Sony.PSX.Octoshock' (a nil value)
Problematic Build
  • BizHawk 2.5.0; Win7 Pro ; Intel/NVIDIA
  • BizHawk 2.4 Developer-2020-04-16-172542
Working Builds
  • BizHawk 2.4
  • BizHawk 2.3.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Lua API entry point for client.getconfig() and trace how CoreSettings indexes BizHawk.Emulation.Cores.Sony.PSX.Octoshock. Compare the behavior in the problematic BizHawk 2.5.0 build with the working 2.4 and 2.3.2 builds. Done means the reproduced expression returns ResolutionMode instead of raising a nil-index error.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.