Nah, death counters do not require you to blow a building up.
Once you get used to them they are fairly easy to use, heres a way you can do it via a timer.
Trigger("Player 1"){
Conditions:
Command("Current Player", "Terran Barracks", At least, 1);
Deaths("Current Player", "Alan Schezar (Goliath)", Exactly, 0);
Deaths("Current Player", "Alan Turret", Exactly, 0);
Actions:
Set Deaths("Current Player", "Alan Schezar (Goliath)", Set To, 96);
Set Deaths("Current Player", "Alan Turret", Set To, 1);
Preserve Trigger();
}
Command("Current Player", "Terran Barracks", At least, 1);
This line states that the current player MUST own this building in order to receive the minerals.
Deaths("Current Player", "Alan Schezar (Goliath)", Exactly, 0);
This line is going to be used for our countdown timer, at this time it needs to be 0
Deaths("Current Player", "Alan Turret", Exactly, 0);
This line is like a placement holder, it makes sure the trigger does not repeat until the allotted time.
Set Deaths("Current Player", "Alan Schezar (Goliath)", Set To, 96);
Now that we have the conditions met, we have to start the timer. That is what this is for, 96 deaths is approximately 10 seconds.
Set Deaths("Current Player", "Alan Turret", Set To, 1);
Now we have to set this to hold the place, just to make sure the trigger does not keep setting the timer to 10 seconds over and over, not allowing for it to countdown.
Okay, so now we have the starting of our trigger, the initial countdown timer and now we have to make it countdown
Trigger("Player 1"){
Conditions:
Deaths("Current Player", "Alan Schezar (Goliath)", At least, 1);
Actions:
Set Deaths("Current Player", "Alan Schezar (Goliath)", Subtract, 1);
Preserve Trigger();
}
This is the trigger for making it countdown.
Deaths("Current Player", "Alan Schezar (Goliath)", At least, 1);
This line states that if the current player has suffered a death of at least 1 of the countdown timer to do the following:
Set Deaths("Current Player", "Alan Schezar (Goliath)", Subtract, 1);
This is the part that makes it countdown, because we are subtracting 1 death of the 96.
Now that we've made it countdown we need to make it award the minerals after 10 seconds.
Trigger("Player 1"){
Conditions:
Deaths("Current Player", "Alan Schezar (Goliath)", Exactly, 0);
Deaths("Current Player", "Alan Turret", Exactly, 1);
Command("Current Player", "Terran Barracks", At least, 1);
Actions:
Set Deaths("Current Player", "Alan Turret", Set To, 0);
Set Resources("Current Player", Add, 50, ore);
Preserve Trigger();
}
This is the trigger to award the minerals after the allotted time.
Deaths("Current Player", "Alan Schezar (Goliath)", Exactly, 0);
This lane states that the countdown must reach 0 of 96
Deaths("Current Player", "Alan Turret", Exactly, 1);
Remember the place holder? It must be at 1 to activate the following:
Command("Current Player", "Terran Barracks", At least, 1);[/code]
This is to make sure that they still have the Barracks before awarding them.
[quote]
Set Deaths("Current Player", "Alan Turret", Set To, 0);
We need to clear the place holder in order to repeat the timer
(If you only want it to happen once you can merely change it to
Set Deaths("Current Player", "Alan Turret", Set To, 2);
And this will ensure that it wont run again, because the starting trigger requires a 0.
Set Resources("Current Player", Add, 50, ore and gas);
And finally we have the awarded minerals
Any questions let me know
Oh, you should also add this so that if they lose their building that it stops the awarding of minerals.
Trigger("Player 1"){
Conditions:
Command("Current Player", "Terran Barracks", Exactly, 0);
Actions:
Set Deaths("Current Player", "Alan Schezar (Goliath)", Set To, 0);
Set Deaths("Current Player", "Alan Turret", Set To, 0);
Preserve Trigger();
}
And finally, the last but not least thing is Hypertriggers. In order for deathcounters to work efficiently you MUST use these. With that being said, you can no longer use Waits in your triggers or your map will glitch.
To do a Hypertrigger simply make a trigger that looks like this
Trigger("Player 1"){
Conditions:
Always();
Actions:
Wait(0);
Preserve Trigger();
And copy the preserve 62 times (Or 63 if you don't plan on using comments, which in this case it would be really bad not to
) and then copy the whole trigger about three times.
There is an example map attached
Attachments:
Post has been edited 5 time(s), last time on Mar 3 2010, 2:35 pm by Oo.DaMeiN.oO.
None.