View Single Post
12/18/16, 04:26 AM   #2
JoKim
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 7
Originally Posted by Rhyono View Post
I'm sure this has a very simple answer, but: How do I choose just a piece of the return from ZoS functions that have multiple? I thought it might be a table, but doing it that way didn't work.

For example (from the wiki):
GetItemLinkTraitInfo(string itemLink)
Returns: number ItemTraitType traitType, string traitDescription, number traitSubtype, string traitSubtypeName, string traitSubtypeDescription

If I wanted just the trait subtype, how would I write that?
Code:
function YourFunction(ItemTraitType, traitDescription, traitSubtype, traitSubtypeName, traitSubtypeDescription)
    local yourvariable = traitSubtype
end
Trick is to list them all in the right order, since it's not the name but simply the order things are being send YourFunction(1st item, 2nd item, 3rd item, etc)
Doesn't matter if you don't do anything with the rest.

Last edited by JoKim : 12/18/16 at 04:36 AM. Reason: Clarification
  Reply With Quote