Thread Tools Display Modes
11-21-14, 12:39 PM   #1
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
instanceID =/= mapID

Reading this thread got me thinking: Astrolabe can handle adding icons to instance maps just as well as world and mini maps. However, I am slowly writing my own replacement library.

If I created an API, say lib:AddIcon(mapID, mapFloor, icon) –– going simple here, passing an instance like the Garrison or a dungeon isn't going to work, as instanceIDs and mapIDs are not the same. Is there a suggested method to accomplish this?

Sure, I can look at Astrolabe, and often do, but, and I could be wrong, Astrolabe strikes me as overly complex.
  Reply With Quote
11-21-14, 02:16 PM   #2
Digital_Utopia
A Flamescale Wyrmkin
 
Digital_Utopia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 110
Originally Posted by myrroddin View Post
Reading this thread got me thinking: Astrolabe can handle adding icons to instance maps just as well as world and mini maps. However, I am slowly writing my own replacement library.

If I created an API, say lib:AddIcon(mapID, mapFloor, icon) –– going simple here, passing an instance like the Garrison or a dungeon isn't going to work, as instanceIDs and mapIDs are not the same. Is there a suggested method to accomplish this?

Sure, I can look at Astrolabe, and often do, but, and I could be wrong, Astrolabe strikes me as overly complex.
Well, I'm pretty sure there are methods to get the WorldMapID, and the floor that's currently active on the player's map. You shouldn't need the InstanceID to do that. So I'm not sure what you're asking exactly. :/
__________________
  Reply With Quote
11-21-14, 02:38 PM   #3
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Ah, let me clarify then. Since my intent is writing a library that adds icons or pins to maps, one cannot make the assumption that you log into the game at your Garrison. Once there, I can probably get the mapID, but what if you log into the game in Stormwind? The library should still be able to put a pin on the Garrison even though you aren't there to get the mapID.

So my question really is: how do I get the mapID for instances if aren't there currently? Another example might be putting the mailbox icons into Gnomereggan (sp).
  Reply With Quote
11-21-14, 05:24 PM   #4
Digital_Utopia
A Flamescale Wyrmkin
 
Digital_Utopia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 110
Originally Posted by myrroddin View Post
Ah, let me clarify then. Since my intent is writing a library that adds icons or pins to maps, one cannot make the assumption that you log into the game at your Garrison. Once there, I can probably get the mapID, but what if you log into the game in Stormwind? The library should still be able to put a pin on the Garrison even though you aren't there to get the mapID.

So my question really is: how do I get the mapID for instances if aren't there currently? Another example might be putting the mailbox icons into Gnomereggan (sp).
Well, putting things on the worldmap would be simple enough. Since you can listened to map changed events, you can use that to update the currently visible/active map. Minimap on the other hand would likely tie into the zone changed event, and querying for mapID/floor. However, I can't say I've ever had experience with manually placing a pin on the minimap.

Now, the tricky part - and this is where Astrolabe was the most useful for - was tracking the direction and distance to a pin in another zone/floor. As far as I know - the only Blizzard API that does something similar, is their getsupertrackedquest method; but for everything else - there's not much tying one zone to another. After all, the "coordinates" everybody uses are nothing more than a percentage of the local map. So there's no real good way to determine distance to another zone, as they're not required to be at the same scale. For instance, while on one map - it might take 20 yards to go a tenth of a coordinate, while on another, it might take a single yard.

Now, I haven't explored Astrolabe completely - and admittedly, I'm more than a bit rusty with my API knowledge; but I will say this - I was able to create complete continent maps, made out of the local maps, via the Astrolabe API data. Including scale and position.

For all I know - the sizes and offsets could be hard-coded into the API. But regardless, that's likely where all that extra complexity comes from.
__________________
  Reply With Quote
11-21-14, 05:41 PM   #5
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Don't make another library for this, if there's something wrong with astrolabe it will be fixed.

What exactly is wrong with astrolabe?
  Reply With Quote
11-21-14, 09:20 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by myrroddin View Post
So my question really is: how do I get the mapID for instances if aren't there currently? Another example might be putting the mailbox icons into Gnomereggan (sp).
I'm not really sure what the purpose of this question is... if you have an addon that wants to add mailbox icons in Gnomeregan, you'd just have the mapID hardcoded in the addon along with the coordinates for the mailboxes.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » instanceID =/= mapID

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