Thread Tools Display Modes
05/10/14, 08:22 AM   #1
Mitsarugi
 
Mitsarugi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 23
Open map menu at specific map

So i found a command for achievements which opens the achievement menu:

lua Code:
  1. SCENE_MANAGER:Show("achievements")

and i was wondering if the same command exists for the map, maybe something like:

lua Code:
  1. SCENE_MANAGER:Show("map", <MapId> or <MapName> or <MapTexture>) --?

Quests have the option "Show on Map" i'd like to have the function for this if possible
  Reply With Quote
05/10/14, 09:59 AM   #2
Aicam
Join Date: Apr 2014
Posts: 16
As a function of the SCENE_MANAGER it is not possible to select a map. You might want to try to find some functions with ZO_WorldMap in their name.
  Reply With Quote
05/10/14, 10:34 AM   #3
Mitsarugi
 
Mitsarugi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 23
Originally Posted by Aicam View Post
As a function of the SCENE_MANAGER it is not possible to select a map. You might want to try to find some functions with ZO_WorldMap in their name.
Thanks i'll have a look at it
  Reply With Quote
05/10/14, 10:54 AM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
lua Code:
  1. SCENE_MANAGER:Show("worldMap")
  2. ZO_WorldMap_SetMapByIndex(mapIndex)
Where mapIndex is:
  1. Tamriel
  2. Glenumbra
  3. Rivenspire
  4. Stormhaven
  5. Alik'r Desert
  6. Bangkorai
  7. Grahtwood
  8. Malabal Tor
  9. Shadowfen
  10. Deshaan
  11. Stonefalls
  12. The Rift
  13. Eastmarch
  14. Cyrodiil
  15. Auridon
  16. Greenshade
  17. Reaper's March
  18. Bal Foyen
  19. Stros M'Kai
  20. Betnikh
  21. Khenarthi's Roost
  22. Bleakrock Isle
  23. Coldharbour
  24. Oblivion

Last edited by Garkin : 05/10/14 at 10:57 AM.
  Reply With Quote
05/10/14, 06:36 PM   #5
Mitsarugi
 
Mitsarugi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 23
Originally Posted by Garkin View Post
lua Code:
  1. SCENE_MANAGER:Show("worldMap")
  2. ZO_WorldMap_SetMapByIndex(mapIndex)
Where mapIndex is:
  1. Tamriel
  2. Glenumbra
  3. Rivenspire
  4. Stormhaven
  5. Alik'r Desert
  6. Bangkorai
  7. Grahtwood
  8. Malabal Tor
  9. Shadowfen
  10. Deshaan
  11. Stonefalls
  12. The Rift
  13. Eastmarch
  14. Cyrodiil
  15. Auridon
  16. Greenshade
  17. Reaper's March
  18. Bal Foyen
  19. Stros M'Kai
  20. Betnikh
  21. Khenarthi's Roost
  22. Bleakrock Isle
  23. Coldharbour
  24. Oblivion
Nice thanks, any idea how to set it to specific coordinates? like the "Show on map" feature does for quests?

Last edited by Mitsarugi : 05/10/14 at 06:43 PM.
  Reply With Quote
05/10/14, 07:37 PM   #6
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Mitsarugi View Post
Nice thanks, any idea how to set it to specific coordinates? like the "Show on map" feature does for quests?
Functions for quests (not usable in this case):
Lua Code:
  1. SetMapToQuestCondition(questIndex, stepIndex, conditionIndex)
  2. SetMapToQuestZone(questIndex)

We have to work with ZO_MapPanAndZoom, but I did not try it yet.

