• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Lives in hero deff!

Status
Not open for further replies.

Quiq

Q

Quiq

Hi!

I got a Huge problem with my mapping I can't get my "lives" triggers to work right instead of using the lives one by one they use all at the same time and I get deafeted at once!:s

So I need help to get 10 lives not 1

If I have missed somthing u want me to explain more precisely plz post it cuse I really need youre help!
 
mainly when you set lives, you make a Integer variable and set it to 10 with an action like
  • Set X = 10
The Everytime one live needs to be extracted, you use
  • Set X=X-1
in which X is the integer variable you made
 
Current Trigger

  • Life 1
    • Events
      • Unit - A unit enters End Region <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • Unit - Remove (Entering unit) from the game
      • Game - Display to (All players) the text: Warning a unit have...
      • Trigger - Turn on Life 2 <gen>
      • Wait 0.50 seconds
      • Trigger - Turn off (This trigger)
  • DEAD
    • Events
      • Unit - A unit enters End Region <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • Game - Display to (All players) the text: youre dead
      • Wait 2.00 seconds
      • 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!
      • Game - Defeat Player 4 (Purple) with the message: Defeat!
      • Game - Defeat Player 5 (Yellow) with the message: Defeat!
      • Game - Defeat Player 6 (Orange) with the message: Defeat!
      • Game - Defeat Player 7 (Green) with the message: Defeat!
      • Game - Defeat Player 8 (Pink) with the message: Defeat!
      • Game - Defeat Player 9 (Gray) with the message: Defeat!
      • Game - Defeat Player 10 (Light Blue) with the message: Defeat!


this is what first life look like and last life and I didn't get the thing with integer could u make a whole trigger so I get the point? :s plz
 
Last edited by a moderator:
First of all, you need to make a global variable called Lives, which is an intreger with a default value of 10, then you could use a trigger like this:
  • CreepEnd
  • Events
    • Unit - A unit enters End Region <gen>
  • Conditions
    • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
  • Actions
    • Unit - Remove (Entering unit) from the game
    • Set Lives=Lives-1
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Lives Greater than or equal to 1
      • Then - Actions
        • Game - Display to (All players) the text: (Warning! A unit have slipped through your defences! + ((String(Lives)) + lives left!))
      • Else - Actions
        • Trigger - Turn off (This Trigger)
        • Game - Display to (All players) the text: You're so dead!
        • Wait 2.00 seconds
        • 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!
        • Game - Defeat Player 4 (Purple) with the message: Defeat!
        • Game - Defeat Player 5 (Yellow) with the message: Defeat!
        • Game - Defeat Player 6 (Orange) with the message: Defeat!
        • Game - Defeat Player 7 (Green) with the message: Defeat!
        • Game - Defeat Player 8 (Pink) with the message: Defeat!
        • Game - Defeat Player 9 (Gray) with the message: Defeat!
        • Game - Defeat Player 10 (Light Blue) with the message: Defeat!
I've attached a demo map aswell
 

Attachments

Last edited:
thx all!

Thx for map VictorOfSweden!
 
Last edited by a moderator:
SFilip said:
and you might aswell turn off the trigger right after Else - Actions.
it kind of looks stupid when you see
You have -1 lives left
You have -2 lives left
etc. after you get defeated. but that's just my oppinion.

Those will not be be seen since -1 and -2 are smaller than or not equal to 1, so the then action will not be displayed only the else, but you should close the trigger after you are done with it ^_^
 
Yea I think I should cuse it keeps showing "you're so dead" all the time =D
 
Status
Not open for further replies.
Back
Top