Thread Tools Display Modes
01/24/15, 12:16 AM   #1
trou23
Join Date: Jan 2015
Posts: 2
ItemName from ItemLink

I'm going throught the guild sales transactions and pulling the data out using the GetGuildEventInfo method, which when dealing with a guild store sale returns the item link of the item that was sold. My question is, the item link sometimes has a ^n or ^p and I'm not sure why. Why are they being included in the item link?

Examples:
"|H0:item:54512:81:50:45870:81:50:0:0:0:0:0:0:0:0:0:5:0:0:0:0|hruby necklace of reduce spell cost^n|h"
"|H0:item:45100:51:50:26580:51:50:0:0:0:0:0:0:0:0:0:1:0:0:10000:0|hcalcinium pauldron of health^p|h"

I'm also curious why sometimes the names come back in all lower case and sometimes in proper case. Is there a trick I'm missing here?

Thanks in advance.
  Reply With Quote
01/24/15, 01:09 AM   #2
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
- the suffixes ^p , ^m, etc are here for translation help for the UI.

- some part of the UI add to the item link a string which will replace the original name of the item. on link handler system if a name is providen (between the |h) it's this one which is show.

- if sometimes the string is in lowercase its generally an abscence of the function zo_strformat (which also translate ^p ^n ^f etc).

a good start to play with zo_strformat is
http://www.esoui.com/forums/showthread.php?t=1443
  Reply With Quote
01/24/15, 01:14 AM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by trou23 View Post
I'm going throught the guild sales transactions and pulling the data out using the GetGuildEventInfo method, which when dealing with a guild store sale returns the item link of the item that was sold. My question is, the item link sometimes has a ^n or ^p and I'm not sure why. Why are they being included in the item link?

Examples:
"|H0:item:54512:81:50:45870:81:50:0:0:0:0:0:0:0:0:0:5:0:0:0:0|hruby necklace of reduce spell cost^n|h"
"|H0:item:45100:51:50:26580:51:50:0:0:0:0:0:0:0:0:0:1:0:0:10000:0|hcalcinium pauldron of health^p|h"

I'm also curious why sometimes the names come back in all lower case and sometimes in proper case. Is there a trick I'm missing here?

Thanks in advance.
The ^chars are used to display the names in masculine, feminine, singular, plural, exc... forms of the words.
Garkin made a great post about it here: ^p chars

He also gives a way to format the strings so they dont show up.

The difference in upper or lower case depend on where it is displayed in the game, but I'm not sure if theres a reason.

Although if you are wanting the item name you can use this:
Lua Code:
  1. -- Will produce Ruby Necklace of Reduced Spell Cost  (your first link you posted)
  2. zo_strformat(SI_TOOLTIP_ITEM_NAME, link)

If your wanting to keep the link, but formatted so it doesn't have the ^chars & has proper casing:
Lua Code:
  1. z
  2. zo_strformat("<<t:1>>", link)
The t in that line of code does this (from Garkins post):
t: - converts first letter to upper case in all words that have more than 1 character (used by default to format item links)
If you want some other kind of formatting for masculine, feminine, plural, or different casing see the link I posted above & scroll down about 3/4 of the way to garkins 3rd post. It has a big list of different things you can do.
  Reply With Quote
01/24/15, 06:34 AM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by trou23 View Post
I'm going throught the guild sales transactions and pulling the data out using the GetGuildEventInfo method, which when dealing with a guild store sale returns the item link of the item that was sold. My question is, the item link sometimes has a ^n or ^p and I'm not sure why. Why are they being included in the item link?

Examples:
"|H0:item:54512:81:50:45870:81:50:0:0:0:0:0:0:0:0:0:5:0:0:0:0|hruby necklace of reduce spell cost^n|h"
"|H0:item:45100:51:50:26580:51:50:0:0:0:0:0:0:0:0:0:1:0:0:10000:0|hcalcinium pauldron of health^p|h"

I'm also curious why sometimes the names come back in all lower case and sometimes in proper case. Is there a trick I'm missing here?

Thanks in advance.
All item links prior to Update 3 had item names included and game displayed this text. As we were complaining that we want way to traslate item names in links (because of chat full of german/french names on EU server), in Update 3 ZOS changed how it works and now is this text completely ignored. No matter what you write there, item link will always show localized name derived from itemId and the other information in link.
If you want to get item name, you should always use GetItemLinkName(itemLink).

Last edited by Garkin : 01/24/15 at 06:41 AM.
  Reply With Quote
01/24/15, 10:35 PM   #5
trou23
Join Date: Jan 2015
Posts: 2
Thank you all for your answers. It looks like zo_strformat is what I'm needing.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » ItemName from ItemLink


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