- Joined
- Mar 6, 2006
- Messages
- 282
I want to ask questions ALL the time, but hold off until it's a big enough reason to start a thread. So I'm making this thread where I can ask all these little questions!
[Question 1]
In my map, I have multiple copies of each item. These items correspond to each other, so I need to use a function to get an item's corresponding copy. This is how I have it set up right now...
If I need to get an item's copy, then I do:
Is there a better way to do it?
Edit: Damn, it would kind of suck, but I could delete all my items and make new ones with the Object hack, order the item codes correctly, and then just do
Click the awesome Myrmadon picture to go to my latest question.
Don't reply to any of my previous questions unless you really think there's something I might be missing. I only post a new question once I'm satisfied with the answer to my current question.
Don't reply to any of my previous questions unless you really think there's something I might be missing. I only post a new question once I'm satisfied with the answer to my current question.
[Question 1]
In my map, I have multiple copies of each item. These items correspond to each other, so I need to use a function to get an item's corresponding copy. This is how I have it set up right now...
JASS:
itemlist[0] = A
itemlist[1] = copy of A
itemlist[2] = B
itemlist[3] = copy of B
itemlist[4] = C
itemlist[5] = copy of C
itemlist[6] = D
itemlist[7] = copy of D
If I need to get an item's copy, then I do:
JASS:
function GetItemCopy takes integer whichItem returns integer
local integer index = 0
loop
exitwhen index > item list length
if ( whichItem == itemlist[index] ) then
return itemlist[ index + 1 ]
endif
set i = i + 1
endloop
return null
endfunction
Is there a better way to do it?
Edit: Damn, it would kind of suck, but I could delete all my items and make new ones with the Object hack, order the item codes correctly, and then just do
GetItemTypeId(item) + 1
haha. Also, anyone know any good reads on these IDs? I wanna know more about them, like, how they translate etc.
Last edited: