Thread Tools Display Modes
03/20/14, 02:07 PM   #1
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
character name function?

I cannot find the function to return your character's name. It looks like you can get the login name but I don't see how to find your currently logged in character. I would expect a simple call for that.

Would GetUnitName("player") be what I need?
  Reply With Quote
03/20/14, 02:57 PM   #2
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
There were 3 functions that returned your name. One for your character , one including the server name and one for your @ name. I put it in one of the threads somewhere but will check again when I get home.
  Reply With Quote
03/20/14, 03:26 PM   #3
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Thanks!

I can't test these out until live, but I've been coding an addon and I just couldn't find that functionality.
  Reply With Quote
03/20/14, 03:32 PM   #4
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Here you go:

local charName = GetUnitName("player")
local serverCharName = GetUniqueNameForCharacter(charName)
local accountName = GetDisplayName()

This was tested during the weekend test before the last one so about a month or so old testing wise. But I don't recall these functions amongst the ones that were deprecated.
  Reply With Quote
03/20/14, 03:38 PM   #5
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Originally Posted by Xrystal View Post
Here you go:

local charName = GetUnitName("player")
local serverCharName = GetUniqueNameForCharacter(charName)
local accountName = GetDisplayName()

This was tested during the weekend test before the last one so about a month or so old testing wise. But I don't recall these functions amongst the ones that were deprecated.
Thanks!

I saw GetDisplayName(), but was pretty sure that was the @name.

But now, that leads to another question... what's the server? Is that EU/US/PTR?
  Reply With Quote
03/20/14, 03:49 PM   #6
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Can't remember what was displayed when I tested it on myself but it was something along the lines of charname - server name .. I'll see if I happened to screenshot it but I don't think I did.

nope: Just screenshotted the big data grabs I did in case I needed to check the info.

Last edited by Xrystal : 03/20/14 at 03:52 PM.
  Reply With Quote
03/21/14, 01:14 PM   #7
Lodur
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 108
Let's follow this up with the extra character after character names.

What is the deal with these? I know all player names from EVENT_COMBAT_EVENT have about 3 extra characters on the end. A few NPC characters do too...

Any one know why or have any details here?
  Reply With Quote
03/22/14, 05:44 AM   #8
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
And another interesting name function I hadn't spotted before :

DecorateDisplayName(string displayName)

With its UnDecorate and IsDecorated.. sister functions. Wonder what that does.
  Reply With Quote
03/22/14, 01:09 PM   #9
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Xrystal, I saw that too. I figured it was the extra stuff added to indicate a boss or elite.
  Reply With Quote
03/22/14, 01:21 PM   #10
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Ah yeah that would make sense
  Reply With Quote
03/22/14, 02:06 PM   #11
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Originally Posted by Lodur View Post
Let's follow this up with the extra character after character names.

What is the deal with these? I know all player names from EVENT_COMBAT_EVENT have about 3 extra characters on the end. A few NPC characters do too...

Any one know why or have any details here?
Are they blank, or gibberish, or what?
  Reply With Quote
03/23/14, 10:06 AM   #12
Lodur
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 108
Originally Posted by Vuelhering View Post
Are they blank, or gibberish, or what?
Generally they are something like "Bob the Builder^Mx"

Just remove the '^' and all that follows for the cleanup. But the question is why is it there at all???
  Reply With Quote
03/23/14, 11:56 AM   #13
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
That looks similar to what I was seeing when I was looking at items looted. I think it was the itemLink or itemString but not 100% sure now.
  Reply With Quote
04/01/14, 04:23 PM   #14
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Originally Posted by Lodur View Post
Let's follow this up with the extra character after character names.

What is the deal with these? I know all player names from EVENT_COMBAT_EVENT have about 3 extra characters on the end. A few NPC characters do too...

Any one know why or have any details here?
Finally figured out what you were talking about, Lodur.

The strange characters are because it's a "raw" name. What does that mean? No idea.

GetRawUnitName() vs GetUnitName()

I don't know how to reliably convert it, either.
  Reply With Quote
04/01/14, 05:07 PM   #15
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
I also noticed after a few item names '^p' being added. Can't think what it is but just added code to remove those characters if they exist in the hopes that it works but not come across another one yet to test it out.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » character name function?


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