- Joined
- Jan 29, 2010
- Messages
- 213
Hi, all I have some problem with triggering unit codition, I need to count Players:
Calculates how much players are users, and playing (brown = creeps).
Hero revive+defeat. Every player hero slain will be removed from players(integer), If players equal to 0 the game will end.
(Revive(unit-type) sets dead hero to revive on end wave)
End wave (next level switcher), revives all dead heroes, heoes witch weren't killed, will equal to no unit, so it wouldn't add +1 to players.
When I test map alone, players=1, before the end wave starts, than players=4, when they have to equal to 1.
+rep to those who'll help
used conditionsRevive1 - unit-type
players - integer
INISTALIZATION
Inistaliztion
Events
Time - Elapsed game time is 0.10 seconds
Conditions
Actions
Set players = 0
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Picked player) Not equal to Player 12 (Brown)
((Picked player) controller) Equal to User
((Picked player) slot status) Equal to Is playing
Then - Actions
Set players = (players + (Player number of (Picked player)))
Else - Actions
(Revive(unit-type) sets dead hero to revive on end wave)
HERO REVIVE
Hero revive
Events
Unit - A unit Dies
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Then - Actions
Set Revive1 = (Triggering unit)
Set players = (players - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to Player 2 (Blue)
Then - Actions
Set Revive2 = (Triggering unit)
Set players = (players - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to Player 3 (Teal)
Then - Actions
Set Revive3 = (Triggering unit)
Set players = (players - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
players Equal to 0
Then - Actions
Countdown Timer - Create a timer window for Timer1 with title Game ends in...
Countdown Timer - Show (Last created timer window)
Countdown Timer - Start Timer1 as a One-shot timer that will expire in 60.00 seconds
Wait 60.00 seconds
Countdown Timer - Destroy (Last created timer window)
Countdown Timer - Hide (Last created timer window)
Game - Defeat Player 1 (Red) with the message: Defeat!
Game - Defeat Player 2 (Blue) with the message: Defeat!
Game - Defeat Player 3 (Teal) with the message: Defeat!
Else - Actions
END WAVE
End Wave
Events
Time - Every 1.00 seconds of game time
Conditions
(Number of living Kobold units owned by Player 12 (Brown)) Equal to 0
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Revive1 Equal to (Triggering unit)
Then - Actions
Set players = (players + 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Revive2 Equal to (Triggering unit)
Then - Actions
Set players = (players + 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Revive3 Equal to (Triggering unit)
Then - Actions
Set players = (players + 1)
Else - Actions
+rep to those who'll help