WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Getting the "old" mapID / parent of Area (https://www.wowinterface.com/forums/showthread.php?t=58524)

mazer665 01-04-21 04:16 AM

Getting the "old" mapID / parent of Area
 
hi all!

i am currently looking for a way to get the "old" mapID.
for example, i am looking to get the id for Durotar which would be 14
as with patch 8.0.1 the ids as well as the api fuctions changed, the id of durotar will be 1411

but wait,
here is what i got.

C_Map.GetMapInfo will return 1411 (while somewhere in Durotar)
C_MapExplorationInfo.GetExploredAreaIDsAtPosition will return 363 (ValleyofTrials in this example)

if i take a look at the dbc AreaTable,
ID 363 (ValleyofTrials) has a Parent of 6451 (ValleyofTrialsStart)

which in return
ID 6451 has a parent of 14 (Durotar) <- this is the value i am looking for

so my question is, how are the functions related?
for one, 1411 which is returned from GetMapInfo is not a parent of the example area
second, how do i get the parent(s) of an areaid?

i have tried so far:
MapUtil.GetMapParentInfo(currentMapId, Enum.UIMapType.Zone, TOP_MOST) -> will return 1411 aswell

thanks

Ketho 01-04-21 05:25 AM

Quote:

Originally Posted by mazer665 (Post 338183)
ID 363 (ValleyofTrials) has a Parent of 6451 (ValleyofTrialsStart)

which in return
ID 6451 has a parent of 14 (Durotar) <- this is the value i am looking for


So you want to get the parent AreaID for a specific AreaID?
https://wow.tools/dbc/?dbc=areatable...;4]=exact%3A14

I don't think that's possible with the in-game API. There is only C_Map.GetAreaInfo() and C_MapExplorationInfo.GetExploredAreaIDsAtPosition()

Can you elaborate what you are trying to do?

In any case, you can map from UiMapIDs to AreaIDs and vice versa by parsing the CSVs for AreaTable.db2 and UiMapAssignment.db2 and converting it to a table.
Or just only a table that maps from AreaIDs to ParentAreaIDs:
Lua Code:
  1. local AreaTable = {
  2.     -- ID = ParentID
  3.     [6451] = 14, -- "Valley of Trials"
  4.     [6453] = 14, -- "Echo Isles"
  5.     [6529] = 14, -- "Hellscream's Fist"
  6. }
  7.  
  8. local function GetParentAreaID(id)
  9.     return AreaTable[id]
  10. end
See this for reference https://github.com/ketho-wow/UnexploredAreas

Ketho 01-04-21 05:33 AM

Quote:

Originally Posted by mazer665 (Post 338183)
i am currently looking for a way to get the "old" mapID.
for example, i am looking to get the id for Durotar which would be 14
as with patch 8.0.1 the ids as well as the api fuctions changed, the id of durotar will be 1411

There is WorldMapAreaID which was replaced in patch 8.0.1
But the "old" mapID 14 you're referring to here for Durotar is the AreaID

Quote:

Originally Posted by mazer665 (Post 338183)
C_Map.GetMapInfo will return 1411 (while somewhere in Durotar)

That is a UiMapID for Classic, you should probably have mentioned that
https://wow.gamepedia.com/UiMapID/Classic

You'd need to make a table to map between UiMapIDs and (Parent)AreaIDs, depending on what you are trying to do

mazer665 01-04-21 05:55 AM

thanks for the info so far!
sorry, that i forgot to mention that this belongs to the classic version...

as of what i am planning:
a webbased world map with the possibility to draw POIs or pathes etc (also import of those)
but also with the possibility to "record" this points in game as well

so i need a form of conversion

for example i want to place a POI on the website, i get the "real" server coordinates,
if i want to translate them to ingame coordinates i can use the WorldMapArea DBC to get them

basically i want to translate an external vector to the ingame position

EDIT: or as a another example, calculate the position of an NPC to be displayed on the website with only areaID and ingame coordinates as input

i am aware of these functions that might provide some help doing this:
C_Map.GetWorldPosFromMapPos
C_Map.GetMapPosFromWorldPos

Ketho 01-04-21 06:09 AM

So like this but interactively? https://wow.tools/maps/

Yeah, those functions should help you on your way. Try referencing HereBeDragons too

mazer665 01-04-21 06:27 AM

Quote:

Originally Posted by Ketho (Post 338187)
So like this but interactively? https://wow.tools/maps/

Yeah, those functions should help you on your way. Try referencing HereBeDragons too

or like worldofmapcraft (and his amazing writeup https://www.iamcal.com/world-of-mapcraft/), yes!

i'll take a look at HereBeDragons


All times are GMT -6. The time now is 03:29 AM.

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