Hey, Ive been working on a sort of tug of war map meets dota meets tower defense map for a while and i really want team members to share the same economy. I cant seem to find a clean way for players to all see how much minerals the team has aswell as when they spend it.
One thing that might work, is when a player gets income like minerals, add that to a team counter pool. So you could have a UI box that dispalys team minerals: 0, and if 1 player gets 5 mins, 2 player gets 10, and 3 player gets 4, then team minerals: 19. Once those mineral values u get in income are added to that integer value in the UI box ull want to set player minerals to 0 so that you dont keep adding minerals to your integer value that you already added to it.Then go into triggers and write a trigger that basically removes a corresponding number from your UI box given the units costs whenever a player buys something, or whenever a button is hit to train something deduct the monetary amount and then make the unit for the player. Minerals are never actually spent. Your integer value in the UI box is just added too or subtracted from with the income and spending. So if your team has 19 resources in the UI box and a player spends 10 on a unit, then it will have 9. Obviously ull need conditions in there that must return true in that the integer in the UI box is greater than or equal to the unit your trying to buy. So again, nothing would actually cost any resources, your just modifying the integer value in your UI box given the income and spending you do. I know my answer as specific as it could be (i just came up with it off the top of my head in about 45 seconds), but hopefully youll get the idea and know what to do.
why dont you just make it so you set all of the player's resources the same as one player on the team, then just change it each time a player on the team spends it?
At the beginning of the game set all of the player's resources to whatever starting amount it is and if it changes just change everybody's minerals to the changed value
why dont you just make it so you set all of the player's resources the same as one player on the team, then just change it each time a player on the team spends it?
At the beginning of the game set all of the player's resources to whatever starting amount it is and if it changes just change everybody's minerals to the changed value
Without testing with multiple players, I don't know if that would work. Is what you're suggesting something like this:
Player 1 Minerals changes => Set Player 2 minerals = player 1 minerals
(2nd trigger)
Player 2 Minerals changes => Set player 1 minerals = player 2 minerals
If you do that, then trigger #2 might react to trigger #1's action, and then trigger 1 would react to trigger 2's action, so they'd go back and forth endlessly.
You can turn share spending on, that may help. (its like when a player leaves a melee and you can use his buildings with your mineral)
Player - Turn player 1 Resource Spending On towards player 2
otherwise use:
Events
Player - Player 1 Minerals changes
Player - Player 2 Minerals changes ... (use this event for all players you want to share mineral)
Local Variables
Local minerals = 0 <Integer>
Conditions
Actions
Variable - Set Local minerals = (Player (Triggering player) Minerals)
Player Group - Pick each player in (Active Players or for the player you want to share income) and do (Actions)
Actions
Player - Modify player (Picked player) Minerals: Set To Local minerals
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey, Ive been working on a sort of tug of war map meets dota meets tower defense map for a while and i really want team members to share the same economy. I cant seem to find a clean way for players to all see how much minerals the team has aswell as when they spend it.
@kmerc101: Go
One thing that might work, is when a player gets income like minerals, add that to a team counter pool. So you could have a UI box that dispalys team minerals: 0, and if 1 player gets 5 mins, 2 player gets 10, and 3 player gets 4, then team minerals: 19. Once those mineral values u get in income are added to that integer value in the UI box ull want to set player minerals to 0 so that you dont keep adding minerals to your integer value that you already added to it.Then go into triggers and write a trigger that basically removes a corresponding number from your UI box given the units costs whenever a player buys something, or whenever a button is hit to train something deduct the monetary amount and then make the unit for the player. Minerals are never actually spent. Your integer value in the UI box is just added too or subtracted from with the income and spending. So if your team has 19 resources in the UI box and a player spends 10 on a unit, then it will have 9. Obviously ull need conditions in there that must return true in that the integer in the UI box is greater than or equal to the unit your trying to buy. So again, nothing would actually cost any resources, your just modifying the integer value in your UI box given the income and spending you do. I know my answer as specific as it could be (i just came up with it off the top of my head in about 45 seconds), but hopefully youll get the idea and know what to do.
@kmerc101: Go
why dont you just make it so you set all of the player's resources the same as one player on the team, then just change it each time a player on the team spends it?
At the beginning of the game set all of the player's resources to whatever starting amount it is and if it changes just change everybody's minerals to the changed value
Without testing with multiple players, I don't know if that would work. Is what you're suggesting something like this:
Player 1 Minerals changes => Set Player 2 minerals = player 1 minerals
(2nd trigger)
Player 2 Minerals changes => Set player 1 minerals = player 2 minerals
If you do that, then trigger #2 might react to trigger #1's action, and then trigger 1 would react to trigger 2's action, so they'd go back and forth endlessly.
You can turn share spending on, that may help. (its like when a player leaves a melee and you can use his buildings with your mineral)
Player - Turn player 1 Resource Spending On towards player 2
otherwise use:
Events
Player - Player 1 Minerals changes
Player - Player 2 Minerals changes ... (use this event for all players you want to share mineral)
Local Variables
Local minerals = 0 <Integer>
Conditions
Actions
Variable - Set Local minerals = (Player (Triggering player) Minerals)
Player Group - Pick each player in (Active Players or for the player you want to share income) and do (Actions)
Actions
Player - Modify player (Picked player) Minerals: Set To Local minerals