• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Help with towers in a tag map!!!!

Status
Not open for further replies.
Level 6
Joined
Jul 17, 2008
Messages
185
HI

Im making a tag map called abomination tag and i want the abominations to only atack the towers when they have no other choise to reach the players (kinda like kodo tag), but they always atack the towers, I have tried to set the priority to 1 but it doest work because towers atack... how can i make this??
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Here's something that might help:

  • Untitled Trigger 064
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacking unit)) Equal to Player 1 (Red)
    • Actions
      • Set Temp_Unit_1 = (Attacking unit)
      • Set Temp_Loc_1 = (Position of Temp_Unit_1)
      • Set Temp_Real_1 = 9999999.00
      • Set Temp_Group_1 = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Huntress))
      • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
        • Loop - Actions
          • Set Temp_Loc_2 = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between Temp_Loc_1 and Temp_Loc_2) Less than Temp_Real_1
            • Then - Actions
              • Set Temp_Unit_2 = (Picked unit)
              • Set Temp_Real_1 = (Distance between Temp_Loc_1 and Temp_Loc_2)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Temp_Loc_2)
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
      • Unit - Order Temp_Unit_1 to Right-Click Temp_Unit_2
      • Set Temp_Unit_2 = No unit
999999 is how far you want the units to be checked. Change conditions, unit types to suit your needs. I placed some archers and hunteresses for the enemy. First my units tried to attack the archers that were in front row, but then this trigger forced them to attack the huntresses that were further back.

If there are no hutressess, the units continue attacking the archers.
 
Level 6
Joined
Jul 17, 2008
Messages
185
hmm there is a problem with this: if another runner passes near the abominations they will ignore him because they are right clicking on the other runner so they are only hostile to the one they are clicking...

how can i fixx this?
 
Status
Not open for further replies.
Top