local screenPos1 = Vector2:new(200, 200)
local screenPos2 = Vector2:new(200, 240)
local function OnDraw()
local object = Game.mouseObject
local target = Player.target
if object then
local text = string.format("%s is located at {%f, %f, %f}", object.name, object.pos.x, object.pos.y, object.pos.z)
Draw:text(screenPos1, text, 0xFF0000FF, 20)
else
Draw:text(screenPos1, "No object under mouse", 0xFF0000FF, 20)
end
if target then
local text = string.format("%s is located at {%f, %f, %f}", target.name, target.pos.x, target.pos.y, target.pos.z)
Draw:text(screenPos2, text, 0xFF0000FF, 20)
else
Draw:text(screenPos2, "No target", 0xFF0000FF, 20)
end
end
RegisterEvent(Events.ON_DRAW, OnDraw)
I took a quick look at the Runes of Magic API. Doesn't look like there's a Lua-exposed function for this, unless I'm mistaken. That of course makes it a little bit more difficult if the function is only in the C API.
Since Runes of Magic uses their own game engine, it would end up being very specific to that game as well, so there's not likely to be much available publicly that could hint to where various functions (vtables). I did a quick symbol check and most stuff has been stripped or obfuscated so it wasn't immediately obvious where to begin, either. What I'm saying is, it's doable still, but a pain in the butt.
If there was a specific string or reference we had related to the worldToScreen() function, that would help. Maybe you could find what accesses the camera's position and rotation, then backtrack from there? Even that sounds like a time consuming effort.
I tried that indeed, I will need to look further, I tried implementing my own and it works perfectly except for the left and right rotation so I have it close,
I haven't finished doing all the structures yet but i have the necessary stuff done for now, I also did see they have A* pathfinding built in so I need to play with that a bit