WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   instanceID =/= mapID (https://www.wowinterface.com/forums/showthread.php?t=50541)

myrroddin 11-21-14 12:39 PM

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.

Digital_Utopia 11-21-14 02:16 PM

Quote:

Originally Posted by myrroddin (Post 300852)
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. :/

myrroddin 11-21-14 02:38 PM

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).

Digital_Utopia 11-21-14 05:24 PM

Quote:

Originally Posted by myrroddin (Post 300858)
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.

semlar 11-21-14 05:41 PM

Don't make another library for this, if there's something wrong with astrolabe it will be fixed.

What exactly is wrong with astrolabe?

Phanx 11-21-14 09:20 PM

Quote:

Originally Posted by myrroddin (Post 300858)
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.


All times are GMT -6. The time now is 04:02 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI