• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger Question.

Status
Not open for further replies.
Level 1
Joined
Jun 29, 2010
Messages
2
Hey there,

So I'm pretty new to the WCIII editor and have started to make a Tower Defense. I was looking through this tutorial, and have hit a problem. I have everything working just fine except this:

  • Wait until ((All units of (Units owned by Player 12 (Brown)) are dead)Equal to True), checking every 1.00 seconds
I'm not actually sure the steps involved to getting that trigger. I go New Action --> General --> Wait for Condition. After that I'm lost.

Any help would be appreciated, thanks.
 
Level 11
Joined
Aug 6, 2009
Messages
697
Hey there,

So I'm pretty new to the WCIII editor and have started to make a Tower Defense. I was looking through this tutorial, and have hit a problem. I have everything working just fine except this:

  • Wait until ((All units of (Units owned by Player 12 (Brown)) are dead)Equal to True), checking every 1.00 seconds
I'm not actually sure the steps involved to getting that trigger. I go New Action --> General --> Wait for Condition. After that I'm lost.

Any help would be appreciated, thanks.
You should try this instead.

  • Unit - A unit Dies
  • (Number of units in (Units owned by Player 12 (Brown))) Less than or equal to 1
  • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
The victory is just an example function.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
  • Unit - A unit Dies
  • (Number of units in (Units owned by Player 12 (Brown))) Less than or equal to 1
  • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
That would leak a group and actually wouldn't work correctly since it would be counting dead units.
Try this one:
  • Player1Loses
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units owned by Player 1 (Red) matching (((Matching unit) is alive) Equal to True))) Equal to 0
        • Then - Actions
          • Game - Defeat Player 1 (Red) with the message: Defeat!
        • Else - Actions
 
Level 11
Joined
Aug 6, 2009
Messages
697
That would leak a group and actually wouldn't work correctly since it would be counting dead units.
Try this one:
  • Player1Loses
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units owned by Player 1 (Red) matching (((Matching unit) is alive) Equal to True))) Equal to 0
        • Then - Actions
          • Game - Defeat Player 1 (Red) with the message: Defeat!
        • Else - Actions
Oh,it leaks? Guess I still have alot to learn on what leaks then lol.
 
Status
Not open for further replies.
Top