Thread Tools Display Modes
Unread 07-05-12, 05:54 AM   #1
SinusPi
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 10
Microdungeons and mapping problems

So, we got shiny new cave maps, dubbed "micro dungeons". (For the unaware: all larger caves now have maps of their own, some are even multi-floor to make navigation easier.)
And we have a ton of new problems now.

Before, we could just
Code:
local map_id,floor = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel()
local x,y = GetPlayerMapPosition(unit)
... and hopefully (if the player's not browsing their maps) we would get a perfectly universal quad of world coordinates.

Now, in caves, map_id won't change (!), but floor, x and y will. The only way to check this seems to be
Code:
local texture,w,h,isCave,caveName = GetMapInfo()
- but, of course, this doesn't help much to alleviate the havoc in Astrolabe and similar coordinate-calculating addons.

So, question: are there any functions now that return the shift-and-size values allowing one to translate in-cave coords to zone coords, or are we doomed to scouting them out manually?

Last edited by SinusPi : 07-05-12 at 06:08 AM.
SinusPi is offline  
Unread 07-05-12, 06:34 AM   #2
Kagaro
A Cyclonian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 45
thos emini dungeons are called senarios correct?

You maybe to use my beta libmapdata to convert and translate as the senario 'cavename' could be used to lookup the info and translate it.
Kagaro is offline  
Unread 07-05-12, 07:14 AM   #3
Voyager
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 13
Originally Posted by Kagaro View Post
thos emini dungeons are called senarios correct?

You maybe to use my beta libmapdata to convert and translate as the senario 'cavename' could be used to lookup the info and translate it.
Scenarios have their own mapID. The only maps I found that are classified as microDungeon are the 2 faction shrines.

I just rewrote the GetMapInfo function to get around it.

Code:
local function GetMapInfo(...)
    local mapName, textureWidth, textureHeight, isMicroDungeon, microDungeonName = GetMapInfo(...)
    if isMicroDungeon and microDungeonName then
        return microDungeonName, textureWidth, textureHeight, isMicroDungeon, microDungeonName
    end
    return mapName, textureWidth, textureHeight, isMicroDungeon
end
Voyager is offline  
Unread 07-05-12, 09:23 AM   #4
SinusPi
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 10
Here you can see a whole slew of formerly confusing caves, now nicely mapped mini-zones. With no MapID of their own.

However, I see that GetCurrentMapDungeonLevel() returns (hopefully) properly translated coordinates, even though the main map has no GetNumDungeonMapLevels() to speak of. So maybe there's salvation...
SinusPi is offline  
Unread 07-05-12, 10:30 AM   #5
Voyager
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 13
Originally Posted by SinusPi View Post
Here you can see a whole slew of formerly confusing caves, now nicely mapped mini-zones. With no MapID of their own.

However, I see that GetCurrentMapDungeonLevel() returns (hopefully) properly translated coordinates, even though the main map has no GetNumDungeonMapLevels() to speak of. So maybe there's salvation...
That's quite alot of them! O_O
I did a quick check on the Venture Co Mine in Mulgore and found some odd results.
GetNumDungeonMapLevels() returns 1, 7
GetCurrentMapDungeonLevel() returns 7, -1559, -1930, -818, -1436
I'm confused why it's considered level 7 when there's only 1 floor in it.

Anyway, your position is still visible on the Mulgore map even while inside the dungeon, so it should be possible to just ignore the microdungeon coordinates and zoom out to the parent zone with SetMapByID(GetCurrentMapAreaID()) and get the coordinates from there, no translation needed that way.
Voyager is offline  
Unread 07-05-12, 03:41 PM   #6
SinusPi
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 10
Originally Posted by Voyager View Post
zoom out to the parent zone with SetMapByID(GetCurrentMapAreaID()) and get the coordinates from there, no translation needed that way.
That only solves the "how to get player coordinates" problem. Namely,
Code:
local mapName, textureWidth, textureHeight, isMicroDungeon, microDungeonName = GetMapInfo()
if isMicroDungeon then
  SetMapByID(GetCurrentMapAreaID())
end
local x,y = GetPlayerMapPosition("player")
But, if I try to put a map marker, using any addon designed for that, on the micro map... BOOM. :P

Map-revealing addons break like hell, too ;P Oh joy :>
SinusPi is offline  
Unread 07-13-12, 08:31 AM   #7
SinusPi
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 10
Originally Posted by Voyager View Post
I did a quick check on the Venture Co Mine in Mulgore and found some odd results.
GetNumDungeonMapLevels() returns 1, 7
GetCurrentMapDungeonLevel() returns 7, -1559, -1930, -818, -1436
I'm confused why it's considered level 7 when there's only 1 floor in it.
That's the new way of saying, "the current cave is ONE level deep, but starts at level SEVEN in the list of floor numbers". If you enter another cave in the same zone, it might return like 2,9 - thus occupying numbers 9 and 10 in the list.
SinusPi is offline  
 

Go BackWoWInterface » WoD Beta » MoP archived threads » Microdungeons and mapping problems

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