Post subject: Lua Script for Abe Hitbox
Samtastic
He/Him
Player (154)
Joined: 11/30/2012
Posts: 778
Is there a way to make a lua script for Abe's Oddysee? I need one that puts a Hitbox around Abe so I can see where he is whilst he's invisible.
Enjoys speedrunning, playing and TASing Oddworld games! Has TASed: Oddworld: Abe's Oddysee in 12.06.13 (with Dooty) Oddworld: Adventures II in 20.03.78 (with Dooty) Oddworld: Abe's Exoddus 100% in 2:08:28.4 (with Dooty) Oddworld: Abe's Oddysee 100% in 1:05:01.65 Oddworld: Abe's Exoddus in 37:18 Oddworld: Abe's Exoddus in 37:15 Oddworld: Abe's Exoddus 100% in 2:!5.44.12 Oddworld: Abe's Oddysee any% in 13:01.3 Oddworld: Abe's Oddysee any% in 12:59.95 Oddworld: Abe's Oddysee 100% in 1:04:16.27 Oddworld: Abe's Oddysee 100% in 1:04:01.07 Currently working on: Waiting for Windows TAS Tools to work so I can TAS PC version of Exoddus.
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
bizhawk comes with about 6000 examples of lua scripts, some of which do hitboxes. so yes.
Amaraticando
It/Its
Editor, Player (159)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Tell me the main RAM addresses, I can try. If you wanna do the same for enemies, the problem is: PSXHawk doesn't have a trace logger yet, so the script should be made experimentally. I've done that before, but it's not so trivial. For instance, you may draw Abe with a small hitbox but enemies with bigger ones. Or the reverse... Some games have different hitboxes (vs sprites, vs solid objects, etc), so this is another complication.
Samtastic
He/Him
Player (154)
Joined: 11/30/2012
Posts: 778
On PCSX the RAM address for Abe's Y position was 0x001F6116. Abe X position was: 0x001F6112.
Enjoys speedrunning, playing and TASing Oddworld games! Has TASed: Oddworld: Abe's Oddysee in 12.06.13 (with Dooty) Oddworld: Adventures II in 20.03.78 (with Dooty) Oddworld: Abe's Exoddus 100% in 2:08:28.4 (with Dooty) Oddworld: Abe's Oddysee 100% in 1:05:01.65 Oddworld: Abe's Exoddus in 37:18 Oddworld: Abe's Exoddus in 37:15 Oddworld: Abe's Exoddus 100% in 2:!5.44.12 Oddworld: Abe's Oddysee any% in 13:01.3 Oddworld: Abe's Oddysee any% in 12:59.95 Oddworld: Abe's Oddysee 100% in 1:04:16.27 Oddworld: Abe's Oddysee 100% in 1:04:01.07 Currently working on: Waiting for Windows TAS Tools to work so I can TAS PC version of Exoddus.
Amaraticando
It/Its
Editor, Player (159)
Joined: 1/10/2012
Posts: 673
Location: Brazil
This is absolute beta, because I never investigated this game. A bunch of situations are not accounted or wrong, and you'll see. The width and height are arbitrary.
Language: lua

local abe_semi_width, abe_semi_height = 8, 24 while true do local abe_x = mainmemory.read_u16_le(0x1f6112) local abe_y = mainmemory.read_u16_le(0x1f6116) local camera_x = mainmemory.read_u16_le(0x08abe6) local camera_y = mainmemory.read_u16_le(0x08abea) local x_offset = 203 + abe_x - camera_x local y_offset = 124 + abe_y - camera_y gui.text(0, 64, string.format("Abe (%d, %d)", abe_x, abe_y), "black", "yellow") gui.text(0, 80, string.format("Cam (%d %d)", abe_x - camera_x, abe_y - camera_y), "black", "yellow") gui.drawRectangle(x_offset - abe_semi_width, y_offset - 2*abe_semi_height, 2*abe_semi_width, 2*abe_semi_height, "blue") gui.drawPixel(x_offset, y_offset) emu.frameadvance() end
Further development would be better in the Oddysee thread.