Hello SC2 Community, Im making a new TD map right now and im having troubles with a certain trigger. The map will support up to 8 players but it will be functionals with any number of players ranging from 1-8. Im choosing to give the map shared minerals since minerals per kill causes expert player to leave every other player defenseless and not getting any kills at all making the map less enjoyable for less experienced players. Im stuck trying to make a system that will divide all minerals gained equally between all player playing. In my past TD maps ive simply done
Event:
Any Unit Dies
Condition:
Owner Of Triggering Unit=7 or 8 (computer players)
Actions:
Give 1 Mineral To Player 1
Give 1 Mineral To Player 2
(etc)
Thats Not the exact wording from the trigger editor but u get the point. Either way this will not work in my current map since The fewer players are playing the less total minerals will go around. If anyone knows anything that could help me i would appreciate all the help i can get Thx!!!
Try to use the Active Players, player group. Each time anyone score a kill, add x minerals to a variable and share that among all currently active players. If it's an un-even amount, keep part of it in the pot until the next kill.
Example:
3 players are active (playing)
A mob is killed that gives the team 14 minerals
Each player receives 4 minerals, 2 are left in the pot.
Another mob is killed (14 minerals)
Each player receives 5 minerals, 1 remains in the pot.
@Berrala: GoThanks alot for this solution. I was think of doing something similar to this myself. I was thinking give all minerals to a neutral play then have a trigger that says
Event:
Any Unit Is Killed
Condition:
Player 9 Has Minerals =>8
Action:
Give 1 mineral to each active player (will be expressed as a repeating if then else statement to confirm active or not)
That way once the player has more than 8 minerals it will give 1 to each active player and if only 3 people are playing then the computer will keep the other 5 minerals and give them out again once his minerls reach more than 8
Yup, that's what I was thinking, except you don't really need a new player just to store a mineral amount. You probably already finished the triggers for this, but it's fun to play around with, so I made one myself.
I'm using the mineral cost of a unit to avoid having to define variables for each wave / unit. It's not the best for easy overview compared to having a trigger defining each wave... I guess it's not really easier my way either since you still have to modify each cost in the data editor. Well it was really easy to use in my example since I haven't defined anything anywhere. ;-)
@Berrala: GoThx so much for this. I havent actually put together the trigger for this yet in hopes that someone would answer my plea for a better functioning trigger and what you have provided me with appears to be the perfect solution for my task at hand. Im probably going to implement this new trigger tonight before i go to bed so i dont forget and i will definatley be putting your name in the credits. (Please PM me if you do not want your name disclosed on my map though). Hopefully this new TD will end up better than expected and hopefully it will be released soon. Im only having troubles with the upgrades now cuz im unsure how to make custom upgrades and i havent a clue how to modify upgrade cost....
<<reply 172560>>Hello again...i seem to be having a problem with this trigger...im testing it as a single player againt units that give 1 minerals each (to 8 players) and therefore expecting 8 minerals to come to me since theres only 1 player and its only giving me 2-3 minerals each time i make a kill...i cant for the life of me figure out why its not working...any help would be appreciated right now i have
Kill Cash
Events
Unit - Any Unit dies
Local Variables
Conditions
(Owner of (Triggering unit)) == 9
Actions
Variable - Modify The "Pot": + 8
and
Shared Minerals
Events
Unit - Any Unit dies
Local Variables
Conditions
The "Pot" >= (Number of players in (Active Players))
(Owner of (Triggering unit)) == 9
Actions
General - While (Conditions) are true, do (Actions)
Conditions
The "Pot" >= (Number of players in (Active Players))
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Player - Modify player (Picked player) Minerals: Add 1
Variable - Modify The "Pot": - 1
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello SC2 Community, Im making a new TD map right now and im having troubles with a certain trigger. The map will support up to 8 players but it will be functionals with any number of players ranging from 1-8. Im choosing to give the map shared minerals since minerals per kill causes expert player to leave every other player defenseless and not getting any kills at all making the map less enjoyable for less experienced players. Im stuck trying to make a system that will divide all minerals gained equally between all player playing. In my past TD maps ive simply done
Event: Any Unit Dies Condition: Owner Of Triggering Unit=7 or 8 (computer players) Actions: Give 1 Mineral To Player 1 Give 1 Mineral To Player 2 (etc)
Thats Not the exact wording from the trigger editor but u get the point. Either way this will not work in my current map since The fewer players are playing the less total minerals will go around. If anyone knows anything that could help me i would appreciate all the help i can get Thx!!!
Try to use the Active Players, player group. Each time anyone score a kill, add x minerals to a variable and share that among all currently active players. If it's an un-even amount, keep part of it in the pot until the next kill.
Example:
3 players are active (playing)
A mob is killed that gives the team 14 minerals
Each player receives 4 minerals, 2 are left in the pot.
Another mob is killed (14 minerals)
Each player receives 5 minerals, 1 remains in the pot.
@Berrala: GoThanks alot for this solution. I was think of doing something similar to this myself. I was thinking give all minerals to a neutral play then have a trigger that says Event: Any Unit Is Killed Condition: Player 9 Has Minerals =>8 Action: Give 1 mineral to each active player (will be expressed as a repeating if then else statement to confirm active or not)
That way once the player has more than 8 minerals it will give 1 to each active player and if only 3 people are playing then the computer will keep the other 5 minerals and give them out again once his minerls reach more than 8
Yup, that's what I was thinking, except you don't really need a new player just to store a mineral amount. You probably already finished the triggers for this, but it's fun to play around with, so I made one myself.
I'm using the mineral cost of a unit to avoid having to define variables for each wave / unit. It's not the best for easy overview compared to having a trigger defining each wave... I guess it's not really easier my way either since you still have to modify each cost in the data editor. Well it was really easy to use in my example since I haven't defined anything anywhere. ;-)
@Berrala: GoThx so much for this. I havent actually put together the trigger for this yet in hopes that someone would answer my plea for a better functioning trigger and what you have provided me with appears to be the perfect solution for my task at hand. Im probably going to implement this new trigger tonight before i go to bed so i dont forget and i will definatley be putting your name in the credits. (Please PM me if you do not want your name disclosed on my map though). Hopefully this new TD will end up better than expected and hopefully it will be released soon. Im only having troubles with the upgrades now cuz im unsure how to make custom upgrades and i havent a clue how to modify upgrade cost....
<<reply 172560>>Hello again...i seem to be having a problem with this trigger...im testing it as a single player againt units that give 1 minerals each (to 8 players) and therefore expecting 8 minerals to come to me since theres only 1 player and its only giving me 2-3 minerals each time i make a kill...i cant for the life of me figure out why its not working...any help would be appreciated right now i have
Kill Cash
Events
Unit - Any Unit dies
Local Variables
Conditions
(Owner of (Triggering unit)) == 9
Actions
Variable - Modify The "Pot": + 8
and
Shared Minerals
Events
Unit - Any Unit dies
Local Variables
Conditions
The "Pot" >= (Number of players in (Active Players))
(Owner of (Triggering unit)) == 9
Actions
General - While (Conditions) are true, do (Actions)
Conditions
The "Pot" >= (Number of players in (Active Players))
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Player - Modify player (Picked player) Minerals: Add 1
Variable - Modify The "Pot": - 1