"OR" Statement not working

Orbiter

New Member
Reaction score
0
Can anyone see why this trigger doesn't work? (Doesn't modify variable and minerals).

Trigger:
  • Events
    • Unit - Any Unit dies
    • Local Variables
    • Conditions
    • Actions
    • General - If (Conditions) then do (Actions) else do (Actions)
      • If
        • (Owner of (Triggering unit)) == 2
        • Or
          • Conditions
            • (Owner of (Triggering unit)) == 3
            • Or
              • Conditions
                • (Owner of (Triggering unit)) == 4
      • Then
        • Variable - Modify UnitKills_P1: + 1
        • Player - Modify player 1 Minerals: Add 2
      • Else
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
Use GUI tags.
I know they're built for WC3 GUI, but they're still easier to read than plain (un-indented) text.
 

Dave312

Censored for your safe viewing
Reaction score
269
You have structured it incorrectly. The OR works by comparing all the conditions listed under it and if 1 condition is true, the OR condition returns true. See below.

Trigger:
  • Events
    • Unit - Any Unit dies
    • Local Variables
    • Conditions
    • Actions
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • Or
            • Conditions
              • (Owner of (Triggering unit)) == 2
              • (Owner of (Triggering unit)) == 3
              • (Owner of (Triggering unit)) == 4
        • Then
          • Variable - Modify UnitKills_P1: + 1
          • Player - Modify player 1 Minerals: Add 2
        • Else


This will run if the dying unit is owned by player 2, 3 or 4. There is also no reason why these conditions cannot be made under the conditions section of the trigger.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top