• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗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