Coordinates for BfA
Hey!
I know it's very early but do you guys know a coordinate addon for BfA-Alpha yet that actually works? I tried some like MapCoords, Coordinates, DCoords, but none of them works. |
They changed how coordinates are gotten. We're still figuring this out. ;)
|
The usual API functions (GetMapZones(), GetPlayerMapPosition(), GetCurrentMapAreaID(), etc) are missing and causing no end of headache.
|
In game type
Code:
/api mapui or extract the code files and look in \Addons\Blizzard_APIDocumentation\MapDocumentation.lua |
That helps with some things but functions like GetPlayerMapPosition() aren't defined there (doesn't exist in BfA and doesn't show in the extraction from live)
|
At the moment the key piece that is missing for me is the implementation of GetPlayerMapPosition. And using UnitPosition gives me values that are not percentage ranges within the map, but seem to be absolute points on the map. If only we could get the map dimensions we could probably simulate GetPlayerMapPosition well.
On a side note, it looks like C_Map.GetBestMapForUnit('player') is not ready early on in startup because nil is being returned. |
The entire Map API in general is still in development. Its one area that has seen an entire redesign in BfA and its not quite done yet. Give any map-related questions a bit more time to be figured out!
Do however note that any addons that accessed map or location information will need changes, and sometimes maybe even re-think their design as things change drastically. So be prepared for that. Information we currently do have: - Continent/Zone index numbers are gone without replacement (ie. what GetCurrentMapContinent/GetCurrentMapZone used to return) - The map filename is also gone (map files use the numeric texture IDs now, not useful as identification anylonger) - MapAreaId/Floor are gone, replaced by UiMapId (every map you see has its own unique id, no longer dealing with floors etc) - All maps are hierarchical, which means they have a parent and any number of children. A continent has zones, a zone has dungeons and microdungeons, a dungeon has floors, and so on, and you can query this hierarchy to find dungeon floors etc. - No stateful API anymore (ie. the map currently being shown by the map is tracked in Lua only, not by any hidden magic in C code) (this is still a work in progress) - A translation from MapAreaId/Floor => UiMapId is not available in-game, however we've been given this data to do the translation manually, or include them in an addon Whats still missing so far: - Player position in zone coordinates (ie. what GetPlayerMapPosition was) - Zone size and position data (what GetAreaMapInfo used to return) I've been talking to Dan (Blizzard UI developer who hangs around IRC), and he has assured me that he will look into exporting Zone size data again. If this does not happen for some reason, the alternative is to extract that data from the games database files and dump it into a library. Whichever method is required, I'll definitely be updating my HereBeDragons map library to provide the same amount of information it offers now (I use the term "update" losely, due to the drastic changes it'll probably be a rewrite and calling it "2.0"). But, all in good time once I know which course to even take based on which API we're getting, and which we're not. |
Quote:
Lua Code:
|
Indeed, thats the data I was referring to. :)
|
Here's a Macro -
/script px, py = C_Map.GetPlayerMapPosition(C_Map.GetBestMapForUnit("player"), "player"):GetXY() /script DEFAULT_CHAT_FRAME:AddMessage(format ("[ %s ] %.2f , %.2f",GetZoneText(),px*100,py*100)); |
Quote:
Working fluently. |
Well this is stupid simple and I didn't really test it, but I half way copy pasted the code I'm currently using for my minimap coordinates on the BfA beta.
Didn't want to necro any threads, just thought it might be nice for people to have as a reference or something to play around with while trying to make sense of the beta API changes. :) Just remember I drycoded it in 2 minutes. Here there might be bugs! And dragons! Lua Code:
|
All times are GMT -6. The time now is 03:21 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI