Squishy
You can change this now in User CP.
- Reaction score
- 127
I am currently working on an Inventory system that would add items picked up into bags. So far, I've only tried with one bag, and I can't get the triggers to work. Here are the triggers:
Whenever I pick up an item, then open the backpack, there are no item inside. Can anyone see why this wouldn't be working?
Code:
Initialize Inventory
Events
Map initialization
Conditions
Actions
Hero - Create Backpack and give it to Mountain King 0001 <gen>
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
Set Inventory_Spot[(Integer A)] = No Item
Code:
Acquires Item
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Not equal to Close
(Item-type of (Item being manipulated)) Not equal to Backpack
Actions
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Inventory_Spot[(Integer A)] Equal to No Item
Then - Actions
Set Inventory_Spot[(Integer A)] = (Item-type of (Item being manipulated))
Item - Remove (Item being manipulated)
Skip remaining actions
Else - Actions
Code:
Open Backpack
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to Backpack
Actions
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
Hero - Create Close and give it to (Triggering unit)
Unit - Order (Triggering unit) to move (Last created item) to inventory slot 6
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Inventory_Spot[(Integer A)] Not equal to No Item
Then - Actions
Hero - Create Inventory_Spot[(Integer A)] and give it to (Triggering unit)
Else - Actions
Code:
Close
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to Close
Actions
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
Hero - Create Backpack and give it to (Triggering unit)