how would you kill a unit for standing on a location for to long. Would it be like the trigger in a bound?
Im pretty sure it is but not quite sure.
Bad but simple method of doing this would be:
Brings at least 1 unit to location.
Wait X miliseconds.
Kill unit at location.
Preserve.
Good method of doing this would be:
Brings at least 1 unit to location.
Modify score custom for Player Add 1.
Preserve.
Custom score is at least X.
Kill unit at location
Modify score custom for Player Set to 0.
Preserve.
Brings exactly 0 unit to location.
Modify score custom for Player Subtract 1.
Preserve.
You could do something like for every second the unit was on the location 1 was added to the players death count of some unit not used in the map, then say if they bring 1 whatever unit to location kill it.
(Better explanation below) This only will work if the player only has one of the unit at the location.
| Trigger |
| Description: |
| Raising Death counts |
|
| Conditions: |
| ¤ Bring 1 whatever unit to location X |
| Actions: |
¤ Modify death count for map revealer, add 1 deaths
|
¤ Wait 1 second
|
| ¤ Preserve trigger |
| Trigger |
| Description: |
| Lowering death counts if the unit leaves the location |
|
| Conditions: |
| ¤ Brings 0 whatever unit to "location X" |
| Actions: |
¤ Modify death count: set deaths of map revealer to 0
|
| ¤ preseve trigger |
| Trigger |
| Description: |
| Killing the unit if the death count get too high |
|
| Conditions: |
| ¤ Player X has suffered 20 deaths of "map revealer" |
| Actions: |
¤ Kill 1 whatever unit at "Location X"
|
¤ Modify death count: Set to 0 deaths of map revealer
|
| ¤ Preserve Trigger |
Addition: Ahh, you beat me to it Chuiu
Simple enough...
Here you'll need 2 death counters and hyper triggers, one for the time counter, and one to act as a switch.
************
When the player brings to unit to the location for the first time, set the switchcounter to 1 to begin the counting sequence.
************
If curPlayer brings 1 unit to 'location'
If curPlayer suffers 0 deaths of 'switchcounter'
--
Modify death count for curPlayer to 1 for 'switchcounter'
Preserve Trigger
************
************
Checks to see if unit is still on location, then add thes 60 death counts which is 5 seconds in real time with hyper triggers. It then sets the death count for switchcounter to 2 so that we can tell when the counting is over with in the next trigger.
************
If curPlayer brings 1 unit to 'location'
If curPlayer suffers 1 death of 'switchcounter'
If curplayer suffers 0 deaths of 'timecounter'
--
Add 60 death to 'timecounter' for curPlayer (5 second wait)
Modify death count for curPlayer to 2 for 'switchcounter'
Preserve Trigger
************
************
If curPlayer is still on the location, and the time is up, kill the unit at location.
************
If curPlayer brings 1 unit to 'location'
If curPlayer suffers 2 death of 'switchcounter'
If curplayer suffers 0 deaths of 'timecounter'
--
kill unit at 'location for curPlayer
Modify death count for curPlayer to 0 for 'switchcounter'
Preserve Trigger
************
************
Whenever the switchcounter is set to 2, always countdown on the timecounter to begin the countdown till the unit is killed.
************
If curPlayer suffers 2 death of 'switchcounter'
--
Subtract 1 death to 'timecounter' for curPlayer
Preserve Trigger
************
************
If the player leaves the location BEFORE the time is up, reset all variables back to 0 so that it won't kill the player.
************
If curPlayer brings 0 units to 'location'
If curPlayer suffers at least 1 death of 'switchcounter'
--
Modify death count for curPlayer to 0 for 'switchcounter'
Modify death count for curPlayer to 0 for 'timecounter'
Preserve Trigger
************
I'd use a physical timer for this so that when several units arrive at the location at different times, but there still are units in there so it won't screw up.