I am making a king of the hill type map, the scoring is done by a timer starting when a unit enters a region and stoppnig when it leaves the region.
The problem i'm having is that this doesn't take into account a unit being killed in a region. So if you kill the units in the scoring zone the players score still carries on going.
What trigger could I write that would say if the player has no units in that region the timer stops?
That's how I'd do it.
Forgot to add a check to reactivate the Unit Enter trigger in last image.
EDIT : Also, ignore the variable AnyoneOnTopFlag I have in there, it was just something I put in early on, but removed.
Rather turned on and off the trigger.
Thanks for the reply, what you have put makes perfect sence... but for some reason I can't seem to implement it into my triggers properly.
Basically I have it set so that when a unit from a player enters the scoring region a timer starts, then in another tigger there is a reacouring timer that keeps -1 from an integer every 0.1 seconds, then displays the result to a leaderboard.
I have attached a picture of what I have done using your guide lines... when I run the senario it works for players entering and leaving, but still carries on if all the players die.
There might be serveral units in the scoring zone at once, so I want the timer only to stop if the player holds no units at all.
Atlas's method seems spot on to me, and from the triggers I posted I can't see why it's not working.
Is it possible to output the current state of the unit variable to a text message so I can see when and if the variable is chaning?
If you take that line out then it works perfectly, but obviously that's no good because there can only be one "Unit on top" at a time.. so as soon as he is killed the timer stops even tho other units are in the area.
I am making a king of the hill type map, the scoring is done by a timer starting when a unit enters a region and stoppnig when it leaves the region.
The problem i'm having is that this doesn't take into account a unit being killed in a region. So if you kill the units in the scoring zone the players score still carries on going.
What trigger could I write that would say if the player has no units in that region the timer stops?
Thanks
Fixed :
http://i45.photobucket.com/albums/f54/AtlasRedux/triggerhelpKing.png
That's how I'd do it. Forgot to add a check to reactivate the Unit Enter trigger in last image.
EDIT : Also, ignore the variable AnyoneOnTopFlag I have in there, it was just something I put in early on, but removed. Rather turned on and off the trigger.
@AtlasRedux: Go
Thanks for the reply, what you have put makes perfect sence... but for some reason I can't seem to implement it into my triggers properly.
Basically I have it set so that when a unit from a player enters the scoring region a timer starts, then in another tigger there is a reacouring timer that keeps -1 from an integer every 0.1 seconds, then displays the result to a leaderboard.
I have attached a picture of what I have done using your guide lines... when I run the senario it works for players entering and leaving, but still carries on if all the players die.
Any ideas?
http://i52.tinypic.com/15qpy0j.png
@KineMorto: Go
This would only account for one unit wouldn't it?
There might be serveral units in the scoring zone at once, so I want the timer only to stop if the player holds no units at all. Atlas's method seems spot on to me, and from the triggers I posted I can't see why it's not working.
Is it possible to output the current state of the unit variable to a text message so I can see when and if the variable is chaning?
Its this line that's causing the problem:
If you take that line out then it works perfectly, but obviously that's no good because there can only be one "Unit on top" at a time.. so as soon as he is killed the timer stops even tho other units are in the area.
Any other ideas?
Thanks for the help so far guys
@James7285: Go
" (Any units in Scoring Zone owned by player 1 matching No Unit Filter, with at most 1))"
Give it a filter for non-dead units.
@Grogian: Go
Thanks so much! that sorted it.
Was it a case of the "Unit on top" variable jumping to a dead unit then?
Big thanks to Atlas and Kine for the input as well.
@James7285: Go
Yeah, I believe that was the issue.