Been trying to help DwangoAC out but now I need your guys' help.
[LuaMethodAttributes(
"openmovie",
"opens the Movie selected"
)]
public static bool OpenMovie(string path)
{
if (path != "")
{
if (MovieService.IsValidMovieExtension(path))
{
GlobalWin.MainForm.LoadMoviesFromRecent(path);
return true;
}
else if (MovieImport.IsValidMovieExtension(Path.GetExtension(path)))
{
string errorMsg;
string warningMsg;
var movie = MovieImport.ImportFile(path, out errorMsg, out warningMsg);
if (!string.IsNullOrEmpty(errorMsg))
{
// TODO: Lua console print: conversion error
return false;
}
else
{
GlobalWin.MainForm.StartNewMovie(movie, false);
return true;
}
}
else
{
// TODO: Not a valid Movie
return false;
}
}
return false;
}
I wrote this function within BizHawk to deal with automatically loading the movie files (since there would be multiple movie files to run within a single directory).
And My LUA script:
client.openrom("C:\\Users\\Mike\\Desktop\\[GameName]")
BasePath = "C:\\Users\\Mike\\Desktop\\Test\\"
for dir in io.popen([[dir "C:\Users\Mike\Desktop\Test" /b]]):lines() do
-- play movie, (turbo, disable rewind, high frame skip), check address
FullPath = (BasePath .. dir)
console.writeline(FullPath)
isSingleMovieLoaded = client.openmovie(FullPath)
while isSingleMovieLoaded == false do
-- wait??
end
-- now we're good to proceed.
while movie.isloaded == true do
writeLog("good.\n");
if memory.read_u8(0x2C) == 1 then
client.pause()
-- if address found, grab framecount and dir and write it to judging table
-- emu.framecount
end
emu.frameadvance()
end
-- movie.stop
end
Right now, it just goes through all the files and thats it. I would like it to speed through a single movie file at a time and wait until the movie is loaded then unpause or start advancing frames.