I want to "autofill" an inventory. I have 3 containers, where No. 1 is the general purpose storage and 2&3 are specific containers.
When the unit buys a new item, it appears in the storage (container 1) but I want it to be auto equiped in container 2 oder 3. I know I can trigger the "unit gains item" event and I can move an item to a container and slot. BUT: To move the item to a slot I have to check if this slot is already in use (otherwise it is swapped with the item that already uses the slot), but there is no option like "set variable = item carried in container X slot Y"!?
Okay ill see if this is something similar
For this way to work you will need to know each specific inventory slot index
These can be found with just a simple loop outputting the unit/item and slot value.
Pick Each Unit In Unit Group
Unit Group: Inventory Items Carried
Unit: Unit From Unit Group
Index: 1
Group: PlayerHero 1-9
Index 1: Picked Player
Switch
Value: Inventory Item Slot
Item: Picked Unit
Unit Group - Pick each unit in (All items carried by (Unit 1 from PlayerHero 1-9[Picked Player])) and do (Actions)
General - Switch (Actions) depending on (Inventory Slot of (Picked unit))
General - If (36)
General - If (Conditions) then do (Actions) else do (Actions)
(Picked unit) == No Unit
Do some Jazz
I want to "autofill" an inventory. I have 3 containers, where No. 1 is the general purpose storage and 2&3 are specific containers.
When the unit buys a new item, it appears in the storage (container 1) but I want it to be auto equiped in container 2 oder 3. I know I can trigger the "unit gains item" event and I can move an item to a container and slot. BUT: To move the item to a slot I have to check if this slot is already in use (otherwise it is swapped with the item that already uses the slot), but there is no option like "set variable = item carried in container X slot Y"!?
Any ideas how to solve this?
No ideas?
Okay ill see if this is something similar
For this way to work you will need to know each specific inventory slot index
These can be found with just a simple loop outputting the unit/item and slot value.
Pick Each Unit In Unit Group
Unit Group: Inventory Items Carried
Unit: Unit From Unit Group
Index: 1
Group: PlayerHero 1-9
Index 1: Picked Player
Switch
Value: Inventory Item Slot
Item: Picked Unit
Unit Group - Pick each unit in (All items carried by (Unit 1 from PlayerHero 1-9[Picked Player])) and do (Actions)
General - Switch (Actions) depending on (Inventory Slot of (Picked unit))
General - If (36)
General - If (Conditions) then do (Actions) else do (Actions)
(Picked unit) == No Unit
Do some Jazz
Hm no i dont know the idexes i guess!?
I solved the problem by scanning the inventory first and saving which slots are occupied. then I move the item only if the slot is empty.