I want to write a script that can display enemy names in Super mario land 2 in a list on screen.
This picture describes my approach.
http://i.imgur.com/iBBQTS5.png
The problem is that I'm unable to display stuff in a list.
I saw this kind of for loop in an old Daffy duck lua script by Scepheo. But in that case, enemy screen positions were used to display stuff on screen. But this time around I can't see a way to tell the slots apart (give them numbers like slot 1, slot 2, slot 3 etc. and therefore give them positions, for example:
gui.text(10,10+slotnumber, "stuff that varies per slot")
)
The example script that I saw by Scepheo:
Language: Lua
for i = 0xDF00, 0xDFFF, 16 do
if memory.readbyte(i+0) ~= 0 then
local inv = memory.readbyte(i+10)
local hp = memory.readbyte(i+11)
local x = memory.readbyte(i+13)
local y = memory.readbyte(i+14)
gui.text(x - 16, y - 24, "hp: " .. hp)
gui.text(x - 16, y - 16, "inv: " .. inv)
end
end
I appreciate your help. If there's no solution maybe I'll handle each enemy slot on its own. But that would mean not being able to display stuff properly in order (from top to bottom).