WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   C_Map.GetMapPosFromWorldPos (https://www.wowinterface.com/forums/showthread.php?t=56428)

Gello 07-24-18 08:56 AM

C_Map.GetMapPosFromWorldPos
 
The usage for C_Map.GetMapPosFromWorldPos is:
Usage: local uiMapID, mapPosition = C_Map.GetMapPosFromWorldPos(continentID, worldPosition [, overrideUiMapID])

The in-game /api documentation is:

function C_Map.GetMapPosFromWorldPos(continentID, worldPosition, optional overrideUiMapID)
Arguments:
1. number continentID
2. table worldPosition
3. (optional) number overrideUiMapID
Returns
1. number uiMapID
2. table mapPosition

My question is: what is continentID? Is that the uiMapID of the continent? Some new numbering system? Can it be inferred from a uiMapID?

I'm trying to translate the returns of a UnitPosition (which can be on a different continent than the player is in; these are saved world positions) to map positions, and was hoping to use this.

edit: Actually, it appears the first argument should be the fourth return of UnitPosition. Or at least, they appear to translate to roughly the right numbers.

semlar 07-24-18 12:19 PM

The "continentID" is what I would normally refer to as the instance ID, and it represents the instance that the coordinate plane belongs to (eg. kalimdor, ragefire chasm, etc).

It's the same value that has been historically returned by GetInstanceInfo and UnitPosition.

Something very important to note is that the X and Y axes from world coordinates are rotated 90 degrees from the world map's north/south/east/west, so if you're translating between the two you need to remember that X represents north to south, and Y represents east to west.


All times are GMT -6. The time now is 08:05 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI