Not sure if this goes here or the trigger forum. This isn't a tutorial that tell you how to do something, but just how somethings functions and events work, that you wouldn't necessarily know at first. I made this just try to give back a bit to the community, its not much but incase some1 whats to do some work related to the "unit manipulates inventory" i wanted to share what i have learned.
Im gonna go through what each "manipulation" does, even if its sorta obvious
Uses - When ever you use an item with a charge. (havn't tested a unit w/o charges that you can use as much as you want)
Sells - When ever u pawn an item
Receives - When ever u get an item from another unit.
Picks up - When ever you pick up an item
Moves - When ever u move an item within a container or to another container, as long as it stays on the unit
Loses - When ever you lose an item
Gives - When ever you give an item to another unit
Gains - When ever you gain an item
Exhausts - When ever an item with charges reaches 0 charges( idk if its possible but havnt tested with an item that can have 0 charges)
Drops - When ever you move an item to the floor
Buys - When ever you get an item from some sort of vendor
Now to the not so obvious part, and more important info that you would probably want to know when dealing with this event and its parameters.
Fist, a single action can actually trigger more then one event. For example if unit A give unit B an item, actually 4 events occur, give lost gain and recieve.
Unit A lost the item, and it also gave it. Unit B Gained and Received the item.
This isn't unique to unit giving each other items though. For example when you buy an item 2 events happen, buy and gain, take note though that not receive. receive is unique to only when a unit receives an item from another unit not bought from a vendor. That goes the same for example when a unit picks up an item. When a unit picks up an item up it would be considered as gain and pick only.
Second, when ever u move an item theres a few key things to remember while doing trigger with this event. Move only happens when an item's slot or container is changed. if u give the item to another unit its then not a move event.
Also if u move an item into a slot occupied with another item they switch places. When this happens it count as 2 move events not one, because the item u selected to move moves, and the item that had the previous slot also moves. Unfortunately when ever you move an item onto another item's slot there is no pre-existing way to refer to the item that was replaced. For Example Item A will be in slot 1, and Item B will be in slot 2, both in the same container. You move Item A into Item B's slot, so that they switch places. Your trigger with the event "Any Unit Moves Any Item" will fire twice, but in each instance you wont be able to refer to the item in any pre-existing way. The function "Triggering Inventory Item" will refer to Item A in one instance and Item B in another, and sadly the function "Triggering Inventory Item Target Unit" doesn't refer to the other Item in neither instance even tho items and technically units.
Third, When a function is asking for the index of an item like the "Inventory Item Carried" function. The index is determined by which order you got the item, so the 1st item you gained would be 1. However an items index can change if u move it around (not exactly sure to what it changes). In my personal opinion referring to items through indexes is a waste of time because you don't actually know where it is and its just confusing.
Fourth, All the possible events with items that i could think of fall under one of 4 different events. Lost Gain Move or Use. Just something that i think would be useful to keep in mind while making triggers.
The last thing that i can think of that deserves mentioning, though this is somewhat minor, when referring to containers they are numbered 1-x (x being how many containers and/or container slots the inventory ability has). Unlike most things in the editor like triggers, there is no 0 container. However when in game the hotkeys for the containers are on the number-pad 0-(x-1).
Well thats it, i hope that some1 finds this atleast somewhat useful, and tbh doing triggers with the inventory atm is to say the least a pain in most cases. Hope Blizz does something soon about that.
Please leave any comments or questions
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Not sure if this goes here or the trigger forum. This isn't a tutorial that tell you how to do something, but just how somethings functions and events work, that you wouldn't necessarily know at first. I made this just try to give back a bit to the community, its not much but incase some1 whats to do some work related to the "unit manipulates inventory" i wanted to share what i have learned.
Im gonna go through what each "manipulation" does, even if its sorta obvious
Uses - When ever you use an item with a charge. (havn't tested a unit w/o charges that you can use as much as you want)
Sells - When ever u pawn an item
Receives - When ever u get an item from another unit.
Picks up - When ever you pick up an item
Moves - When ever u move an item within a container or to another container, as long as it stays on the unit
Loses - When ever you lose an item
Gives - When ever you give an item to another unit
Gains - When ever you gain an item
Exhausts - When ever an item with charges reaches 0 charges( idk if its possible but havnt tested with an item that can have 0 charges)
Drops - When ever you move an item to the floor
Buys - When ever you get an item from some sort of vendor
Now to the not so obvious part, and more important info that you would probably want to know when dealing with this event and its parameters.
Fist, a single action can actually trigger more then one event. For example if unit A give unit B an item, actually 4 events occur, give lost gain and recieve.
Unit A lost the item, and it also gave it. Unit B Gained and Received the item.
This isn't unique to unit giving each other items though. For example when you buy an item 2 events happen, buy and gain, take note though that not receive. receive is unique to only when a unit receives an item from another unit not bought from a vendor. That goes the same for example when a unit picks up an item. When a unit picks up an item up it would be considered as gain and pick only.
Second, when ever u move an item theres a few key things to remember while doing trigger with this event. Move only happens when an item's slot or container is changed. if u give the item to another unit its then not a move event.
Also if u move an item into a slot occupied with another item they switch places. When this happens it count as 2 move events not one, because the item u selected to move moves, and the item that had the previous slot also moves. Unfortunately when ever you move an item onto another item's slot there is no pre-existing way to refer to the item that was replaced. For Example Item A will be in slot 1, and Item B will be in slot 2, both in the same container. You move Item A into Item B's slot, so that they switch places. Your trigger with the event "Any Unit Moves Any Item" will fire twice, but in each instance you wont be able to refer to the item in any pre-existing way. The function "Triggering Inventory Item" will refer to Item A in one instance and Item B in another, and sadly the function "Triggering Inventory Item Target Unit" doesn't refer to the other Item in neither instance even tho items and technically units.
Third, When a function is asking for the index of an item like the "Inventory Item Carried" function. The index is determined by which order you got the item, so the 1st item you gained would be 1. However an items index can change if u move it around (not exactly sure to what it changes). In my personal opinion referring to items through indexes is a waste of time because you don't actually know where it is and its just confusing.
Fourth, All the possible events with items that i could think of fall under one of 4 different events. Lost Gain Move or Use. Just something that i think would be useful to keep in mind while making triggers.
The last thing that i can think of that deserves mentioning, though this is somewhat minor, when referring to containers they are numbered 1-x (x being how many containers and/or container slots the inventory ability has). Unlike most things in the editor like triggers, there is no 0 container. However when in game the hotkeys for the containers are on the number-pad 0-(x-1).
Well thats it, i hope that some1 finds this atleast somewhat useful, and tbh doing triggers with the inventory atm is to say the least a pain in most cases. Hope Blizz does something soon about that.
Please leave any comments or questions