| 08-18-2010, 08:58 PM | #1 |
I am trying to make a trigger that... when you have a unit enter a region, and stay within that region for "#" seconds (countdown timer), "A" actions occur when timer expires. If that unit leaves the region, the countdown timer is reset / wiped. I am making a "neutral building" in the middle of the map that is capturable by 2 players against each other. I am mostly confused about the "timer only ticks when unit STAYS in the region" part. Can someone please show me a simple setup (GUI)? Please help! |
| 08-18-2010, 10:51 PM | #2 |
post your own code (did you try it self?) |
| 08-20-2010, 12:21 AM | #3 |
| 08-20-2010, 02:53 PM | #4 |
There's an event that fires when a unit leaves a region. Make a trigger that is fired by that, and pause CAPtimer when that happens. Don't bother destroying it. It works fine to just start the timer again from a paused state (it will be just as if you've never used the timer before). |
| 08-20-2010, 10:16 PM | #5 | |
Quote:
oooooh ok, yeah i saw pause, but i didn't know that it works as a reset also, ill try it out now. ty |
| 08-20-2010, 10:56 PM | #6 |
Cool this basic trigger did the trick, thanks again for the help! (figured id post it just in case for other nubs like myself) |
| 08-21-2010, 01:13 AM | #7 |
It won't work correctly if a player can control multiple units. In that case, you would need a unit group to keep track of all the units in the region and only pause the timer once the last of them leaves. You'd probably also want to keep track of capturing units dying and remove them from the group in those cases as well. Furthermore, a unit from the other team entering the arena should also pause the timer. |
| 08-22-2010, 08:57 PM | #8 | |
Quote:
Ah I see what you are saying, actually I made the region smallest possible (literally only 1 unit can fit on it) and the 2 teams vying for it have no air units. I set up a sequence of switches that turn on / off triggers for each side, with their own timers, depending on who occupies the captured area ![]() |
