• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Action when all units in a group are dead

Status
Not open for further replies.
Well actually now i want to make something like there will be some text displayed that says Ghouls killed 0 out of 6 or smth. And each time a ghoul dies it will add 1 out of 6, 2 out of 6 etc. And then when all 6 are killed the killer would be teleported.
 
Create a real or integer variable. Every time a ghoul (or whatever) is killed, increase that variable by one. Display that variable in text, and when it hits the desired number, teleport the unit away with Unit - Instantly move unit to <point>.

If the units are preplaced, you can use triggers to specifically trigger with those units.
 
Here are my triggers, anybody feel free to point out any mistakes. They both use an integer variable called GhoulKill.
For pre-placed units:
  • Specific Kill
    • Events
      • Unit - Ghoul 0000 <gen> Dies
      • Unit - Ghoul 0001 <gen> Dies
      • Unit - Ghoul 0002 <gen> Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ghoul 0000 <gen> is dead) Equal to True
          • (Ghoul 0001 <gen> is dead) Equal to True
          • (Ghoul 0002 <gen> is dead) Equal to True
        • Then - Actions
          • Quest - Display to (All players) the Quest Completed message: Quest message. Whatever.
          • Quest - Mark ([HIGHLIGHT]<Your Quest>[/code]) as Completed
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (All players) the text: ((You have killed + (String(GhoulKill))) + ghouls out of 3.)
          • Set GhoulKill = (GhoulKill + 1)
For unit-type:
  • UnitType Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Ghoul
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (String(GhoulKill)) Equal to 3
        • Then - Actions
          • Quest - Display to (All players) the Quest Completed message: Quest message. What...
          • Quest - Mark ([HIGHLIGHT]<Your Quest>[/code]) as Completed
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (All players) the text: ((You have killed + (String(GhoulKill))) + ghouls out of 3.)
          • Set GhoulKill = (GhoulKill + 1)


Edit: Bah, NOW I see that he has it done.
 
The part
  • (String(GhoulKill)) Equal to 3
is String Comparison.

(String(GhoulKill)) specifically is Conversion - Convert Integer to String
 
Some1 either explain what goes in the index part(GhoulKills[INDEX]) and i tried red barons thing. I added the units into a group at map init. But it always displays that there are 6 ghouls left each time i kill a ghoul.

Ill add an atachment so u can see my problem exactly
 

Attachments

  • Problem.JPG
    Problem.JPG
    145.9 KB · Views: 123
Last edited:
Do you mean this?
I attached a picture of how I have GhoulKill set up.
 

Attachments

  • Ghoul Kill.JPG
    Ghoul Kill.JPG
    23.9 KB · Views: 130
Status
Not open for further replies.
Back
Top