ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Open map menu at specific map (https://www.esoui.com/forums/showthread.php?t=1452)

Mitsarugi 05/10/14 08:22 AM

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

Aicam 05/10/14 09:59 AM

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.

Mitsarugi 05/10/14 10:34 AM

Quote:

Originally Posted by Aicam (Post 7388)
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 ;)

Garkin 05/10/14 10:54 AM

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

Mitsarugi 05/10/14 06:36 PM

Quote:

Originally Posted by Garkin (Post 7395)
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?

Garkin 05/10/14 07:37 PM

Quote:

Originally Posted by Mitsarugi (Post 7427)
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()

Mitsarugi 05/10/14 08:20 PM

Quote:

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 ^^

Mitsarugi 05/12/14 02:10 PM

Bring Up My Post :)

CrazyDutchGuy 05/12/14 02:51 PM

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.

Mitsarugi 05/12/14 03:15 PM

Yep trying to help you , finding that info ;)

Garkin 05/16/14 06:02 AM

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.


All times are GMT -6. The time now is 12:13 AM.

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