• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Supply-consuming towers

Status
Not open for further replies.
Hello! i have an issue with my trigger... i'll post the trigger....
  • Tower supply consumption
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Flame tower
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Attacking unit)) Current lumber) Greater than or equal to 3
            • Then - Actions
              • Player - Add -3 to (Owner of (Attacking unit)) Current lumber
            • Else - Actions
              • Unit - Order (Attacking unit) to Stop
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Guntower
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Attacking unit) in slot 1)) Equal to Bullets
            • Then - Actions
              • Item - Set charges remaining in (Item carried by (Attacking unit) in slot 1) to ((Charges remaining in (Item carried by (Attacking unit) in slot 1)) - 1)
            • Else - Actions
              • Unit - Order (Attacking unit) to Stop
        • Else - Actions
See... the problem at first was, that both the guntower and the flame tower couldn't shoot at the same time, since neither of them had the others type. Then i figured out i could make another IF/THEN/ELSE trigger, inside the IF/THEN/ELSE trigger, but, now it seems they doesn't even care about the trigger, and just fires away...
I need it to work, 'cause i think i'm onto something funny :D if you doesn't understand what the trigger is supposed to do, let me know, i will re-write what i mean.
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
You cannot refer to attacking unit as triggering unit. First condition in both IF THEN ELSE, must be reworked this way:

  • (Unit-type of (Attacking unit)) Equal to Flame tower
  • (Unit-type of (Attacking unit)) Equal to Guntower
If bullets reach zero, tower will still fire, so use this function with bullet check:

  • (Charges remaining in (Item carried by (Attacking unit) in slot 1)) Greater than 0
That should clear things up. :)
 
Status
Not open for further replies.
Top