- Joined
- Dec 9, 2014
- Messages
- 176
So I have a simple bag system that involves hero units with a chest model that can't move or attack and is invulnerable and uses their inventory as sort of a backpack. The ability "Open Backpack" simply moves the backpack to the character and changes it's ownership from Neutral Passive to Red, allowing the player to use the backpack as need for items. It works fine as it is currently, but the problem is "closing" the backpack.
I decided to designate an area of the map the player will never see as sort of a holding area for the backpack bags when they are not "open". I tried to make it so that when the player opens the backpack the bag is moved to where the player is and so is a region moved and centered on the player. When the player leaves the region (assuming they are done with the backpack) the bags should then be changed back to the ownership of Neutral Hostile and moved back to their holding area. So far I haven't been able to get this to work. Any help would be much appreciated!
I decided to designate an area of the map the player will never see as sort of a holding area for the backpack bags when they are not "open". I tried to make it so that when the player opens the backpack the bag is moved to where the player is and so is a region moved and centered on the player. When the player leaves the region (assuming they are done with the backpack) the bags should then be changed back to the ownership of Neutral Hostile and moved back to their holding area. So far I haven't been able to get this to work. Any help would be much appreciated!
-
Summon Stash
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Open Backpack (New)
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Open Backpack (New) for (Triggering unit)) Equal to 1
-
-
Then - Actions
-
Unit - Move Bag 1 0150 <gen> instantly to (Center of (Region centered at (Position of (Triggering unit)) with size (300.00, 300.00))), facing (Facing of (Triggering unit)) degrees
-
Unit - Change ownership of Bag 1 0150 <gen> to Player 1 (Red) and Retain color
-
Wait 0.10 seconds
-
Region - Center Close Backpack <gen> on (Position of Bag 1 0150 <gen>)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Open Backpack (New) for (Triggering unit)) Equal to 2
-
-
Then - Actions
-
Unit - Move Bag 1 0150 <gen> instantly to (Center of (Region centered at (Position of (Triggering unit)) with size (100.00, 100.00))), facing (Facing of (Triggering unit)) degrees
-
Unit - Change ownership of Bag 1 0150 <gen> to Player 1 (Red) and Retain color
-
Unit - Move Bag 2 0151 <gen> instantly to (Center of (Region centered at (Position of (Triggering unit)) with size (100.00, 100.00))), facing (Facing of (Triggering unit)) degrees
-
Unit - Change ownership of Bag 2 0151 <gen> to Player 1 (Red) and Retain color
-
Wait 0.10 seconds
-
Region - Center Close Backpack <gen> on (Position of Bag 1 0150 <gen>)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Open Backpack (New) for (Triggering unit)) Equal to 3
-
-
Then - Actions
-
Unit - Move Bag 1 0150 <gen> instantly to (Center of (Region centered at (Position of (Triggering unit)) with size (100.00, 100.00))), facing (Facing of (Triggering unit)) degrees
-
Unit - Change ownership of Bag 1 0150 <gen> to Player 1 (Red) and Retain color
-
Unit - Move Bag 2 0151 <gen> instantly to (Center of (Region centered at (Position of (Triggering unit)) with size (100.00, 100.00))), facing (Facing of (Triggering unit)) degrees
-
Unit - Change ownership of Bag 2 0151 <gen> to Player 1 (Red) and Retain color
-
Unit - Move Bag 3 0152 <gen> instantly to (Center of (Region centered at (Position of (Triggering unit)) with size (100.00, 100.00))), facing (Facing of (Triggering unit)) degrees
-
Unit - Change ownership of Bag 3 0152 <gen> to Player 1 (Red) and Retain color
-
-
Else - Actions
-
-
-
-
Return Stash
-
Events
-
Unit - A unit leaves Close Backpack <gen>
-
-
Conditions
-
(Owner of (Triggering unit)) Equal to Player 1 (Red)
-
((Triggering unit) is A Hero) Equal to True
-
-
Actions
-
Wait 0.10 seconds
-
Unit - Change ownership of Bag 1 0150 <gen> to Neutral Passive and Retain color
-
Unit - Change ownership of Bag 2 0151 <gen> to Neutral Passive and Retain color
-
Unit - Change ownership of Bag 3 0152 <gen> to Neutral Passive and Retain color
-
Unit - Change ownership of Bag 4 0153 <gen> to Neutral Passive and Retain color
-
Unit - Change ownership of Bag 5 0149 <gen> to Neutral Passive and Retain color
-
Unit - Change ownership of Bag 6 0154 <gen> to Neutral Passive and Retain color
-
Unit - Move Bag 1 0150 <gen> instantly to (Center of Backpack Home <gen>)
-
Unit - Move Bag 2 0151 <gen> instantly to (Center of Backpack Home <gen>)
-
Unit - Move Bag 3 0152 <gen> instantly to (Center of Backpack Home <gen>)
-
Unit - Move Bag 4 0153 <gen> instantly to (Center of Backpack Home <gen>)
-
Unit - Move Bag 5 0149 <gen> instantly to (Center of Backpack Home <gen>)
-
Unit - Move Bag 6 0154 <gen> instantly to (Center of Backpack Home <gen>)
-
Wait 0.10 seconds
-
Region - Center Close Backpack <gen> on (Center of Close Backpack Home <gen>)
-
-
-
Level Up Stash
-
Events
-
Unit - A unit Gains a level
-
-
Conditions
-
(Owner of (Triggering unit)) Equal to Player 1 (Red)
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Hero level of (Triggering unit)) Equal to 10
-
-
Then - Actions
-
Unit - Set level of Open Backpack (New) for (Triggering unit) to 2
-
Game - Display to Player Group - Player 1 (Red) the text: |cffffcc00Your Back...
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Hero level of (Triggering unit)) Equal to 20
-
-
Then - Actions
-
Unit - Set level of Open Backpack (New) for (Triggering unit) to 3
-
Game - Display to Player Group - Player 1 (Red) the text: |cffffcc00Your Back...
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Hero level of (Triggering unit)) Equal to 30
-
-
Then - Actions
-
Unit - Set level of Open Backpack (New) for (Triggering unit) to 4
-
Game - Display to Player Group - Player 1 (Red) the text: |cffffcc00Your Back...
-
-
Else - Actions
-
-
-