When a unit enters <region>, take one life from <ki
I have a question about triggers, once again:
I want to make.. lets say a region. When hostile-owned units enter that region, one life gets substracted from "King". He has 200 lives, and when it his 0, you lose. What sort of triggers should I be looking for, and what variables(to keep track of number lives left). Also: to see how many lives are left, you just look at the (yes, it's a unit somewhere on the map) HP bar of your king.
king
Events
Unit - A unit enters Region 000 <gen>
Conditions
(Owner of (Entering unit)) Equal to (Random player from (All enemies of Player 1 (Red)))
(Life of Paladin 0003 <gen>) Equal to 200.00
Actions
Unit - Set life of Paladin 0003 <gen> to 199.00
2nd:
king
Events
Time - Every 0.01 seconds of game time
Conditions
(Life of Paladin 0003 <gen>) Equal to 0.00
Actions
Game - Defeat Player 1 (Red) with the message: your message
3rd:
well you can use integer and make 200 triggers ^-^ or you can use multiboards and make a trigger from that but what you asking I cant ttell you, I can create but it would take me some time, I can just tell you that this kind of triggering is not for you.
Events
Map initialization
Conditions
-
Actions
(Initialization triggers of your map)
Turn on Verification
Events
Unit - A unit enters Region 000 <gen>
Conditions
(Owner of (Entering unit)) Equal to (Random player from (All enemies of Player 1 (Red)))
Actions
Unit - Set life = (life-1)
Turn on Verification
In Verification trigger :
Events :
Map initialization
Conditions
-
Actions :
[b]
If (All conditions are True) then do (Then actions) else do (else actions)
If - Conditions
life = 0
Then - Actions
Else - Actions
Do nothing
Turn off (This trigger)
[/b]
In actions of last code, it's the same trigger.In then actions, you can put what u want (a cinematic, defeat all players...)