View Single Post
06-13-17, 02:16 AM   #3
loff93
A Fallenroot Satyr
Join Date: Apr 2017
Posts: 25
Originally Posted by lightspark View Post
You guessed it right.

GetItemInfo returns raw values, they aren't packed, it's not a table. So obv there's no itemTexture member of name, name is just a string.

-- edit #1

Lua Code:
  1. local function normal_loop()
  2.     -- guess numMaterials and craftingMaterials are defined elsewhere :p
  3.     for index = 1, numMaterials do
  4.         local itemID = craftingMaterials[index]
  5.         local name, _, _, _, _, _, _, _, _, texture = GetItemInfo(itemID)
  6.         if name then
  7.             print(texture)
  8.         else
  9.             -- you don't write anything to wait[itemID] table
  10.             -- simple true should be enough
  11.             wait[itemID] = true
  12.         end
  13.     end
  14. end
Awesome, wasn't sure how to write
Code:
local name, _, _, _, _, _, _, _, _, texture = GetItemInfo(itemID)
without storing everything etc. Works really well , but only if the character has already cached the texture.
How do I solve this issue:
When character has already "GET_ITEM_INFO_RECEIVE" the item ID but still needs the texture?
Code:
	    if name and texture then
                testing2(name,texture)
            else
                wait[itemID] = {}
            end

Last edited by loff93 : 06-13-17 at 02:18 AM.
  Reply With Quote