ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Dragonstar map name? (https://www.esoui.com/forums/showthread.php?t=4237)

SnowmanDK 01/27/15 07:02 AM

Dragonstar map name?
 
I am trying to find a way to detect that I zoomed into the Dragonstar map.
It should be a global name that works across client languages.

I tried "string.match(GetMapTileTexture(), "%w+/%w+/%w+/(%w+)_%w+_%d.dds")"
but that gives nothing.
All I can get is the "353" for Craglorn using "GetCurrentMapZoneIndex()". What am I missing?

UPDATE: I have found it's the same problem with the Harborage, at least in Stonefalls.

It looks to me like something like this is the only solution at the moment:
Lua Code:
  1. local subzone = string.match(GetMapTileTexture(), "%w+/%w+/%w+/(%w+)_%w+_%d.dds")
  2.         if GetCurrentMapZoneIndex() == 353 and subzone == nil then
  3.             subzone = "dragonstar"
  4.         end
Please correct me if I am wrong.

Garkin 01/27/15 01:13 PM

Usual pattern for map name looks like this:
"Art/maps/alikr/alikr_base_0.dds"

But Dragonstar map uses slightly different pattern name:
"Art/maps/craglorn/craglorn_dragonstar_base_0.dds"

For example this LibMapPins code
Lua Code:
  1. local zone, subzone = LibStub("LibMapPins-1.0"):GetZoneAndSubzone()
returns forDragonstar:
"craglorn", "craglorn_dragonstar"

and for Alik'r:
"alikr", "alikr_base"


You can either change your pattern or just use return value from LibMapPins (Destinations uses this library already).

circonian 01/27/15 09:31 PM

I don't know for sure if POIIndices ever change. I've only been messing with them & the map for the last couple of days, but I don't recall seeing any of them change value.

Maybe someone else with more experience with them could comment on that, but this seems to work:
Lua Code:
  1. local iZoneIdex, iPoiIndex = GetCurrentSubZonePOIIndices()
  2. if iZoneIdex == 353 and iPoiIndex == 74 then
  3.     d("In dragonstar")
  4. end

**** EDIT: ****************************************
I should have clarified you asked how to detect the change. You could check it in the EVENT_ZONE_CHANGED
Lua Code:
  1. local function onZoneChanged(eventCode, zoneName, subZoneName, newSubzone)    
  2. if subZoneName == GetPOIInfo(353, 74) then
  3.       d("I'M IN DRAGONSTAR")
  4. else
  5.       d("I'm not in dragonstar")
  6. end
  7.  
  8. EVENT_MANAGER:RegisterForEvent(WaypointIt.name, EVENT_ZONE_CHANGED, onZoneChanged)
**************************************************


Or if you want to be safe, use the POIIndex to get the objectiveName and see if its "Dragonstar"
Lua Code:
  1. local iZoneIdex, iPoiIndex = GetCurrentSubZonePOIIndices()
  2. if iZoneIdex == 353 and iPoiIndex == 74 then
  3.     d("In dragonstar")
  4. end
  5.  
  6. local objectiveName, objectiveLevel, startDescription, finishedDescription = GetPOIInfo(iZoneIdex, iPoiIndex)
  7. if iZoneIdex == 353 and objectiveName == "Dragonstar" then
  8.     d("Also in dragonstar")
  9. end

SnowmanDK 01/28/15 11:50 AM

Thanks both of you for your replies :)
I went with the one Garkin offered as LibMapPins is already used in my addon.
Was very easy to implement.

Case closed :)


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

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