• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

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
 
Level 29
Joined
Mar 10, 2009
Messages
5,016

  • 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