# Unit Manipulates Inventory
Grammar — unit manipulates item
Flags —Native
|Event
This event fires when a unit performs the specified action on the specified inventory item. Use “Triggering Inventory Item” to get the inventory item, “Triggering Inventory Item Container” to get the container the item resides in, “Triggering Inventory Item Slot” to get the slot the item occupies, “Triggering Inventory Item Target Point” to get the point targeted by the action, and “Triggering Inventory Item Target Unit” to get the unit targeted by the action.
# Arguments
unitref
<unit> — Unitint
<preset::InventoryManipulation> — Manipulatesunitref
<unit> — Item
Returns — void
native void TriggerAddEventUnitInventoryChange(
trigger t,
unitref u,
int inChangeType,
unitref inItem,
);
# Event parameters
- Triggering Inventory Manipulation — EventUnitInventoryChange
- Triggering Inventory Item — EventUnitInventoryItem
- Triggering Inventory Item Container — EventUnitInventoryItemContainer
- Triggering Inventory Item Slot — EventUnitInventoryItemSlot
- Triggering Inventory Item Target Point — EventUnitInventoryItemTargetPoint
- Triggering Inventory Item Target Unit — EventUnitInventoryItemTargetUnit
# Related
Category: Unit / Items
- Create Inventory Item —
void
— UnitInventoryCreate - Add Item To Inventory —
void
— UnitInventoryAdd - Last Created Inventory Item —
unit
— UnitInventoryLastCreated - Inventory Item Carried —
unit
— UnitInventoryItem - Inventory Item Carrier —
unit
— UnitInventoryUnit - Inventory Item Container —
int
— UnitInventoryContainer - Inventory Item Slot —
int
— UnitInventorySlot - Inventory Item Index —
int
— UnitInventoryIndex - Inventory Item Count —
int
— UnitInventoryCount - Inventory Items Carried —
unitgroup
— UnitInventoryGroup - Open Inventory Container —
void
— UnitInventoryContainerOpen - Move Inventory Item —
void
— UnitInventoryMove - Remove Inventory Item —
void
— UnitInventoryRemove - Unit Acquires Powerup —
void
— TriggerAddEventUnitPowerup - Triggering Powerup —
unit
— EventUnitPowerupUnit - Unit Manipulates Inventory —
void
— TriggerAddEventUnitInventoryChange - Triggering Inventory Manipulation —
int
<preset::InventoryManipulation> — EventUnitInventoryChange - Triggering Inventory Item —
unit
— EventUnitInventoryItem - Triggering Inventory Item Container —
int
— EventUnitInventoryItemContainer - Triggering Inventory Item Slot —
int
— EventUnitInventoryItemSlot - Triggering Inventory Item Target Point —
point
— EventUnitInventoryItemTargetPoint - Triggering Inventory Item Target Unit —
unit
— EventUnitInventoryItemTargetUnit
# Examples
mods/warcoop/warclassic.sc2mod — base.sc2data/TriggerLibs/WarClassic.galaxy:497
libGAw3_gt_EVENT_PLAYER_UNIT_DROP_ITEM = TriggerCreate("libGAw3_gt_EVENT_PLAYER_UNIT_DROP_ITEM_Func");
TriggerEnable(libGAw3_gt_EVENT_PLAYER_UNIT_DROP_ITEM, false);
TriggerAddEventUnitInventoryChange(libGAw3_gt_EVENT_PLAYER_UNIT_DROP_ITEM, null, c_unitInventoryChangeDrops, null);
}
mods/warcoop/warclassic.sc2mod — base.sc2data/TriggerLibs/WarClassic.galaxy:541
libGAw3_gt_EVENT_PLAYER_UNIT_PICKUP_ITEM = TriggerCreate("libGAw3_gt_EVENT_PLAYER_UNIT_PICKUP_ITEM_Func");
TriggerEnable(libGAw3_gt_EVENT_PLAYER_UNIT_PICKUP_ITEM, false);
TriggerAddEventUnitInventoryChange(libGAw3_gt_EVENT_PLAYER_UNIT_PICKUP_ITEM, null, c_unitInventoryChangePicksUp, null);
}
mods/warcoop/warclassic.sc2mod — base.sc2data/TriggerLibs/WarClassic.galaxy:585
libGAw3_gt_EVENT_PLAYER_UNIT_USE_ITEM = TriggerCreate("libGAw3_gt_EVENT_PLAYER_UNIT_USE_ITEM_Func");
TriggerEnable(libGAw3_gt_EVENT_PLAYER_UNIT_USE_ITEM, false);
TriggerAddEventUnitInventoryChange(libGAw3_gt_EVENT_PLAYER_UNIT_USE_ITEM, null, c_unitInventoryChangeUses, null);
}
mods/warcoop/warclassic.sc2mod — base.sc2data/TriggerLibs/WarClassic.galaxy:727
libGAw3_gt_EVENT_PLAYER_UNIT_PAWN_ITEM = TriggerCreate("libGAw3_gt_EVENT_PLAYER_UNIT_PAWN_ITEM_Func");
TriggerEnable(libGAw3_gt_EVENT_PLAYER_UNIT_PAWN_ITEM, false);
TriggerAddEventUnitInventoryChange(libGAw3_gt_EVENT_PLAYER_UNIT_PAWN_ITEM, null, c_unitInventoryChangeSells, null);
}
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:551
void libGAwX_gt_SuppressInvisibilitywhenUsingItems_Init () {
libGAwX_gt_SuppressInvisibilitywhenUsingItems = TriggerCreate("libGAwX_gt_SuppressInvisibilitywhenUsingItems_Func");
TriggerAddEventUnitInventoryChange(libGAwX_gt_SuppressInvisibilitywhenUsingItems, null, c_unitInventoryChangeUses, null);
}