Avatar was the first game chosen for me to try and understand Lua scripting and Hex editing to figure out memory address values. Although I do not have much interest in TASing this game anymore, I do want to share my values and lua script.
Make sure when searching that you are looking in EWRAM for memory domain.
006F4C 0 0 EWRAM Camera PosX
006F50 0 0 EWRAM Camera PosY
0032C8 0 0 EWRAM Screen Pos X
0032CC 0 0 EWRAM Screen Pos Y
0032BC 0 0 EWRAM Screen PosY Offset
0032B8 0 0 EWRAM Screen PosX Offset
003144 0 0 EWRAM Sokka Selected
00318C 0 0 EWRAM Aang Selected
003154 0 0 EWRAM Sokka's Energy
003150 0 0 EWRAM Sokka Stance
018700 0 0 EWRAM Possible EnemyID
018704 0 0 EWRAM Enemy Type (22 is sword guys, 47 is archer)
018778 0 0 EWRAM Enemy Stance (1 is standing still, 513 when chasing you, 10** when attacking)
0187C8 0 0 EWRAM Enemy Counter (resets to 0 when animations happen)
018710 0 0 EWRAM Enemy PosY
01870C 0 0 EWRAM Enemy PosX
01C134 0 0 EWRAM First Archer Enemy
0177CC 0 0 EWRAM Aang Map X Coords
0177D0 0 0 EWRAM Aang Map Y Coords
01790C 0 0 EWRAM Sokka Map X Coords
017910 0 0 EWRAM Sokka Map Y Coords
0187A4 0 0 EWRAM X offset between enemy and player?
0187A6 0 0 EWRAM Y offset between enemy and player?
Most of these values are 4Byte Signed, but occasionally some are 2Byte. Dunno if that really matters or not..
Camera Position -> moves only until end of backgrounds
On-Screen Pos + Offset -> moves all over screen, when camera is moving player stays in center
Saka Stance -> only two stances, 1 = attacking, 255 not attacking
EnemyID:
This one is kind of tricky, but there are two 2Byte values next to each other (and right before EnemyType).
All their position and offset between player and enemy, as well as their counter and stance are located in these chunks.
For the first like 5 swordsmen it should be 0001 0000, 0001 0001, 0001 0002, etc.
If I were to continue my lua script, I would try to figure out a way to just set the enemyID's and Types and ahve the lua script do the rest of the work to figure out stance, counters, position, because swordsmen and archers addresses are located the same distance from their enemyIDs.
Map coords:
These are a pain bacause it's different for each screen to get the position of enemies and sokka and aang. I was trying to find other values that would work but no dice.
local ScreenPosX = 0x32C8;
local ScreenPosY = 0x32CC;
local XOffset = 0x32B8;
local YOffset = 0x32BC;
local Saka = 0x3144;
while true do
memory.usememorydomain("EWRAM");
PosX=memory.read_s32_le(ScreenPosX)-memory.read_s32_le(XOffset);
PosY=memory.read_s32_le(ScreenPosY)-memory.read_s32_le(YOffset);
gui.drawText(5,200, "Pos X:" .. PosX);
gui.drawText(5,220, "Pos Y:" .. PosY);
if memory.read_s32_le(Saka) == 1 then
if memory.read_u8(0x3150) == 255 then
gui.drawEllipse(PosX-32, PosY-30, 67, 58, "Red");
else
end
else
end
emu.frameadvance();
end