Thread Tools Display Modes
06/30/14, 03:03 AM   #41
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
Loop of your inventory and search for the itemlink, and use bag GetItemName to extract name
Lua Code:
  1. GetItemLink(integer bagId, integer slotIndex, LinkStyle linkStyle)
  2. GetItemName(integer bagId, integer slotIndex)
  Reply With Quote
06/30/14, 03:29 AM   #42
Flagrick
 
Flagrick's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 24
Originally Posted by CrazyDutchGuy View Post
Loop of your inventory and search for the itemlink, and use bag GetItemName to extract name
Lua Code:
  1. GetItemLink(integer bagId, integer slotIndex, LinkStyle linkStyle)
  2. GetItemName(integer bagId, integer slotIndex)
thx, but it doesn't work with EVENT_LOOT_RECEIVED and QuestTool's items.
The items are not realy in the bag but in the quest manager.

To precise my question : how to match itemlink from EVENT_LOOT_RECEIVED that contains no text, with QuestTool's items that i have all info and specially name.
  Reply With Quote
06/30/14, 03:54 AM   #43
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Flagrick View Post
thx, but it doesn't work with EVENT_LOOT_RECEIVED and QuestTool's items.
The items are not realy in the bag but in the quest manager.

To precise my question : how to match itemlink from EVENT_LOOT_RECEIVED that contains no text, with QuestTool's items that i have all info and specially name.
I'm not sure if it helps, but when I was trying to update X4D_Loot addon (a have updated version in my folder on Firedrive), I saw different way how to deal with quest tools. Try to take a look into that addon if you can get some ideas from there.
  Reply With Quote
06/30/14, 05:39 AM   #44
Flagrick
 
Flagrick's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 24
Yes i know, he has implemented his own Internal Questmanager.
I could do something like that
But i want to avoid this, because at the end, the purpose is to get icons to show what we loot in LootDrop, and doing a questmanager for that is a bit too much, i think.
  Reply With Quote
06/30/14, 09:21 AM   #45
farangkao
 
farangkao's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 59
Originally Posted by Flagrick View Post
Yes i know, he has implemented his own Internal Questmanager.
I could do something like that
But i want to avoid this, because at the end, the purpose is to get icons to show what we loot in LootDrop, and doing a questmanager for that is a bit too much, i think.
I found this simple but effective way to get the right data from EVENT_LOOT_RECIEVED ...

