User File #638004792329477740

Upload All User Files

#638004792329477740 - BBLIT "roll action" autoinput

Roll.lua
114 downloads
Uploaded 10/4/2022 11:20 AM by AleMastroianni (see all 3)
Raw script meant to be used with the autowalk one, still might need manual tas adjustments after each use in trajectories
while true do

  POINTER = memory.read_u32_le(0x069640) - 0x80000000 -- USA Version
  
  STATE = memory.read_s8(POINTER + 0x98)
  --States of animations:
  --1 = standing still
  --7 = jumping (freeze for infinite jumps using helic)
  --81 (0x51) = rolling without moving
  --86 (0x56) = rolling with movement

	if STATE ~= 0x56 then
	--print(STATE)
	
		joypad.set({L1=true}, 1)
		emu.frameadvance()
		joypad.set({L1=true}, 1)
	
		--delay time to avoid rolling again too early, despite state being 0x56 after a previous roll, resulting in dropped input
		emu.frameadvance()
		emu.frameadvance()
		emu.frameadvance()
		emu.frameadvance()
		emu.frameadvance()
		emu.frameadvance()
		emu.frameadvance()
		emu.frameadvance()

	else end
  
emu.frameadvance()

end

--Script wrote for emulator bizhawk 2.8, nymashock core, game Bugs Bunny Lost In Time NTSC-U, console PSX
--States handled by different adresses dinamically in ram, hence the usage of a pointer to read data
--Script by AleMastroianni