Trigger Question.

Status
Not open for further replies.

WUMP4

W

WUMP4

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.
 
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.
 
  • 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
 
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.
Back
Top