Post subject: Lua Movie Start Workarounds
Player (33)
Joined: 2/16/2012
Posts: 282
I'm trying to set up a script that can, ideally, start and stop movies as needed. BizHawk right now only has a movie.stop() function documented, so I'm left to try to come up with some workarounds, and I'm hoping some of you can help. The primary issue is that I need to be able to sample a movie periodically to fit the use case. As far as I can tell, BizHawk stores its temporary movie data in memory as opposed to in a temporary file somewhere (please correct me if I'm wrong). This means that the only way I can make a copy of the current movie and send elsewhere is to stop the movie. But if I stop it within lua I have no way to restart it, and thus automation is lost. With that in mind, what's the best way to get around this? I could potentially grab all of the inputs from each frame and store them away in my own file format, but that feels like a few too many unnecessary steps for what it gets me. Same thing with trying to hack a movie.start into the source code. Is there some way to force BizHawk to dump the temporary movie to a file without ending the movie, or alternatively is there some way to start movies within lua? General idea: start movie @ save state -> record actions -> send movie file -> return to save state & repeat
Player (144)
Joined: 7/16/2009
Posts: 686
First of all, as far as I know there is currently no way to start (or save to file) a movie using Lua, although these features exist in the menu. You're probably best of submitting a feature request for these. Secondly, grabbing inputs and storing them into a file yourself isn't all that hard. Using movie.getinputasmnemonic(int frame), you can easily get the exact representation of the input, meaning your file would be a perfectly legit input log.