Thread Tools Display Modes
04/17/14, 12:49 PM   #1
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
get weapontype and armortype?

I've been looking for a function or global that maps the research line and craft to a type, such as bow (or woodworking, 1) for an arbitrary item.

It's easy enough to differentiate between weapons and armor, but how do you tell what specific type of weapon something is?

Something like craft, line = GetReasearchLine(bag,slot), or GetWeaponType(bag,slot)

Any ideas? I couldn't find anything in the api that looked right.
  Reply With Quote
04/17/14, 01:32 PM   #2
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
I guess I could parse a tooltip. That worked in wow.

If someone knows of an api function, please lmk.
  Reply With Quote
04/17/14, 02:20 PM   #3
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
You could also parse the item's icon. Icons always (AFAIK) say what weapon type or armor type they are, with one exception: all staves use the same icon so there is no granularity in that.

Your tooltip parsing idea may be used to further granulate staves into types, however...
  Reply With Quote
04/17/14, 04:04 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
If you figure out how to parse the tooltip, let me know. I've gone over it for 1-2 weeks.
  Reply With Quote
05/24/14, 12:54 PM   #5
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Looks like this has been added. Yay.

Thanks for posting that on reddit, ingeniousclown.
  Reply With Quote
05/24/14, 01:03 PM   #6
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
Originally Posted by Vuelhering View Post
Looks like this has been added. Yay.

Thanks for posting that on reddit, ingeniousclown.
You're very welcome!

You might find this useful, too:
http://www.esoui.com/downloads/info517-libResearch.html
  Reply With Quote
05/25/14, 02:05 AM   #7
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Originally Posted by ingeniousclown View Post
lol, just finished writing my own.

It was pretty convoluted to have to convert the armor/weapontype to researchlines. Had to go open the crafting stations to see the order.

Now that that exists, though, here's a quick preview of one of the things mine does so far....
Attached Thumbnails
Click image for larger version

Name:	NIM-ESO-preview.jpg
Views:	557
Size:	56.7 KB
ID:	257  
  Reply With Quote
05/27/14, 01:27 AM   #8
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Well, here's a bit of an annoyance.


ZOS added the GetItemArmorType(link) and GetItemWeaponType(link), but that is quite incomplete compared to existing ItemFunctions(bag,slot).

Specifically, there's no way to tell what traits are on an item just using the link.

This matters a lot, because you also cannot call GetItemTrait(bag,slot) on an item in the loot window (e.g.).

So now we need something like GetItemTraitLink(link).

Anyone see a workaround to get trait info just from the info that can be gleaned from a link (or the loot window)?
  Reply With Quote
05/27/14, 09:38 AM   #9
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
Originally Posted by Vuelhering View Post
Well, here's a bit of an annoyance.


ZOS added the GetItemArmorType(link) and GetItemWeaponType(link), but that is quite incomplete compared to existing ItemFunctions(bag,slot).

Specifically, there's no way to tell what traits are on an item just using the link.

This matters a lot, because you also cannot call GetItemTrait(bag,slot) on an item in the loot window (e.g.).

So now we need something like GetItemTraitLink(link).

Anyone see a workaround to get trait info just from the info that can be gleaned from a link (or the loot window)?
I don't think that means that the new functions are incomplete, it just means that the whole item API is just kinda... everywhere. I was pretty surprised when I first saw the announcement of the two new functions, as the new functions using ItemLink to get that info kind of clashes with the rest of the functions that use bagId and slotIndex.

As a result, it is easy to get all the necessary information of an item from the API if it exists in a bagId and slotIndex space. Is the loot window set in some temporary bag for the player, by chance? Like the guild bank? I'm guessing no, but it's worth asking.

I was under the impression that the community (more specifically, Aiiane I believe) had deciphered all the itemlink information, but the new functions almost seem to suggest that the information was in the itemLink the whole time. I kinda wanna research this more, but I don't even know if I'll remember any of this once I get home from work :P

But assuming what I said is true... all relevant information may be in the itemLink as one of the many optional variables... And if so, someone may need to write a library to parse out that information.
  Reply With Quote
05/27/14, 02:51 PM   #10
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Originally Posted by ingeniousclown View Post
I don't think that means that the new functions are incomplete, it just means that the whole item API is just kinda... everywhere. I was pretty surprised when I first saw the announcement of the two new functions, as the new functions using ItemLink to get that info kind of clashes with the rest of the functions that use bagId and slotIndex.

As a result, it is easy to get all the necessary information of an item from the API if it exists in a bagId and slotIndex space. Is the loot window set in some temporary bag for the player, by chance? Like the guild bank? I'm guessing no, but it's worth asking.

I was under the impression that the community (more specifically, Aiiane I believe) had deciphered all the itemlink information, but the new functions almost seem to suggest that the information was in the itemLink the whole time. I kinda wanna research this more, but I don't even know if I'll remember any of this once I get home from work :P

But assuming what I said is true... all relevant information may be in the itemLink as one of the many optional variables... And if so, someone may need to write a library to parse out that information.
Yeah, i was writing a library, but i think the link info is basically an item index that includes the item/trait into a database (different indices for same item with each trait), and [the link data contains] a bunch of info for the enchantment and style and level and quality. It seems odd that traits aren't there [in the link data instead of the item index], but I couldn't find them. It's possible it's a bit tag across 4 or 5 bits in the item index.

I definitely did a test where I made an item with and without a trait, and the data fields were identical, although iirc the item index was different.

Using a link allows it to work on basically all items since you can always get a link, but you can't always get a bag,slot. So it'll work in chat and loot bags.

Loot bags and even your equipped inventory are different (although you can use bag 0 for that) than bag,slot inventory. The get loot info api calls are highly different, and largely incomplete, compared to the inventory info stuff.

All they need to give us is a way to parse the raw tooltip data, before any addon made changes.

Last edited by Vuelhering : 05/27/14 at 04:37 PM. Reason: clarification on link data
  Reply With Quote
08/17/14, 03:03 PM   #11
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
Originally Posted by Vuelhering View Post
It seems odd that traits aren't there [in the link data instead of the item index], but I couldn't find them. It's possible it's a bit tag across 4 or 5 bits in the item index.

Using a link allows it to work on basically all items since you can always get a link, but you can't always get a bag,slot. So it'll work in chat and loot bags.
Looks like 1.3 may have added all this to links!
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » get weapontype and armortype?

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