Thread Tools Display Modes
01-04-21, 04:16 AM   #1
mazer665
A Defias Bandit
Join Date: Jan 2021
Posts: 3
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
  Reply With Quote
01-04-21, 05:25 AM   #2
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by mazer665 View Post
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
  Reply With Quote
01-04-21, 05:33 AM   #3
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by mazer665 View Post
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

Originally Posted by mazer665 View Post
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

Last edited by Ketho : 01-04-21 at 05:41 AM.
  Reply With Quote
01-04-21, 05:55 AM   #4
mazer665
A Defias Bandit
Join Date: Jan 2021
Posts: 3
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

Last edited by mazer665 : 01-04-21 at 06:02 AM.
  Reply With Quote
01-04-21, 06:09 AM   #5
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
So like this but interactively? https://wow.tools/maps/

Yeah, those functions should help you on your way. Try referencing HereBeDragons too
  Reply With Quote
01-04-21, 06:27 AM   #6
mazer665
A Defias Bandit
Join Date: Jan 2021
Posts: 3
Originally Posted by Ketho View Post
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
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Getting the "old" mapID / parent of Area

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off