Thread Tools Display Modes
12/17/14, 10:19 PM   #1
Carter_DC
 
Carter_DC's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 18
unitTag or DisplayName

Hi guys, i got a list of guildmates (displayName and CharName) and trying to get a zoneName for each of them.

Since the only way i know of getting an area name is the GetUnitZone(unitTag),
is there a way to go from a displayName (@accountName) to a unitTag ?

or any other way to get the areaName for theses only 2 vars i got ?

(btw, are zoneNames already localized ? )
  Reply With Quote
12/17/14, 11:35 PM   #2
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
http://wiki.esoui.com/API#Guild

Lua Code:
  1. for guild = 1, GetNumGuilds() do
  2.  
  3.     -- Guildname
  4.     local guildId = GetGuildId(guild)
  5.     local guildName = GetGuildName(guildId)
  6.    
  7.     -- Occurs sometimes
  8.     if(not guildName or (guildName):len() < 1) then
  9.         guildName = "Guild " .. guildId
  10.     end
  11.    
  12.     -- some code
  13.    
  14.     for member = 1, GetNumGuildMembers(guildId) do
  15.    
  16.     --  GetGuildMemberCharacterInfo(integer guildId, luaindex memberIndex)
  17.     --      Returns: bool hasCharacter, string characterName, string zoneName, integer classId, integer alliance, integer level, integer veteranRank
  18.    
  19.     -- some code
  20.    
  21.     end
  22.  
  23. end

Maybe a zo_strformat for zoneName then.

Last edited by Ayantir : 12/17/14 at 11:40 PM.
  Reply With Quote
12/18/14, 03:37 AM   #3
Carter_DC
 
Carter_DC's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 18
thx Ayantir, but that's precisely what i wanted to avoid ;p
i really hope there's another way than iterrating throughout the entire roster waiting to find the characterName i want ^^

as for the zo_strformat, i can't find a list of parameters to get the localized version of a string...
  Reply With Quote
12/18/14, 03:44 AM   #4
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
You cannot get a unit tag for players that are not
a) in your group,
b) targeted by you,
c) yourself.

You can build a lookup table for the guild member index based on the character/display name.
When the guild roster changes you set it dirty and rebuild it when necessary.
I used this method in Social Indicators if you need a code example.
  Reply With Quote
12/18/14, 07:18 AM   #5
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Carter_DC View Post
(btw, are zoneNames already localized ? )
Yes, zone names are localized. If game client is in any other language then English, zone names will contain control characters at the end of the string which specify gender (masculine/femine/neuter), number (singular/plural) and few other things (anyone knows what is the meaning of "d", "g" or "x" characters?). In order to correctly format such names you can use zo_strformat function as was suggested by Ayantir.

Originally Posted by Carter_DC View Post
as for the zo_strformat, i can't find a list of parameters to get the localized version of a string...
In this topic as all I know about zo_strformat:
http://www.esoui.com/forums/showthread.php?t=1443

And what do you mean by localized version of a string? There is no way to get string in different language then which game currently uses. Only what you can do is dumping strings you need to your own table and use localized strings from that table. The same way as I did in English POI and Keep Names.
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » unitTag or DisplayName


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