Joined: 7/17/2012
Posts: 544
Location: Switzerland
Is it possible to create a timer in lua based on the number of frames elapsed or on the number of frames per second of the emulation? (Bizhawk) For example for Night Trap, there is here the solution "The Perfect Game - 83 moves in total", this one is based on the in-game time. It might be necessary to count down then remove the time from the intro of the Sega Mega-CD and from the intro to this timer.
My Citra 3DS rerecording movie files test repositery: https://cutt.ly/vdM0jzl Youtube playlist "Citra Tests": https://cutt.ly/AdM0wg9 http://www.youtube.com/user/phoenix1291
Lil_Gecko
He/Him
Player (98)
Joined: 4/7/2011
Posts: 520
phoenix1291 wrote:
Is it possible to create a timer in lua based on the number of frames elapsed or on the number of frames per second of the emulation? (Bizhawk) For example for Night Trap, there is here the solution "The Perfect Game - 83 moves in total", this one is based on the in-game time. It might be necessary to count down then remove the time from the intro of the Sega Mega-CD and from the intro to this timer.
Not sure I understand exactly what you mean but I think you can use
Language: lua

while emu.framecount() < number do emu.frameadvance(); end;
to reach a certain point and use
Language: lua

for i=1,number do emu.frameadvance(); end;
to advance a certain number of frames. For exemple :
Language: lua

number=1200; number2=60; while true do while emu.framecount() < number do emu.frameadvance(); end; client.pause(); for i=1,number2 do emu.frameadvance(); end; client.pause(); end;
would advance to frame 1200, then pause, then advance 60 frames and pause again. You can of course put any code you want instead of pause.