Modcraft - The community dedicated to quality WoW modding!
Projects => Software Development => Topic started by: dm666 on March 06, 2016, 09:36:52 am
-
Hi all. How to i can get coords with cursor?
For example:
I move cursor to Goldshire and want to get server coords.
Help with algorithm pls. What i must load, rendering etc?
Sry for my bad english.
-
There is no API to do that ingame. You will need to read the data from WorldMap*.dbc and make them available in lua. Then, determine which map you are on (not sure if there is an API for that or if you'll have Tomas that yourself as well), and determine the coordinates by simple maths (position of cursor in percentage mapped to the rect spanned by the DB. Convert the position from map to server coordinates.
-
Thanks for ur answer.
I want to choose location and get coords of the cursor position. Then convert their to server coords(yet it's not necessary).
I want to do something like this
statusbarInfo << "tile: " << std::floor(gWorld->camera.x / TILESIZE) << " " << std::floor(gWorld->camera.z / TILESIZE)
<< "; coordinates: client (x: " << gWorld->camera.x << ", y: " << gWorld->camera.z << ", z: " << gWorld->camera.y
<< "), server (x: " << (ZEROPOINT - gWorld->camera.z) << ", y:" << (ZEROPOINT - gWorld->camera.x) << ", z:" << (gWorld->camera.y) << ")";
But how i can get camera x, y, z? I must load adt file? Or dbc file?
-
You will need to read the data from WorldMap*.dbc
-
WorldMapArea.dbc sets coords of borders of maps. Check DBCs documentation for more info. Combination of these coords and coords of mouse cursor should be good enough for getting coords of place, where mouse hovers over.