- Joined
- Apr 1, 2009
- Messages
- 201
I created a trigger for my inventory system and am having trouble with the conditions. My inventory system is where you get items from killing units and those items are placed in a player specific region, known as there inventory. The inventory is broken up into 2 regions, one is your regular inventory and the other half is your safe inventory in a sense. The reason for two regions is so you can sell items in one region and keep the ones you want in another when they build up. Each player has 2 inventory regions. What I'm trying to do is make a trigger where items can be moved to and from one of the regions only by the player that owns the inventory. Right now I'm making the trigger to send items to the inventory, then I will build off of that to take items out of the inventory. I think the problem is with the conditions. I'm trying to figure out how to make items that are dropped move into the inventory. The conditions are the item has to be yours, not in another players inventory, and not in the region you are trying to move it to. The problem is items can be moved from any players inventory and any not owned item on the ground.
-
Setup
-
Events
- Map initialization
- Conditions
-
Actions
-
Player Group - Pick every player in (All allies of Player 9 (Gray)) and do (Actions)
-
Loop - Actions
- Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Inventory Region <gen>
-
Loop - Actions
- -------- Player and Player's Inventory --------
- Set PlayerGroupOne[1] = Player 1 (Red)
- Set PlayerInventory[1] = Player 1 Inventory <gen>
- Set PlayerGroupOne[2] = Player 2 (Blue)
- Set PlayerInventory[2] = Player 2 Inventory <gen>
- Set PlayerGroupOne[3] = Player 3 (Teal)
- Set PlayerInventory[3] = Player 3 Inventory <gen>
- Set PlayerGroupOne[4] = Player 4 (Purple)
- Set PlayerInventory[4] = Player 4 Inventory <gen>
- Set PlayerGroupOne[5] = Player 5 (Yellow)
- Set PlayerInventory[5] = Player 5 Inventory <gen>
- Set PlayerGroupOne[6] = Player 6 (Orange)
- Set PlayerInventory[6] = Player 6 Inventory <gen>
- Set PlayerGroupOne[7] = Player 7 (Green)
- Set PlayerInventory[7] = Player 7 Inventory <gen>
- Set PlayerGroupOne[8] = Player 8 (Pink)
- Set PlayerInventory[8] = Player 8 Inventory <gen>
- -------- Player and Player's Safe Inventory --------
- Set PlayerGroupTwo[1] = Player 1 (Red)
- Set PlayerSafeInventory[1] = Player 1 Safe Inventory <gen>
- Set PlayerGroupTwo[2] = Player 2 (Blue)
- Set PlayerSafeInventory[2] = Player 2 Safe Inventory <gen>
- Set PlayerGroupTwo[3] = Player 3 (Teal)
- Set PlayerSafeInventory[3] = Player 3 Safe Inventory <gen>
- Set PlayerGroupTwo[4] = Player 4 (Purple)
- Set PlayerSafeInventory[4] = Player 4 Safe Inventory <gen>
- Set PlayerGroupTwo[5] = Player 5 (Yellow)
- Set PlayerSafeInventory[5] = Player 5 Safe Eventory <gen>
- Set PlayerGroupTwo[6] = Player 6 (Orange)
- Set PlayerSafeInventory[6] = Player 6 Safe Inventory <gen>
- Set PlayerGroupTwo[7] = Player 7 (Green)
- Set PlayerSafeInventory[7] = Player 7 Safe Inventory <gen>
- Set PlayerGroupTwo[8] = Player 8 (Pink)
- Set PlayerSafeInventory[8] = Player 8 Safe Inventory <gen>
-
Player Group - Pick every player in (All allies of Player 9 (Gray)) and do (Actions)
-
Events
-
Move To Inventory
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Move To Inventory [Y]
-
Actions
- Set DisplayForce = (Player group((Triggering player)))
- Set MoveItemCaster = (Owner of (Triggering unit))
-
For each (Integer MoveToInvenInt) from 1 to 8, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- CustomValueIO Equal to 0
- MoveItemCaster Equal to PlayerGroupOne[MoveToInvenInt]
- MoveItemCaster Equal to PlayerGroupTwo[MoveToInvenInt]
-
Or - Any (Conditions) are true
-
Conditions
- ((Target item of ability being cast) is in PlayerInventory[MoveToInvenInt]) Equal to False
- ((Target item of ability being cast) is in PlayerSafeInventory[MoveToInvenInt]) Equal to True
-
Conditions
-
Then - Actions
- Set PlayerInventoryRegion = (Center of PlayerInventory[MoveToInvenInt])
- Item - Move (Target item of ability being cast) to PlayerInventoryRegion
- Custom script: call RemoveLocation(udg_PlayerInventoryRegion)
-
Else - Actions
- Game - Display to DisplayForce the text: Invalid Item
- Custom script: call DestroyForce(udg_DisplayForce)
- Skip remaining actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Events
Last edited: