Post subject: Error:"Can't have lua running in two host threads at a time"
suqd
He/Him
Player (25)
Joined: 3/19/2020
Posts: 4
Hello, I'm having this error appear each time I try to use this function in my .lua script:
savestate.loadslot(0)
The script works like I intended after I click "OK" on this error message. But I have to click it every time the script encounters savestate.loadslot() function. I'm using Bizhawk 2.4.2, have all prereqs installed, Win 7 x64 Home, PSX game. TAStudio is open while .lua script is running. I'm trying to do a bruteforce script for optimizing analog movement; all is working good, except for this annoying error message. Please help a noob owo. Edit: With TAStudio closed, I don't get this error. Does anyone have an idea how to fix this? I'd very much prefer if my brute force bot could work directly on TAStudio inputs.
RetroEdit
Any
Editor, Reviewer, Player (169)
Joined: 8/8/2019
Posts: 152
Do you have TAStudio open? It might be a known bug: https://github.com/TASVideos/BizHawk/issues/2172 The easiest workaround I found is not using TAStudio when using the script.
suqd
He/Him
Player (25)
Joined: 3/19/2020
Posts: 4
RetroEdit wrote:
Do you have TAStudio open? It might be a known bug: https://github.com/TASVideos/BizHawk/issues/2172 The easiest workaround I found is not using TAStudio when using the script.
Yes, I fixed this error by not having TAStudio open while running the .lua script. So, let's say the script finishes its work and stores the best inputs for each frame in tables. Is the next logical step to use a lua function to open TAStudio, and then use lua function to write those inputs into TAStudio? It's my first time making a brute force script for optimizing analog movement. Edit: Just learned that a savestate file has Input Log.txt inside it. So I'll have my script run with TAStudio closed, brute force the movement, and savestate after reaching the destination. Then I can copy input file into a .tasproj or something. Or maybe I can make .bk2 with a lua function. I'll have to figure it out. But I'd still be happy if this bug got fixed, so I could have TAStudio open while my script is running loadstate/loadbranch instructions.