01/25/15, 12:37 AM | #1 |
|
Maps & Pins
I have a couple of questions about Maps, MapPins, & POI's. Maybe someone can save me some time trying to figure all of this out.
Thanks in advance for any info you can offer. Question 1: I'm trying to write something with maps, POIs, & locations, but having trouble understanding the map Hierarchy.I see all kinds of different references to maps, MapParents, zones, subzones, Index, ZoneIndex, MapIndex, ListIndex, exc...How do all of these fit together? I'm looking for a sort of more concrete relationship between them. Like obviously SubZones are always INSIDE zones..but where does a ParentMap or just plain Map fit in? I'm trying to figure out how to know when/where to use each of the different functions. Lua Code:
Question 2: For those Indices listed above: ZoneIndex, MapIndex, Index, ListIndex, exc.. (for ANY that contain the same maps) Is there a table/function to convert one type/value to another? Like from ZoneIndex to Index? Like for example I know the index for Stonefalls is: WORLD_MAP_LOCATIONS.list.data[22].index = 11 but the ZoneIndex of Stonefalls is 9 Anyway to grab one from the other like: GetIndexFromZoneIndex(integer zoneIndex) -- Returns: integer Index Question 3: Best way to gather info from POI's & Map PIns I'm trying to gather information about POIs & locations. I did this using Lua Code:
Is there anyway to GET a map pin from a POI Index, besides looping through the ZO_WorldMapContainer 's children? How about getting all of the map pins at once, for the current map, so I can loop through them & gather info? Question 4: MapPinXX.m_Pin:GetPOIIndex() Does this not always work or am I doing something wrong? As an example, when I test it on the "Sulfur Pools Wayshrine" in Stonefalls Lua Code:
Question 5: Setting a Waypoint Is there a way to set a waypoint on a different map? I could only find this method for setting a waypoint, but it only works for the map/area that your in: Lua Code:
I tried changing the current map with one of the above functions & then calling PingMap, but that didn't seem to work. EDIT 1: Question 4, progress I figured most of this one out. I tried switching maps, but I didn't normalize it to the ZO_WorldMapContainer, I had thought all of those returned normalizedX/Y values were already normalized to that particular map. This seems to work...if I had the map pin. Lua Code:
But it brought up another question when trying to figure this out. Whats the difference between these localized coordinates, their all different (even when viewing the same map). POIMapInfo doesn't seem to change based on the ZO_WorldMapContainer zoom level, but the others do. POIMapInfo seems to be based on the players location? NormX & NormY are obviously relative to the ZO_WorldMapContainer, and is effected by zoom. What about the normx & normy values stored in the map pin though, what are they normalized to? Both PinNormX/PinNormY & NormX/NormY seem to work when setting a waypoint, even though they are different values. Last edited by circonian : 01/25/15 at 03:19 AM. |
01/25/15, 03:06 AM | #2 |
1) The map hierachy looks something like this:
Level 1: Oblivion (GetMapType() == MAPTYPE_COSMIC)Level 2: Tamriel (GetMapType() == MAPTYPE_WORLD)Level 3: regular zones like Alik'r, Cyrodiil, Coldharbour and - believe it or not - Eyevea (GetMapType() == MAPTYPE_ZONE)Level 4: cities like Wayrest or the gates in Cyrodiil (GetMapType() == MAPTYPE_SUBZONE) and dungeons (GetMapType() == MAPTYPE_ZONE and GetMapContentType() == MAP_CONTENT_DUNGEON)I have not seen a dungeon inside a subzone yet, but it might be possible. 2) No, afaik they are unrelated and you cannot convert them. 3) and 4) No idea. I haven't done anything with POIs yet, so maybe someone else can answer this. 5) Yes. Waypoints are automatically converted between maps, so when you set it on the Tamriel map, it will be available on every other map on the levels below it. You should take a look at my libGPS. The code contains a lot of interesting things. It has currently disappeared into the outdated section, but it is still fully functional and I will update it as soon as update 6 goes live. |
|
01/25/15, 03:22 AM | #3 | ||
|
|
||
01/25/15, 09:08 AM | #4 | ||||||||||
This is something with I have struggled for a long time and I still don't have all answers.
Map index is used for zone maps listed on the WorldMap, Locations tab. Zone index is unique identifier of each map. If you are working with WorldMap, like opening map by index, you have to use map index: ZO_WorldMap_SetMapByIndex(mapIndex) SetMapToMapListIndex(luaindex index) GetCurrentMapIndex() GetNumMaps() If you are working with quests or points of interest (POIs), functions retruns zone index: GetCurrentMapZoneIndex() This function is a bit special, because it uses location index. I have never used this index, because it wasn't working as I expected. But I believe that this index is an index of zubzone locations on the current map: ZO_MapLocationTooltip:SetMapLocation(locationIndex) GetMapParentCategories(luaindex index)
Warning: Spoiler
From the WorldMap.lua in beta version (here it's a line 15):
Lua Code:
GetCurrentSubZonePOIIndices()
GetCadwellZoneInfo(PlayerDifficultyLevel difficultyLevel, luaindex zoneIndex)
Lua Code:
Even if you can change map by index and then set a waypoint, I think there is no reason to do so. I believe that when you change maps, waypoint is automatically cleared.
Lua Code:
|
|||||||||||
01/25/15, 04:40 PM | #5 | ||
|
EDIT: oops I cut off 2 lines of code on accident when I made the pciture, fixed it
EDIT: I should have specified that I only noticed this on wayshrines, I tested all of them in a couple different zones, but other pins seem to work. Heres what I did to make sure I was using the right pin: I got the number of POIs, looped through them (code below) & printed out their names & normalized coordinates. Then I went through the pin manager or in the picture I did "/zgoo mouse" over the wayshrine pin (both places same pin name with the same information though, i did check). And if its easier to read the code this way here it is (this is same code as in picture below): Lua Code:
You can see looping through the POIs spits out that the Senie Wayshrine is POI #40 Doin /zgoo mouse over the pin & /zgoo'n the pinManger.m_Active both say IsFastTravelWayshrine() == true, but it gives no POIIcon, POIIndex, ZoneIndex, and IsPOI() = nil. I even thought of checking the normalized coordinates from GetPOIInfo(..) to the pinManager, to make sure it is the same pin. Their in exactly the same set of coordinates, they match. I also thought well maybe theres another "hidden" pin (for I don't know what reason) under the one I /zgoo'd, in exactly the same coordinates. So I looped through the pinManager & checked to see if any pins had identical normalizedX coordinates, but didn't find any duplicates. So...It has to be the right pin? The only other thing I can think of is that: Lua Code:
But even if comparing those coordinates was wrong I still "/zgoo mouse"' over the pin & I can't find ANY POI's that say IsFastTravelWayShrine() == true and gives any of this information: POIIcon, POIIndex, ZoneIndex, and IsPOI(). Actually looping through the pinManager.m_Active and checking all of the :GetPOIIndex() 's doesn't find any of the POI's that my code (above) spits out for any of the wayshrines. Last edited by circonian : 01/25/15 at 05:53 PM. |
||
01/25/15, 08:50 PM | #6 |
|
Eureka !! I couldn't give up until I figured it out.
With more digging...for anyone interested. I've decided its a bug. What do you think...did I miss something? Heres why: This is NOT the waypoint POI mapPin, there isn't one...not on the character I was testing with anyhow. Apparently its just a ZO_WorldMapPin in the same spot that looks like its the mapPin for the POI waypoint Lua Code:
I didn't catch this earlier, the wiki does not have this 5th parameter listed: isShownInCurrentMap Lua Code:
it looks like that mapPin I thought was the POI is actually a ZO_WorldMapPin & it gets created here. Although the bugs in the next piece of code.
Warning: Spoiler
Lua Code:
Wayshrine POI mapPins get created here....but its only created if its been seen & not completed !!!! Lua Code:
So all of the mapPins for wayshrine POI's ONLY get created IF its been seen, but not completed. Ok, you might argue that its intentional. That once completed its no longer a Point Of Interest so we don't need a mapPin for it anymore. But if thats so, then it should no longer be counted in: Lua Code:
Lua Code:
You could say, maybe they just didn't want to show wayshrine POI mapPins after they've been completed. But that doesn't seem to make sense to me because every other POI still has a mapPin after its been completed. Either way I figured out why it was doing what it was doing...I'm happy Last edited by circonian : 01/25/15 at 09:33 PM. |
01/25/15, 09:22 PM | #7 | |
|
Here you can see where they get the "normalizedZ " from GetPOIMapInfo and the pass it to createPin(..) Lua Code:
g_mapPinManager is defined here Lua Code:
So its getting passed to the following as the yLoc parameter Lua Code:
and finally gets set as the mapPins normalizedY value here: Lua Code:
But I don't know why they would name it Z instead of Y. Maybe its also used somewhere else for something different and they named it for that. |
|
01/29/15, 08:53 AM | #8 |
It depends on what you actually want to do with map and pins, there are all sorts of different pins and different ways to obtain their data. Some even require event processing to get the data. So, it would be easier if you could just tell what you want to do with all of this.
|
|
01/29/15, 10:35 PM | #9 | |
|
I started out trying to find a way to gather basic information (name/coordinates) about POIs using the GetPOIxxx() functions. Then I realized I wanted to be able to gather information about custom places that other addons had added with their own custom mapPins. So I thought it would be better to stop using the GetPOIxxx() functions and just search the mapPins since they return if the mapPin is a POI & can return its POIIndex. My whole confusion was just that I "assumed" every POI had a mapPin in the pinManagers m_active table that would return ZO_MapPin:IsPOI() = true and its ZO_MapPin:GetPOIIndex(). When I tried searching the pinManagers m_active table to find a specific POIIndex (that identified a wayshrine) there weren't any. Most of this post was just me trying to figure out if I was doing something wrong or if I was just missunderstanding how all of this works because I couldn't find a pin that corresponded to any wayshrine POI Indices. But I figured out that there are two mapPins for the wayShrines. The one that returns IsPOI() = true and the GetPOIIndex() = poiIndex, is only created if the wayshrine has been seen & not completed. Once its completed it is no longer shows up in the pinManager.m_active table, but there is another mapPin in its place that returns IsPOI() = false, does not return a POIIndex, but returns IsFastTravelWayShrine() = true. Since both of those mapPins have the exact same coordinates & return the same string identifying the location I thought I was doing something wrong & was just trying to figure out what. I just did not realize they were two different mapPins for wayshrines and that there is not one in the pinManagers m_active table that will return the information I want: IsPOI() = true & GetPOIIndex(), for wayshrines after they have been completed. |
|
02/02/15, 03:50 AM | #10 |
Wayshrine list can include dungeons that have "recall to" locations. POIs and Wayshrines may also be undiscovered and on the worldmap will only appear (as unvisited) if you are close enough. Another thing to remember about looking at worldmap pin data is that it updates after you open the map. And if you select a different region (map) while exploring worldmap - pins will also change in accordance to viewed zone. If map is closed while viewing a different zone, pin data may still hold that zone.
|
|
ESOUI » Developer Discussions » General Authoring Discussion » Maps & Pins |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|