woot
New Member
- Reaction score
- 8
Personal Stash Tutorial
A stash is a unit that can store items for your hero if your hero's inventory is full. You just put the items in the stash and it will hold them for you. Many custom games have these stashes, 1 for each player scattered around the "base" or "town" area of the board.
This tutorial will show you how to create a personal stash: A single stash that is viewable by everyone playing, but is actually many stashes each accessible by a single player's hero.
Points:
- Uses a treasure chest model that opens and closes.
- One visible stash for all players that actually disguises many stashes, 1 stash for each player.
- The stash opens and closes on select. (The opening and closing will only be seen by the player who selects the stash)
Requirements:
- Stash model: Fill-Me-Up Treasure chest: http://www.hiveworkshop.com/forums/resource.php?t=50672
- Players must not be able to see invis units in the area that the stash will be (including invisible allied units .. so allies must not have shared vision)
A demo map is attached.
Process:
Object Manager:
- Import the Fill-Me-Up Treasure Chest model
- Create a new custom unit named Stash (I based it off footman.. setting the movement type to none and speed to 0, and the attacks allowed to none)
- Make sure the custom unit's collision size is 0
- Give the Stash the imported model
- Give the stash the Ghost ability, the Inventory (Hero) ability, and Invulnerability (Neutral) .. The ghost ability is so that each player can only see their own stash. The inventory ability allows you to store items.
- Copy the stash and paste it .. creating a new stash object
- Set the suffix of this new stash object to (Locust)
- Remove the ghost ability from the new stash object.. and add the Locust ability. Locust makes the new stash untargetable, and removing ghost makes it visible to all players
- Create a small square shaped region on the board where you want the stash to be located. name it Stash.
- Create a global Unit variable in your triggers named Stash
- Create a global location variable named tempPoint
- Create a global player variable named tempPlayer
Now for the triggers:
Initialization: Create the stashes for each player (invisible) and a dummy stash for neutral passive (visible, locust for untargetable):
On Select: Display the open animation for the stash to the player, and the opening animation for the locust stash for the local player (displaying it to only the player who opened the stash)
On Deselect: Display the close animation for the player's stash, and locally for the dummy's stash
That's it! You're done!
Optional Stuff
You can also create an information ability and give it to your stash so players know what the stash is all about.
- Base the ability off of Devotion Aura (Neutral Hostile) .. call it Stash Information
- Change the icon to Box (under Extra)
- Change the Art Icon X position to 3 and the Y position to 2
- Change the Art (Target) to nothing
- Change the armor bonus to 0
- Change the area effect to 0
- Change the buffs to nothing
- Make sure Hero Ability is false
- Make sure Levels is 1
- Set Targets Allowed to None
- Under Tooltip Normal put "Stash Information"
- Under Tooltip Extended put a description of what a stash is.. From my demo map: "The Stash is your hero's personal place to store items if his/her inventory is full.|nOther players cannot access your stash."
- Give your stash this ability
Done!
Remember: For this to work properly players must not be able to see invisible in the area that the stash is located (including invisible allied units)
Enjoy! Comments are appreciated!
A stash is a unit that can store items for your hero if your hero's inventory is full. You just put the items in the stash and it will hold them for you. Many custom games have these stashes, 1 for each player scattered around the "base" or "town" area of the board.
This tutorial will show you how to create a personal stash: A single stash that is viewable by everyone playing, but is actually many stashes each accessible by a single player's hero.
Points:
- Uses a treasure chest model that opens and closes.
- One visible stash for all players that actually disguises many stashes, 1 stash for each player.
- The stash opens and closes on select. (The opening and closing will only be seen by the player who selects the stash)
Requirements:
- Stash model: Fill-Me-Up Treasure chest: http://www.hiveworkshop.com/forums/resource.php?t=50672
- Players must not be able to see invis units in the area that the stash will be (including invisible allied units .. so allies must not have shared vision)
A demo map is attached.
Process:
Object Manager:
- Import the Fill-Me-Up Treasure Chest model
- Create a new custom unit named Stash (I based it off footman.. setting the movement type to none and speed to 0, and the attacks allowed to none)
- Make sure the custom unit's collision size is 0
- Give the Stash the imported model
- Give the stash the Ghost ability, the Inventory (Hero) ability, and Invulnerability (Neutral) .. The ghost ability is so that each player can only see their own stash. The inventory ability allows you to store items.
- Copy the stash and paste it .. creating a new stash object
- Set the suffix of this new stash object to (Locust)
- Remove the ghost ability from the new stash object.. and add the Locust ability. Locust makes the new stash untargetable, and removing ghost makes it visible to all players
- Create a small square shaped region on the board where you want the stash to be located. name it Stash.
- Create a global Unit variable in your triggers named Stash
- Create a global location variable named tempPoint
- Create a global player variable named tempPlayer
Now for the triggers:
Initialization: Create the stashes for each player (invisible) and a dummy stash for neutral passive (visible, locust for untargetable):
Code:
Initialize
Events
Map initialization
Conditions
Actions
-------- NECESSARY CODE --------
Set tempPoint = (Center of Stash <gen>)
-------- Create the dummy (locust) stash visible to all but selectable by none --------
Unit - Create 1 Stash (Locust) for Neutral Passive at tempPoint facing 270.00 degrees
Set Stash = (Last created unit)
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
-------- Create a stash for each player, visible by only that player --------
Unit - Create 1 Stash for (Picked player) at tempPoint facing 270.00 degrees
Custom script: call RemoveLocation(udg_tempPoint)
On Select: Display the open animation for the stash to the player, and the opening animation for the locust stash for the local player (displaying it to only the player who opened the stash)
Code:
Selection
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Player - Player 5 (Yellow) Selects a unit
Player - Player 6 (Orange) Selects a unit
Player - Player 7 (Green) Selects a unit
Player - Player 8 (Pink) Selects a unit
Player - Player 9 (Gray) Selects a unit
Player - Player 10 (Light Blue) Selects a unit
Player - Player 11 (Dark Green) Selects a unit
Player - Player 12 (Brown) Selects a unit
Conditions
Actions
-------- GetLocalPlayer() gets which player is running on the local computer --------
Custom script: set udg_tempPlayer = GetLocalPlayer()
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Stash
Then - Actions
-------- Open the player's stash --------
Animation - Play (Triggering unit)'s Morph animation
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to tempPlayer
Then - Actions
-------- Open the local dummy stash --------
Animation - Play Stash's Morph animation
Else - Actions
Else - Actions
On Deselect: Display the close animation for the player's stash, and locally for the dummy's stash
Code:
Deselection
Events
Player - Player 1 (Red) Deselects a unit
Player - Player 2 (Blue) Deselects a unit
Player - Player 3 (Teal) Deselects a unit
Player - Player 4 (Purple) Deselects a unit
Player - Player 5 (Yellow) Deselects a unit
Player - Player 6 (Orange) Deselects a unit
Player - Player 7 (Green) Deselects a unit
Player - Player 8 (Pink) Deselects a unit
Player - Player 9 (Gray) Deselects a unit
Player - Player 10 (Light Blue) Deselects a unit
Player - Player 11 (Dark Green) Deselects a unit
Player - Player 12 (Brown) Deselects a unit
Conditions
Actions
-------- GetLocalPlayer() gets which player is running on the local computer --------
Custom script: set udg_tempPlayer = GetLocalPlayer()
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Stash
Then - Actions
-------- Close the player's stash --------
Animation - Play (Triggering unit)'s Morph Alternate animation
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to tempPlayer
Then - Actions
-------- Close the local dummy stash --------
Animation - Play Stash's Morph Alternate animation
Else - Actions
Else - Actions
That's it! You're done!
Optional Stuff
You can also create an information ability and give it to your stash so players know what the stash is all about.
- Base the ability off of Devotion Aura (Neutral Hostile) .. call it Stash Information
- Change the icon to Box (under Extra)
- Change the Art Icon X position to 3 and the Y position to 2
- Change the Art (Target) to nothing
- Change the armor bonus to 0
- Change the area effect to 0
- Change the buffs to nothing
- Make sure Hero Ability is false
- Make sure Levels is 1
- Set Targets Allowed to None
- Under Tooltip Normal put "Stash Information"
- Under Tooltip Extended put a description of what a stash is.. From my demo map: "The Stash is your hero's personal place to store items if his/her inventory is full.|nOther players cannot access your stash."
- Give your stash this ability
Done!
Remember: For this to work properly players must not be able to see invisible in the area that the stash is located (including invisible allied units)
Enjoy! Comments are appreciated!