On the Event, you simply check the Current Inventory for the same ID, and get the Icon and Name from there, it works very well (didn't found a flaw so far)

You can check the Source Code of Mobile Bank Extended ,function "MB.LootRecieved", the only speciality there is that i've looking in the previously saved Table, but i could also do a live lookup of the inventory to get the same result.
  Reply With Quote
06/30/14, 01:39 PM   #46
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Originally Posted by farangkao View Post
I found this simple but effective way to get the right data from EVENT_LOOT_RECIEVED ...

On the Event, you simply check the Current Inventory for the same ID, and get the Icon and Name from there, it works very well (didn't found a flaw so far)

You can check the Source Code of Mobile Bank Extended ,function "MB.LootRecieved", the only speciality there is that i've looking in the previously saved Table, but i could also do a live lookup of the inventory to get the same result.
I use SlotUpdate to get item information from the inventory and LootReceived to confirm the details were received by the user of the addon and not a third party nearby. It only writes the item details to the data table if the player received the item.
  Reply With Quote
06/30/14, 09:46 PM   #47
Khaibit
 
Khaibit's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 26
Originally Posted by CrazyDutchGuy View Post
Actually I am complaining, as by the itemlink changes i can't determine the quality anymore based on the itemlink. Neither can i determine the itemname anymore from the itemlink. Also it has quite an impact if you use custom links.
So...having read through this and a few other threads...I get how to re-create the item name if the item is in your bags/bank somewhere, but how would you do this for (say for example) an item link retrieved from a guild store sales history? Those do not exist in your inventory, so all you get out of it is the new text-less item link (like "|H0:item:44176:51:50:0:0:0:0:0:0:0:0:0:0:0:0:5:0:0:0:0|h|h") and you can't check your bags for it to pull out a textual form. Setting that as the text of a label or button displayed the item correctly in the correct color and all that, so at least privately it's possible...lacking the plain text in the links makes it a pain to search through a table of items >.<

For example:

Code:
 for i = 0, numEvents do
    local theEvent = {}
    _, theEvent.secsSince, theEvent.seller, theEvent.buyer, 
    theEvent.quant, theEvent.itemName, theEvent.salePrice = GetGuildEventInfo(1, GUILD_HISTORY_SALES, i)
    -- theEvent.itemName now contains a text-less item link.  How to search against the name of the item?
  end
I've seen an addon that wrote their own function to do this, but he literally re-created the entire item data format as a giant lookup table and re-assembles the items by hand (and thus, it's horribly broken any time they update item IDs, styles, qualities, etc.). There's gotta be an easier way?

Last edited by Khaibit : 06/30/14 at 10:14 PM.
  Reply With Quote
07/01/14, 01:14 AM   #48
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
I wish there was an easier way to extract item name from item links, but the only way i know it can be done since patch is based on having the item in your inventory.
  Reply With Quote
07/01/14, 04:23 AM   #49
farangkao
 
farangkao's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 59
It doesn't have to be the Inventory alone, but all of the values that can be entered as bagId in
the GetItemName(bagId,slotIndex) function.

There are Global Variables defined.

So far known to me:

Lua Code:
  1. BAG_BACKPACK = 1  -- your Inventory
  2. BAG_BANK = 2       -- your Bank
  3. BAG_BUYBACK = 4   -- Buyback Tab*
  4. BAG_DELETE = 255  -- No Idead,probably recently destroyed items (need to investigate)
  5. BAG_GUILDBANK = 3  --  Guildbank(s) *
  6. BAG_TRANSFER = 5   -- No Idea, probably Player-to-Player Transfer Window Items
  7. BAG_WORN = 0      -- Equipped Items

* when accessing Guildbank Data you should wait for an event called EVENT_GUILD_BANK_ITEMS_READY
Probably similar event for Buyback Tab.

So for Khabit's problem ,the only solution i currently know:
- Scan Guild Bank Items, save them (important "ID", "Name")
- Scan ItemLinks from History, compare the "ID" with the "ID" of the previously saved information.
to retrieve the Name.

Last edited by farangkao : 07/01/14 at 04:31 AM.
  Reply With Quote
07/01/14, 08:17 AM   #50
Khaibit
 
Khaibit's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 26
Hmm...so, if I'm understanding you correctly, farangkao, there's absolutely no way to reconstruct an item's name from that link for Guild Store sales history events? (Since once an item shows up in that history it's not in a bank, or bag other than the purchaser's inventory or mail possibly)

That's...truly unfortunate and completely breaks a major part of functionality in an addon I'm writing. Awesome. Especially since it's clearly possible with private functions since this displays a properly colorized item name just fine:

Code:
if RequestGuildHistoryCategoryNewest(1, GUILD_HISTORY_SALES) then
  local numEvents = GetNumGuildEvents(1, GUILD_HISTORY_SALES)
  if numEvents > 0 then
    local theEvent = {}
    -- Other fields in order are event type, seconds since event, seller, buyer, quantity, and sale price
    _, _, _, _, _, theEvent.itemName, _, = GetGuildEventInfo(1, GUILD_HISTORY_SALES, 1)

    -- Assume for brevity we have a label defined elsewhere called testLabel
    -- Post-1.2.3, itemName contains just type/data, no text, but still shows colorized item name fine
    testLabel:SetText(itemName)
  end
end

Last edited by Khaibit : 07/01/14 at 08:30 AM.
  Reply With Quote
07/01/14, 01:04 PM   #51
farangkao
 
farangkao's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 59
Not 100% sure, i will look into the Guild History Tab of the API, if i can find some info.
  Reply With Quote
07/01/14, 01:27 PM   #52
Khaibit
 
Khaibit's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 26
Originally Posted by farangkao View Post
Not 100% sure, i will look into the Guild History Tab of the API, if i can find some info.
Thank you, I appreciate anything you come up with, even it it's just random things for me to try.

Ultimately, part of the addon I'm writing involves being able to search a list of guild sales compiled from all guilds a player is in, so if I cannot search the item names that part of the functionality is a little pointless, heh

Oh, if only GetItemInfo() worked on item links! Everything internal seems to handle the text-less links that GetGuildEventInfo() now returns (inserting into chat creates a clickable link just fine, creating a tooltip with it looks fine, even just flat-out calling d() on the link is a nice colorized name.) Just need access to whatever they're all calling :P

Last edited by Khaibit : 07/01/14 at 02:38 PM.
  Reply With Quote
07/03/14, 05:04 PM   #53
SkOODaT
 
SkOODaT's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 58
well i got my answer about GetMapPlayerPosition('reticleover') just wish they would of released API changes before hand as i wasted time on it

Originally Posted by ZOS_JessicaFolsom View Post
Originally Posted by SkOODaT View Post
can we get an update for :
-TargetX, TargetY, TargetH = GetMapPlayerPosition('reticleover') doesn't return target X,Y is this a bug or intentionally removed?
This was intentionally removed, and there are no current plans to return the functionality.

Originally Posted by SkOODaT View Post
- IsUnitDead('reticleover') , completely broken dead units return nothing, unless transformed into a werewolf??
We're looking into this. As you mentioned, that is not working as intended.

Originally Posted by SkOODaT View Post
- GetDisplayName(), whats happening with this, is it comming monday? like an update as MANY ppl have modified/fixed thier saves and now are loggin new data and will half to fix again...
We're working on a fix for this one, though we don't have an ETA yet.

seems we may be stuck with the GetDisplayName() for a while i dont think its high on thier list lol
  Reply With Quote
07/03/14, 10:40 PM   #54
Flamage
 
Flamage's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 60
Originally Posted by SkOODaT View Post
seems we may be stuck with the GetDisplayName() for a while i dont think its high on thier list lol
Well that's a real shame. I was really hoping that they'd just just fix it and I wouldn't have to deploy a hacky workaround to determine the account name from guild or saved account name. No offense intended zgrssd - your solution is great and it is probably what I'll use.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Changes on PTS 1.2.2

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