What is worth of trying:
Lua Code:
  1. g_mapPanAndZoom:PanToPin(pin)
  2. g_mapPanAndZoom:JumpToPin(pin)
  3. g_mapPanAndZoom:JumpToPinWhenAvailable(findPinFunction)
  4.  
  5.  
  6. --slightly modified version of ZO_MapPanAndZoom:GetPinFocusZoomAndOffset(pin) function
  7. --locX and locY are numbers between 0 and 1, same as used for creating map pins.
  8. local function GetOffset(locX, locY)
  9.    local minCoordNX = locX < 0.5 and locX or (1 - locX)
  10.    local minCoordNY = locY < 0.5 and locY or (1 - locY)
  11.    local minCoordN = zo_min(minCoordNX, minCoordNY)
  12.    local targetZoom = g_mapPanAndZoom.maxZoom
  13.    local zoomedNX = locX * targetZoom
  14.    local zoomedNY = locY * targetZoom
  15.    local borderSizeN = (targetZoom - 1) / 2
  16.    local offsetNX = 0.5 + borderSizeN - zoomedNX
  17.    local offsetNY = 0.5 + borderSizeN - zoomedNY
  18.    offsetNX = zo_clamp(offsetNX, -borderSizeN, borderSizeN)
  19.    offsetNY = zo_clamp(offsetNY, -borderSizeN, borderSizeN)
  20.    local offsetX = offsetNX * ZO_WorldMapScroll:GetWidth()
  21.    local offsetY = offsetNY * ZO_WorldMapScroll:GetHeight()
  22.  
  23.    return offsetX, offsetY
  24. end
  25.  
  26. local offseX, offsetY = GetOffset(locX, locY)
  27. local tagetZoom = g_mapPanAndZoom.maxZoom --minZoom, maxZoom, by default number between 1 and 5.
  28.  
  29. --jump to target
  30. g_mapPanAndZoom:SetCurrentOffset(offsetX, offsetY)
  31. g_mapPanAndZoom:SetCurrentZoom(targetZoom)
  32.  
  33. --pan to target
  34. g_mapPanAndZoom:SetTargetOffset(offsetX, offsetY)
  35. g_mapPanAndZoom:SetTargetZoom(targetZoom)
  36. g_mapPanAndZoom:SetFinalTargetOffset(offsetX, offsetY, targetZoom)
  37.  
  38. --custom zoom:
  39. g_mapPanAndZoom:SetCustomZoomMinMax(minZoom, maxZoom)
  40. g_mapPanAndZoom:ClearCustomZoomMinMax()
  41. g_mapPanAndZoom:GetCurrentZoom()
  Reply With Quote
05/10/14, 08:20 PM   #7
Mitsarugi
 
Mitsarugi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 23
Originally Posted by Garkin
...
Ok so i've played around with the code from your 1st reply with
Lua Code:
  1. /script SCENE_MANAGER:Show("worldMap") ZO_WorldMap_SetMapByIndex(mapIndex)
  2.  
  3. GetCurrentMapIndex()
  4. --Returns: luaindex:nilable index
  5.  
  6. GetCurrentMapZoneIndex()
  7. --Returns: luaindex zoneIndex

and i got it to work but i cant do the same for dungeons (Zones) :/ any idea?
There seems to be no ZO_WorldMap_SetMapZoneByIndex()

As for the second part i'll try that tomorrow as i'm really really tired right now ^^

Last edited by Mitsarugi : 05/10/14 at 08:27 PM.
  Reply With Quote
05/12/14, 02:10 PM   #8
Mitsarugi
 
Mitsarugi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 23
Bring Up My Post
  Reply With Quote
05/12/14, 02:51 PM   #9
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
I think you are looking for the same thing i am, and i did not found a way to make the dungeon maps appear. The dungeon maps kinda revolve around the currentPlayerPosition

I am not sure if you can manipulate the zone where the player is in, and then call the map.
  Reply With Quote
05/12/14, 03:15 PM   #10
Mitsarugi
 
Mitsarugi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 23
Yep trying to help you , finding that info
  Reply With Quote
05/16/14, 06:02 AM   #11
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
I have found a way how to open town map.

Example with Daggerfall:
Lua Code:
  1. SCENE_MANAGER:Show("worldMap")                      --open WorldMap
  2. ZO_WorldMap_SetMapByIndex(2)                        --2 = Glenumbra
  3. ProcessMapClick(0.2868,0.7441)                      --town coordinates
  4. CALLBACK_MANAGER:FireCallbacks("OnWorldMapChanged") --refresh map
Coordinates are for any point inside of the subzone area on the zone map. In this example I have used coordinates from tooltip on Esohead maps. BTW anyone knows how to open Esohead map at the selected point? I believe that numbers after # are mapCode, zoom, locX, locY. But zoom does not work for me .

Also there is a function that can tell you if there is any subzone at the selected coordinates:
Lua Code:
  1. local locationName, textureFile, widthN, heightN, locXN, locYN = GetMapMouseoverInfo(normalizedMouseX, normalizedMouseY)
If location name is empty string, there is no subzone.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Open map menu at specific map

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