Quantcast Dragonstar map name? - ESOUI
Thread Tools Display Modes
01/27/15, 07:02 AM   #1
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
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.
__________________
My addons: Destinations, ChatStamp and Bank Manager Revived

Last edited by SnowmanDK : 01/27/15 at 07:43 AM.
  Reply With Quote
01/27/15, 01:13 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 853
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).
__________________
@Garkin (retired from ESO)
My addons: SkyShards, LoreBooks, Dustman, Map Coordinates, No, thank you!, ... (full list)
  Reply With Quote
01/27/15, 09:31 PM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 648
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

Last edited by circonian : 01/27/15 at 10:27 PM.
  Reply With Quote
01/28/15, 11:50 AM   #4
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
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
__________________
My addons: Destinations, ChatStamp and Bank Manager Revived
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Dragonstar map name?

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