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

Need help with Conditioning a trigger

Status
Not open for further replies.
Level 7
Joined
Dec 29, 2008
Messages
252
Okay everyone, I've got a problem with one of my triggers in my map. It is supposed to hurt units owned by a player that enter a region after 10 seconds, but at this point I'm stumped. Heres the trigger:

  • AntiCamp Enter
    • Events
      • Unit - A unit enters Wendigo Hurt Zone <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
    • Actions
      • Trigger - Turn off (This trigger)
      • Game - Display to PLGSingular[9] the text: If you do not leave...
      • Wait 10.00 seconds
      • For each (Integer A) from 1 to 256, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units in Wendigo Hurt Zone <gen>) and do (Actions)
            • Loop - Actions
              • Set AntiCampUnitArray[(Integer A)] = (Picked unit)
              • Unit - Set the custom value of (Picked unit) to (Integer A)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (AntiCampUnitArray[(Custom value of (Matching unit))] is in (Units in Wendigo Hurt Zone <gen>)) Equal to True
        • Then - Actions
          • Trigger - Turn on AntiCamp Damage <gen>
        • Else - Actions
          • Trigger - Turn on (This trigger)
It took all of my brain-power to come up with this, but im pretty sure
  • (AntiCampUnitArray[(Custom value of (Matching unit))] is in (Units in Wendigo Hurt Zone <gen>)) Equal to True
isnt going to work. My brain will explode if I try to solve this puzzle any further, so I'm just going to leave it to you, hive.

Will reward anyone who solves this with +rep
 

  • Enters
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
    • Actions
      • Set ID = (Key (Triggering unit))
      • Hashtable - Save 10 as 1 of ID in HASH
      • Unit Group - Add (Triggering unit) to Grp
      • Trigger - Turn on Loop <gen>
  • Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Grp and do (Actions)
        • Loop - Actions
          • Set EnteringUnit = (Picked unit)
          • Set ID = (Key (Picked unit))
          • Set Timer = (Load 1 of ID from HASH)
          • Game - Display to (All players) the text: (String(Timer))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Timer Greater than or equal to 0
              • (EnteringUnit is alive) Equal to True
            • Then - Actions
              • Hashtable - Save (Timer - 1) as 1 of ID in HASH
            • Else - Actions
              • Unit Group - Remove EnteringUnit from Grp
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Region 000 <gen> contains EnteringUnit) Equal to True
                • Then - Actions
                  • Unit - Cause EnteringUnit to damage EnteringUnit, dealing 300.00 damage of attack type Spells and damage type Normal
                • Else - Actions
              • Hashtable - Clear all child hashtables of child ID in HASH
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Grp is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 
Status
Not open for further replies.
Top