Quantcast Item Control - LoTROInterface
VGInterface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > General Authoring Discussion (L)

Reply
Thread Tools Display Modes
  #1  
Unread 04-04-2013, 03:30 PM
Davinna's Avatar
Davinna Davinna is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Mar 2011
Posts: 8
Item Control

I'm playing around with an idea of capturing the chat output for items looted and then displaying the item or a list in a window by item quality. You could choose to show only items above a certain quality and who received it. I don't think there's a plugin that does this?

I've got it so I can filter the text and capture the message with the looted item in it. I don't seem to understand how to get the "Item" singled out of the captured message to do any comparison or manipulation. Any pointers?
Reply With Quote
  #2  
Unread 04-05-2013, 07:29 AM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 229
Loot messages contain an examination tooltip entry in the form:
<ExamineItemInstance:ItemInfo:LONGANDUGLYITEMIDCOD E>[Item Name]<\ExamineItemInstance>
where LONGANDUGLYITEMCODE is an encoded item id. I haven't bothered figuring out what part of the code is the actual item, and it may be that the "generic" item ID is not in the code, only the unique instance ID since if you examine several of the codes you will see that the code changes from the examine tooltip generated by dragging an item from the loot window, the tooltip from the loot message, the tooltip from dragging from your backpack or dragging from an equipped slot. Even dragging the same exact item from two different bag slots will generate a different code so it would take quite a few samples and a lot of time to try to figure out how to decode it. It should be eaiser to decode the loot versions since they don't appear to be dependant on the slot in which the item is placed, just the unique item/stack ID. FWIW, the stack quantity is also included in the code since the same stack in the same bag slot will generate a different examination iteminfo for different quantities.

If you convert the characters to Unicode hex codes and ignore the upper byte it becomes a bit easier to see the data they represent. For instance, the first 5 codes appear to represent a number "0100 0100 0100 0100 0136" would be hex 0000000036. The next 5 codes seem to always be the same, "0100 0100 0100 0178 019C" or hex 000000789c. After that comes the encoded iteminfo.

I'm not sure why Turbine chose to use such a cryptic code but it may have something to do with fear that people would misrepresent items in links in chat when advertising/selling items. Of course, that's a pretty silly reason for this since anyone doing that could be easily caught and banned using the server chat logs. It is more likely that they included all of the info they did so that the item can be more easily represented and encoded it to limit the size of the data sent to the server and back when the client resolves the tooltip - the client probably caches the tooltip info since it definately takes longer to display the tooltip the first time, especially for things like identified LIs.

If I find some time I may go back to playing with the IDs as it is an interesting puzzle but I've got more than enough things already vying for attention. Oh look! A shiny... *wanders off in pursuit of yet another distraction*

Last edited by Garan : 04-05-2013 at 10:16 AM.
Reply With Quote
  #3  
Unread 04-05-2013, 07:49 AM
Davinna's Avatar
Davinna Davinna is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Mar 2011
Posts: 8
Thanks Garan.

Let's say I manage to get just the <ExamineItemInstance:ItemInfo:LONGANDUGLYITEMIDCOD E>[Item Name]<\ExamineItemInstance> separated from the message. Would it be possible to determine item quality from that?
Reply With Quote
  #4  
Unread 04-05-2013, 09:29 AM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 229
Quote:
Originally Posted by Davinna
Thanks Garan.

Let's say I manage to get just the <ExamineItemInstance:ItemInfo:LONGANDUGLYITEMIDCOD E>[Item Name]<\ExamineItemInstance> separated from the message. Would it be possible to determine item quality from that?
No idea at this time. As I mentioned above, it's a really ugly encoded value so determining what any part of it represents is a challenge. It is unlikely that the code directly includes anything such as the item quality. Most likely you would need to hope that one of the generic item IDs is in the code which you could then use to look up a lua iteminfo object and get the quality from there. As I stated above, some form of itemID, the quantity and the location that it is currently stored in are all part of the code and there may be other info in there as well. With enough samples with limited differences between samples it should be possible to determine how each value affects the encoded value and then slowly pick the code apart and create a formula to decode it (or even encode one from scratch). Unfortunately, while I enjoy such puzzles, it is a very time consuming process and I just don't have time available for it right now.

EDIT: If you choose to tackle this yourself, then I would first recommend writing a small plugin to capture examination tooltips, strip out the code, convert it to hexcodes and then display those in a control that allows copying and pasting them to notepad so that you can more easily explore them.
The code below will generate a hex code for a UTF-8 encoded string:
Code:
function gethexcode(tmp)
local hexcode=""
for index=1,string.len(tmp) do
if hexcode=="" then
hexcode=string.format("%x",string.byte(string.sub(tmp,index,index+1)))
else
hexcode=hexcode.." "..string.format("%x",string.byte(string.sub(tmp,index,index+1)))
end
end
return hexcode
end
Unfortunately, it may be that the string is supposed to be decoded as Unicode since after a bit of examination that seems to yield more obvious patterns.

Last edited by Garan : 04-05-2013 at 10:14 AM.
Reply With Quote
  #5  
Unread 04-05-2013, 09:45 AM
Davinna's Avatar
Davinna Davinna is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Mar 2011
Posts: 8
I understand. I wouldn't expect you to do it for me. Not sure I have the muster to take on such a task either. Again, Thanks for the info.
Reply With Quote
Reply


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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
U7 Item ID Changes detected from Item Scanner lunarwtr General Authoring Discussion (L) 0 05-18-2012 08:10 PM
Any threat-control plugins? dayangbian Interface Help (L) 4 05-16-2012 08:59 PM
Control.MouseWheel() event not working for you? Digital_Utopia Lua Programming Help (L) 7 06-20-2011 12:42 PM
Tab Control and Auto Sizing Label lunarwtr Tutorials & Other Helpful Information (L) 0 03-14-2011 08:26 PM
Can UI mods control which music is played? Vair Interface Requests (L) 2 06-13-2009 11:05 AM


All times are GMT -5. The time now is 10:32 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | VGInterface | LoTROInterface | MMOInterface | Swtorui