Trigger problem

Status
Not open for further replies.
Level 12
Joined
Jul 5, 2014
Messages
556
  • Events
    • Unit - A unit owned by Player 2 (Blue) Dies
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • DoorOpen Equal to 1
      • (Owner of (Killing unit)) Equal to Player 1 (Red)
      • (Number of units in (Units in Region 002 <gen> owned by Player 2 (Blue))) Equal to 0
    • Then - Actions
      • Wait 1.00 seconds
      • Game - Display to (All players) for 12.00 seconds the text: CORTEZ WINS!!!
      • Wait 1.70 seconds
      • Sound - Play Credits <gen> at 100.00% volume, skipping the first 70.40 seconds
    • Else - Actions
      • Do nothing

It's an arena-like fight between 2 players. Dooropen 1 refers to closed doors. The trigger works without the "number of units" trigger, but with it, somehow it doesn't activate. It should be the trigger that confirms that I killed all the blue units in the region, but the editor doesn't like it for some reason. What am I doing wrong?
 
^Why does it not work so well?
JASS:
function IsUnitDeadBJ takes unit whichUnit returns boolean
    return GetUnitState(whichUnit, UNIT_STATE_LIFE) <= 0
endfunction
JASS:
function IsUnitAliveBJ takes unit whichUnit returns boolean
    return not IsUnitDeadBJ(whichUnit)
endfunction

@WarCortez
Just to inform you, " Number of units..." will create a group so it leaks.
 
^Why does it not work so well?
JASS:
function IsUnitDeadBJ takes unit whichUnit returns boolean
    return GetUnitState(whichUnit, UNIT_STATE_LIFE) <= 0
endfunction
JASS:
function IsUnitAliveBJ takes unit whichUnit returns boolean
    return not IsUnitDeadBJ(whichUnit)
endfunction

@WarCortez
Just to inform you, " Number of units..." will create a group so it leaks.

This is small, training map with very few triggers. A leak like that cause no problem.
 
Status
Not open for further replies.
Back
Top