Im having a little bit of difficulty getting bounty to work properly. I followed one-twos tutorial on Zerg Invasion and in it he sets up triggers for a text tag to appear when a unit dies. I think the issue is that since beta (when he did his tutorials) the kill resource bonus shows as well so I end up with two sets of numbers when I kill a unit. One is from the inherent kill resource cost and that comes up as blue and the other is from the text tag which comes up based on triggers. Ideally I would just like one bounty to show in the killing players color. Will this require setting up several variables or is there an elegant solution?
I think you need to not have a kill resource bonus on the unit and just use a trigger to reward the player, and place the text if it needs to be in the players color.
Thanks for the advice. I changed bounty to run off of triggers and it seems to work accurately. For the benefit of those who may try the same thing I'll share how I set it up. If anyone can think of a way to simplify it as well I'm open to improvement.
I created a local variable called "bounty" (integer)
With each unit death an If-Then-Else is run to verify the unit and sets the appropriate value for "bounty"
A text tag is created combining a + and the value of "bounty" set to the killing players color.
Killing players resource is increased by the value of "bounty"
I'm sure this is a commonly used trigger but I havent seen it on the boards so figured I'd toss it up.
All you have to do is add the kill resource to the unit.
The game handles the rest it even gives the player a "+1" in the ui over the dying units head.
The color is based off of the resource Type is my understanding of the text color.... why would you want to change this. Since it only shows for the player that is recieving the kill award.
Thanks for the advice. I changed bounty to run off of triggers and it seems to work accurately. For the benefit of those who may try the same thing I'll share how I set it up. If anyone can think of a way to simplify it as well I'm open to improvement.
I created a local variable called "bounty" (integer)
With each unit death an If-Then-Else is run to verify the unit and sets the appropriate value for "bounty"
A text tag is created combining a + and the value of "bounty" set to the killing players color.
Killing players resource is increased by the value of "bounty"
I'm sure this is a commonly used trigger but I havent seen it on the boards so figured I'd toss it up.
I know this is old but I wondered if you can type out the trigger here. I am not too handy yet with the GE.
Actions
Variable - Modify Player Kills[(Killing player)]: + 1
General - If (Conditions) then do (Actions) else do (Actions)
If
(Unit type of (Triggering unit)) == Zerglet
Then
Variable - Set Bounty = 2
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Unit type of (Triggering unit)) == Hydralisk
Then
Variable - Set Bounty = 10
Else
Text Tag - Create a text tag with the text ("+" + (Text(Bounty))) for (All players), using a font size of 24, at (Position of (Triggering unit)) and height offset 0.0, initially Visible, and fog of war enforcement set to false
Text Tag - Set the velocity of (Last created text tag) to 1.0 coordinates per second at an angle of 90.0 degrees from horizontal
Text Tag - Set Text color(s) for (Last created text tag) to (Color((Current player (Killing player) color)))
Text Tag - Set Duration time for (Last created text tag) to 3.0 seconds
Player - Modify player (Killing player) Minerals: Add Bounty
Leaderboard - Set Leaderboard item text at column 2 and row ((Killing player) + 1) to (Text(Player Kills[(Killing player)]))
Let me try to break this down so it makes sense. When a unit belonging to player 15 dies (in this case player 15 was the computer enemy) this trigger runs. The local variable I called bounty and the reason it is a local variable is because it is going to change up with every enemy unit death and apply to the killing players resources
.
I also was keeping track of player kills which is referenced in the last line.
In this map I was just testing two unit types, zerglets (I renamed zerglings for some reason) and hydralisks. When either of these units dies they set the variable bounty to 2 or 10 respectively.
What happens next is a text tag pops up over a unit that dies. The + in quotations is combined with the bounty value depending on the unit that was killed. So if a zerglet was killed the text tag would read "+ 2" and if a hydralisk was killed it would read "+10". The color of the text is set to the color of the killing player so everyone can see who killed each unit. The bounty variable is then rewarded as the resource of your choice (in this case minerals) to the killing player.
That last line is just set up for the leaderboard which is outside of this trigger but modified as players get kills.
Im having a little bit of difficulty getting bounty to work properly. I followed one-twos tutorial on Zerg Invasion and in it he sets up triggers for a text tag to appear when a unit dies. I think the issue is that since beta (when he did his tutorials) the kill resource bonus shows as well so I end up with two sets of numbers when I kill a unit. One is from the inherent kill resource cost and that comes up as blue and the other is from the text tag which comes up based on triggers. Ideally I would just like one bounty to show in the killing players color. Will this require setting up several variables or is there an elegant solution?
@BayushiNezumi: Go
I think you need to not have a kill resource bonus on the unit and just use a trigger to reward the player, and place the text if it needs to be in the players color.
Thanks for the advice. I changed bounty to run off of triggers and it seems to work accurately. For the benefit of those who may try the same thing I'll share how I set it up. If anyone can think of a way to simplify it as well I'm open to improvement.
I created a local variable called "bounty" (integer)
With each unit death an If-Then-Else is run to verify the unit and sets the appropriate value for "bounty"
A text tag is created combining a + and the value of "bounty" set to the killing players color.
Killing players resource is increased by the value of "bounty"
I'm sure this is a commonly used trigger but I havent seen it on the boards so figured I'd toss it up.
@BayushiNezumi: Go
All you have to do is add the kill resource to the unit.
The game handles the rest it even gives the player a "+1" in the ui over the dying units head.
The color is based off of the resource Type is my understanding of the text color.... why would you want to change this. Since it only shows for the player that is recieving the kill award.
Adding color to the bounty lets players see which player got the kill as the text can display for all players.
I know this is old but I wondered if you can type out the trigger here. I am not too handy yet with the GE.
Enemy Unit Dies Events Unit - Any Unit dies
Local Variables Bounty = 0 <Integer>
Conditions (Owner of (Triggering unit)) == 15
Actions Variable - Modify Player Kills[(Killing player)]: + 1
General - If (Conditions) then do (Actions) else do (Actions) If (Unit type of (Triggering unit)) == Zerglet Then Variable - Set Bounty = 2 Else
General - If (Conditions) then do (Actions) else do (Actions) If (Unit type of (Triggering unit)) == Hydralisk Then Variable - Set Bounty = 10 Else
Text Tag - Create a text tag with the text ("+" + (Text(Bounty))) for (All players), using a font size of 24, at (Position of (Triggering unit)) and height offset 0.0, initially Visible, and fog of war enforcement set to false
Text Tag - Set the velocity of (Last created text tag) to 1.0 coordinates per second at an angle of 90.0 degrees from horizontal
Text Tag - Set Text color(s) for (Last created text tag) to (Color((Current player (Killing player) color)))
Text Tag - Set Duration time for (Last created text tag) to 3.0 seconds
Player - Modify player (Killing player) Minerals: Add Bounty
Leaderboard - Set Leaderboard item text at column 2 and row ((Killing player) + 1) to (Text(Player Kills[(Killing player)]))
Let me try to break this down so it makes sense. When a unit belonging to player 15 dies (in this case player 15 was the computer enemy) this trigger runs. The local variable I called bounty and the reason it is a local variable is because it is going to change up with every enemy unit death and apply to the killing players resources . I also was keeping track of player kills which is referenced in the last line.
In this map I was just testing two unit types, zerglets (I renamed zerglings for some reason) and hydralisks. When either of these units dies they set the variable bounty to 2 or 10 respectively.
What happens next is a text tag pops up over a unit that dies. The + in quotations is combined with the bounty value depending on the unit that was killed. So if a zerglet was killed the text tag would read "+ 2" and if a hydralisk was killed it would read "+10". The color of the text is set to the color of the killing player so everyone can see who killed each unit. The bounty variable is then rewarded as the resource of your choice (in this case minerals) to the killing player.
That last line is just set up for the leaderboard which is outside of this trigger but modified as players get kills.
Hope this helps