• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Action when all units in a group are dead

Status
Not open for further replies.
Level 17
Joined
Apr 24, 2005
Messages
762
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.
 
Level 24
Joined
Jun 26, 2006
Messages
3,406
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.
 
Level 24
Joined
Jun 26, 2006
Messages
3,406
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.
 
Level 24
Joined
Jun 26, 2006
Messages
3,406
The part
  • (String(GhoulKill)) Equal to 3
is String Comparison.

(String(GhoulKill)) specifically is Conversion - Convert Integer to String
 
Level 17
Joined
Apr 24, 2005
Messages
762
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: 69
Last edited:
Level 24
Joined
Jun 26, 2006
Messages
3,406
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: 80
Status
Not open for further replies.
Top