Even better
Get the player address right away
https://github.com/Solybum/PSOBBMod-Addons/blob/master/solylib/characters.lua#L4
And use the position offsets that you probably already know.
https://github.com/Solybum/PSOBBMod-Addons/blob/master/Monster Reader/init.lua#L134
I never added position to the player reader, only to the monster reader which I later removed (iirc) but the offsets are still there.
I gave that a try, but I don't think I used it correctly ? I did something like..
Code:
local _PlayerIndex = 0x00A9C4F4
local playerIndex = pso.read_u32(_PlayerIndex)
local playerAddr = lib_characters.GetPlayer(playerIndex)
and it returned the coordinates of something else, I *think* it may have been an NPC lol, I'm not sure.
I ended up doing this which worked for what I was doing :
Code:
local _PlayerArray = 0x00A94254
local _PlayerIndex = 0x00A9C4F4
local playerIndex = pso.read_u32(_PlayerIndex)
local playerAddr = pso.read_u32(_PlayerArray + 4 * playerIndex)
Huge thanks goes to you and staphen though, 'cause I don't think I would've found the player index on my own Dx
One more question : I've made skywalker and coordinate codes before back when I made PSP cheats and I always noticed that the coordinates go :
0xXXXXXX38 X : east/west
0xXXXXXX3C Y : up/down
0xXXXXXX40 Z : north/south
It's the same for this game too (and every other I assume lol). But anyway, I displayed the coordinates with Z being up/down instead of Y, because normally when I've worked with coordinates on other things, X and Y would be north, east, south, and west. Would how I'm displaying the coordinates on screen be correct ?
0xXXXXXX38 X : east/west
0xXXXXXX40 Z --> Y : north/south
0xXXXXXX3C Y --> Z : up/down
I've always thought of Z as being like z-index in CSS, so maybe that's why I think of it like that lol.
I'll probably add getting "my index" to that library since I will need it for the player reader and a GetPosition function too.
Oh that'll be useful ! I haven't look over your library entirely yet, but now I wanna take a closer look to see what I can make with it.
Hey, I've tried your addon out but I get some weird readings:
Also show 0 meseta in lobby/P2. Do you have an idea why ?
Ah it had the same issue as the coordinates ! It was displaying the value of the first person in the lobby/room. I've updated both the addons with the player index, so they should show the correct information now. Hopefully ! xD