Thread Tools Display Modes
07/11/15, 06:37 AM   #1
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
List of all Zone Names

Hi all,

I've another question.
What is the best way to loop through all the zone names of the game?

My Idea was to have Loop with i = 1 to 99999 with this function inside GetZoneNameByIndex(i)
If the return value is not empty, I will push it to my array. This should return all zone names, right?

Keldor
  Reply With Quote
07/11/15, 06:49 AM   #2
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by Keldor View Post
Hi all,

I've another question.
What is the best way to loop through all the zone names of the game?

My Idea was to have Loop with i = 1 to 99999 with this function inside GetZoneNameByIndex(i)
If the return value is not empty, I will push it to my array. This should return all zone names, right?

Keldor
I use this:
Lua Code:
  1. local function GetZones()
  2.     local i = 1
  3.     local zones = data.Zones -- a table of your choice
  4.     local zbn = GetZoneNameByIndex
  5.     local zone
  6.     while true do
  7.       zone = zbn(i)
  8.       if zone == "" then break end
  9.       zones[zone] = i
  10.       i = i + 1
  11.     end
  12.   end
Don't forget: These names a raw, including localization data. You should use zo_strformat for display.
  Reply With Quote
07/11/15, 07:06 AM   #3
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
Originally Posted by votan View Post
I use this:
Lua Code:
  1. local function GetZones()
  2.     local i = 1
  3.     local zones = data.Zones -- a table of your choice
  4.     local zbn = GetZoneNameByIndex
  5.     local zone
  6.     while true do
  7.       zone = zbn(i)
  8.       if zone == "" then break end
  9.       zones[zone] = i
  10.       i = i + 1
  11.     end
  12.   end
Don't forget: These names a raw, including localization data. You should use zo_strformat for display.
Thanks votan,

this is very similar to my idea, I will give it a try.

Keldor
  Reply With Quote
07/11/15, 08:51 AM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Zone names by zoneIndex:
http://www.esoui.com/forums/showpost...3&postcount=13
  Reply With Quote
07/11/15, 12:03 PM   #5
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
Originally Posted by Garkin View Post
Hi Garkin,

thanks it was very useful for me.

Keldor

Last edited by Keldor : 07/11/15 at 01:33 PM.
  Reply With Quote
07/11/15, 01:33 PM   #6
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
Hi again,

is there a similar way to export all the titles not only the titles of the current character?
I've found now way to export all titles.

Keldor
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » List of all Zone Names


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