Thread Tools Display Modes
12/03/14, 06:57 AM   #1
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
ITEMTYPE_LOCKPICK have no effect?

Bank Manager Revived have been using ITEMTYPE_TOOL to move lockpicks, but I have been notified this also affects repair kits, which is not intended.
I then saw in the API WIKI there is ITEMTYPE_LOCKPICK but that don't seem to have any effect at all.
Either I overlooked something in my code (which is possible ) or it just doesn't work.

Can anyone confirm it actually works?
  Reply With Quote
12/03/14, 07:04 AM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
GetItemType on lockpicks I have returns 9 (ITEMTYPE_TOOL)
  Reply With Quote
12/03/14, 07:12 AM   #3
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Originally Posted by merlight View Post
GetItemType on lockpicks I have returns 9 (ITEMTYPE_TOOL)
Then I wonder why they even added ITEMTYPE_LOCKPICK to the API.
It doesn't seem to have any function at all.

But thanks for the feedback, guess I have to add a subfilter to make sure only lockpicks get affected.
  Reply With Quote
12/03/14, 01:27 PM   #4
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Originally Posted by merlight View Post
GetItemType on lockpicks I have returns 9 (ITEMTYPE_TOOL)
Follow up question:
How do you know what return value is equal to what?
I can't seem to find any tables showing that.
As I can see 9 = ITEMTYPE_TOOL
If I do a
Lua Code:
  1. GetItemType(item.bag, item.slot)
then I just get an integer.
  Reply With Quote
12/03/14, 02:08 PM   #5
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
you can find the values with addons (e.g. zgoo)
I wrote myself a list when I reviewed the item categories in AGS:
Code:
SI_ITEMTYPE1	x	ITEMTYPE_WEAPON
SI_ITEMTYPE2	x	ITEMTYPE_ARMOR
SI_ITEMTYPE3		ITEMTYPE_PLUG
SI_ITEMTYPE4	x	ITEMT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	ITEMTYPE_BLACKSMITHING_MATERIAL
SI_ITEMTYPE37	x	ITEMTYPE_WOODWORKING_RAW_MATERIAL
SI_ITEMTYPE38	x	ITEMTYPE_WOODWORKING_MATERIAL
SI_ITEMTYPE39	x	ITEMTYPE_CLOTHIER_RAW_MATERIAL
SI_ITEMTYPE40	x	ITEMTYPE_CLOTHIER_MATERIAL
SI_ITEMTYPE41	x	ITEMTYPE_BLACKSMITHING_BOOSTER
SI_ITEMTYPE42	x	ITEMTYPE_WOODWORKING_BOOSTER
SI_ITEMTYPE43	x	ITEMTYPE_CLOTHIER_BOOSTER
SI_ITEMTYPE44	x	ITEMTYPE_STYLE_MATERIAL
SI_ITEMTYPE45	x	ITEMTYPE_ARMOR_TRAIT
SI_ITEMTYPE46	x	ITEMTYPE_WEAPON_TRAIT
SI_ITEMTYPE47	x	ITEMTYPE_AVA_REPAIR
SI_ITEMTYPE48	x	ITEMTYPE_TRASH
SI_ITEMTYPE49		ITEMTYPE_SPELLCRAFTING_TABLET
SI_ITEMTYPE50		ITEMTYPE_MOUNT
SI_ITEMTYPE51	x	ITEMTYPE_ENCHANTING_RUNE_POTENCY
SI_ITEMTYPE52	x	ITEMTYPE_ENCHANTING_RUNE_ASPECT
SI_ITEMTYPE53	x	ITEMTYPE_ENCHANTING_RUNE_ESSENCE
Types without x are either unused, or I have not had an item to test it with.
No guarantees that all of the marked items are really in use either.
  Reply With Quote
12/03/14, 02:48 PM   #6
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Possible return values are listed in ESOUIDocumentationP5.txt

* GetItemType(*integer* _bagId_, *integer* _slotIndex_)
** _Returns:_ *[ItemType|#ItemType]* _itemType_

h5. ItemType
Warning: Spoiler



There's no direct way to get the name of the constant equal to the value returned by GetItemType, you'd have to build a table yourself or use LibConstantMapper.

The name is only useful for debugging, or if you want to use it in saved variables rather than integer. In code, you don't need to care what the integer value is.
  Reply With Quote
12/03/14, 03:27 PM   #7
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Thanks for the replies. You two gave me the information I needed

Originally Posted by sirinsidiator View Post
SI_ITEMTYPE47 x ITEMTYPE_AVA_REPAIR
That one puzzles me though... Is that repairs for walls and doors in Cyrodiil?
It doesn't work for repair kits for gear at least as they are listed together with lockpicks under
Code:
SI_ITEMTYPE9		ITEMTYPE_TOOL
  Reply With Quote
12/03/14, 03:40 PM   #8
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
you are right. they are wall and door repair items as AvA stands for Alliance versus Alliance.
  Reply With Quote
12/03/14, 04:55 PM   #9
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Just for completeness, you never want to use SI_ITEMTYPE47 in Lua code. The correct way to get that string is GetString("SI_ITEMTYPE", ITEMTYPE_AVA_REPAIR) -- it will work as long as the name is defined, even if they change the integer value.
  Reply With Quote
12/03/14, 05:02 PM   #10
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by SnowmanDK View Post
Follow up question:
How do you know what return value is equal to what?
I can't seem to find any tables showing that.
As I can see 9 = ITEMTYPE_TOOL
If I do a
Lua Code:
  1. GetItemType(item.bag, item.slot)
then I just get an integer.
You are correct there are several item types that are not used.
You can look on the wiki site under constants here: http://wiki.esoui.com/Constants_in_100008_API
and search for ITEMTYPE it will take you to a list that shows each item types values.

I don't remember for sure if that is a complete list, but you can create an up to date list by using the following code to grab all of the values of item types
Lua Code:
  1. -- Initialize ItemTypes
  2.     local itemTypeTable = {}
  3.     for key, value in zo_insecurePairs(_G) do
  4.        if (key):find("ITEMTYPE_")  and type(value) == "number" then
  5.           itemTypeTable [key] = value   -- sorts by itemType name
  6. -- or reverse the key & value to sort them by number
  7.           itemTypeTable [value ] = key-- sorts by itemType number
  8.        end
  9.     end

Props to Garkin for showing me this trick it has come in handy MANY times when I wanted to find all possible values of certain types of constants, or even to look for functions with certain words in them to see if a function existed for something I was trying to do (in case it was not listed on the wiki).
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » ITEMTYPE_LOCKPICK have no effect?


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