ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Changes on PTS 1.2.2 (https://www.esoui.com/forums/showthread.php?t=1811)

CrazyDutchGuy 06/30/14 03:03 AM

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)

Flagrick 06/30/14 03:29 AM

Quote:

Originally Posted by CrazyDutchGuy (Post 10008)
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.

Garkin 06/30/14 03:54 AM

Quote:

Originally Posted by Flagrick (Post 10009)
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.

Flagrick 06/30/14 05:39 AM

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.

farangkao 06/30/14 09:21 AM

Quote:

Originally Posted by Flagrick (Post 10014)
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.

Xrystal 06/30/14 01:39 PM

Quote:

Originally Posted by farangkao (Post 10019)
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.

Khaibit 06/30/14 09:46 PM

Quote:

Originally Posted by CrazyDutchGuy (Post 9868)
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?

CrazyDutchGuy 07/01/14 01:14 AM

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.

farangkao 07/01/14 04:23 AM

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.

Khaibit 07/01/14 08:17 AM

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


farangkao 07/01/14 01:04 PM

Not 100% sure, i will look into the Guild History Tab of the API, if i can find some info.

Khaibit 07/01/14 01:27 PM

Quote:

Originally Posted by farangkao (Post 10051)
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

SkOODaT 07/03/14 05:04 PM

well i got my answer about GetMapPlayerPosition('reticleover') just wish they would of released API changes before hand as i wasted time on it

Quote:

Originally Posted by ZOS_JessicaFolsom (Post 1071253)
Quote:

Originally Posted by SkOODaT (Post 1070804)
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.

Quote:

Originally Posted by SkOODaT (Post 1070804)
- 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.

Quote:

Originally Posted by SkOODaT (Post 1070804)
- 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

Flamage 07/03/14 10:40 PM

Quote:

Originally Posted by SkOODaT (Post 10129)
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.


All times are GMT -6. The time now is 06:48 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI