HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Inventory Slots

08-15-2004, 10:57 PM#1
ASDf00zz
If ((Item-type of (Item carried by "UNIT" in slot 1)) Equal to "ITEM" then do "ACTION" else do "ACTION"

Ok here is my question:
(Item carried by "UNIT" in slot 1))

is there any way i can change it to something like this:

(Item carried by "UNIT" in any slot in inventory))

??


Any help is appriciated.
08-15-2004, 11:12 PM#2
volatile
In order to check all the inventory slots you will have to use something like this.

for each integer 1 to 6
check inventory slot (integer a)
if item carried in slot (integer a) = to item do action.

that will get slots 1 to 6 and find your item. I've been having trouble doing something similar to this myself. I've been trying to set up combinations of items in my units inventory and having a trigger execute and remove 3 items from the inventory and replace the 3 items with 1 new item. It's very tricky seeing how you can't have item groups and other things like that. Good luck, hope this helps :)
08-16-2004, 03:03 AM#3
MightyScourge
All you have to do is run a boolean comparison.

There is a comparison that returns true or false that is called

Hero - Hero has Item

where you specify the hero and item. If it's not a specific item, but a type of item, use

Hero - Hero has Item of Type