How can I let a movie play back in TAStudio while applying input on the go via lua?
Language: Lua
-- this code isn't working
myjoypad = joypad.getwithmovie()
if myjoypad.Left then
local random_num = math.random()
local apply_change = false
if random_num < 0.1 then
myjoypad.Right = true
apply_change = true
elseif random_num > 0.9 then
myjoypad.Up = true
apply_change = true
end
if apply_change then
tastudio.setrecording(true)
joypad.set(myjoypad)
tastudio.applyinputchanges()
tastudio.setrecording(false)
end
end
EDIT: Nvm, here is working code I figured out.
Language: Lua
myjoypad = joypad.getwithmovie()
if myjoypad.Left then
local random_num = math.random()
if random_num < 0.1 then
tastudio.submitinputchange(emu.framecount(), "Right", true)
tastudio.applyinputchanges()
elseif random_num > 0.9 then
tastudio.submitinputchange(emu.framecount(), "Down", true)
tastudio.applyinputchanges()
end
end