• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

When a unit enters <region>, take one life from <ki

Status
Not open for further replies.
Level 2
Joined
Feb 7, 2005
Messages
17
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.

please, can someone help me? thanks

~Araknid
 
1st:
Code:
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:
Code:
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.
 
Level 2
Joined
Jan 15, 2005
Messages
12
Hey, ur code can't work and will do lags !

In the trigger of initialization of your map :

Code:
Events

Map initialization

Conditions

-

Actions

(Initialization triggers of your map)
Turn on Verification

Code:
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 :


Code:
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...)
 
Level 2
Joined
Feb 7, 2005
Messages
17
Thanks :D

I used parts of both, and it works perfectly now!! my map is shaping up real good :D

keep watching my topics and, maybe, you can find my map in one of them soon :D


~Araknid
 
Status
Not open for further replies.
Top