Data/Abilities/Inventory

## Inventory

### Description

Allows the casting unit to pick up "Item" from unit data, from which the related Items data will display in the inventory.

### Hint

* When picked up, item units gains the **Hidden** attribute. What is displayed in the inventory is its Items data, which is the entry in its **Stats: Item** field of its unit data.
* Held item units can apply effects, using a 0 arc 0 radius Search Area effect, to the holding unit allowing for conditional activation not possible via the Items data type
* Due to UI changes since WOL the inventory slots appear hidden behind the **Menu** button in the default UI meaning that the **InventoryPanel** UI must be modified
* An editor crash has occured when attempting to morph the Item unit at the pick up moment. You simply can't morph it once picked up.

## Example Usage

### **Onetwo's Complete Hero Tutorial**

A video tutorial covering all the basics of making a hero, levelable abilities and items. Despite being a little long winded, covers all the basics quite well.

#### URL

http://www.youtube.com/watch?v=2ktGRw95eLM

### Simbiote Demonstration

Utilizes the Inventory ability of the host unit to allow symbiote units to insert themselves into the inventory where they give unique effects. While in the inventory there are bonuses given to the host hero based both on the level of the symbiote and that of the host. There are also parasitic symbiotes which demonstrate a range of uses for auto inserting items.

#### URL

https://www.sc2mapster.com/forums/resources/data-assets/176945-the-assets-of-evil

### Test Inventory (by Blizzard)

Blizzard made the ability named "Test Inventory" (blue data), which can be put on any unit to see how the ability works. It contains 3 premade fair examples.

## Fields Description

### (None): Tactical AI Func

Probably related to triggers, string for AI use.

### Ability: Commands - Default Button

See Abilities for more info. Since this ability is unique, there are specific commands that works like most any other abilities.

* Disabling the ability if the Requirements or Validators are no longer met or by other Behaviors does not automatically drop the held items, it merely disables any benefits gained from the Items data type and prevents manipulating them in the container. Requirements cannot hide it from UI either, you have to use Triggers and use the **Show/Hide UI Frame** action (selecting Inventory).

### Ability: Info

This is the main section where you get to deceide how the inventory is built. You can put Item Containers in it (which occupies one slot before opening into a submenu), you can put a starting Item, or leave it as an empty slot.

#### Index

Entry for each inventory slot. Each index represents 1 slot for 1 item, or for a bag (Item Containers), which opens into a further submenu of items. Creating 5 index means that selecting the unit with the inventory will display the whole 5 slots on UI. Leaving an index empty generates a free slot.

#### Alignment

* If the inventory slot has a container, this field determines if the container interface appears on the left or right of the screen
* If multiple containers open at once share the same side of the screen they overlap which can cause problems

#### Classes

* Only allows items with a matching item class from the Item Classes data type to be put in a specific inventory slot

#### Container

The container from the Item Containers data type opened by a specific inventory slot

* Left clicking an item slot with a container opens the interface for the container on the left or right of the screen
* It is possible to move an item from the main Inventory to a Container, although the cursor is a bit fussy when attempting to move it in.
* Requires an **Empty Face** icon entry, in which contrary case, won't open up.

#### Empty Face

The icon from the Buttons data type used for a container in a specific inventory slot.

* Just as stated above, it is an absolute necessity for a container to work.

#### Item

A unit/item from the Units data type that starts as picked up in "this" specific inventory slot whenthe **Inventory** ability is created

* The selected unit needs to have an item from the Items data type in the **Stats: Item** field.

#### Requirements

The Requirements that must be met on the unit with this ability to pickup item units into a specific inventory slot

* Also disables bonuses given by the Items data type from units already in the slot if the requirement is no longer met
* If the requirement is no longer met, manipulation of an item in the slot is disabled
* Power Up items ignore this field.

### Ability - Target Filters

Filters that determine which unit attributes the ability can target for pick up.

* Most likely "Items" filter for Units data should be set to required and it doesn't matter what type of Unit/Item/Object/Etc data it is. What matters is that the Units data contains a valid entry in its **Stats: Item** field, in which case "Item" filter only works . Otherwise, yes, it is possible (but silly) to pick up a unit?

### Ability: Validators

* Validators that must be met on the unit with this ability to use it

### Stats: Flags

Flags related to the Item in the inventory.

These flags are also present on Items data, which leads to believe that these one here overrides them.

* **Item Death:** Destroys all item in the inventory when the holding unit dies
* **Item Drop On Death:** The Item will drop its related Units data on the ground when the holding unit dies.
* **Can Use Item:** Enables the use of items with usable components on them. This is limited to the ability provided slots and does not prevent items from being used while inside an item container.
* **Can Stack Item:** Picking up a new item that matches with another one will let them pill up togheter.
* **Can Apply Equip Behavior:** Enables the apply behavior component of items.

### Stats: Maximum Drop Range

* How far from the holding unit it can drop an item unit from the inventory

### Stats: Range

* How close the unit with this ability needs to be to an item unit to pick it up into the inventory

## Related

* Iterate Inventory
* Unit Inventory Contains Item
* Unit Inventory Is Full
* Buttons
* Items
* Item Classes
* Item Containers
* Requirements
* Units
* Validators