• 🏆 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!

a way to stop ordered to attack units From Chasing

Status
Not open for further replies.
Level 5
Joined
Jun 13, 2017
Messages
83
I made a trigger to make units attack the target, but the problem is when they attack they chase forever even if they left the guard distance. I know that is because of ordering them to attack but is there anything i can do to make them not to chase out of their guard distance?





  • Path Ability
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Tanks Path for GDD_DamageSource) Greater than 0
    • Actions
      • Set PathWrite = (PathWrite + 1)
      • Set PathT_Loc[PathWrite] = (Position of GDD_DamageSource)
      • Set PathT_Unit[1] = GDD_DamageSource
      • Set PathT_Group[PathWrite] = (Units within 240.00 of PathT_Loc[PathWrite] matching (((Matching unit) belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True))
      • Set PathRead = (PathRead + 1)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in PathT_Group[PathRead] and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack PathT_Unit[PathRead]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PathWrite Equal to PathRead
            • Then - Actions
              • Set PathWrite = 0
              • Set PathRead = 0
            • Else - Actions
      • Custom script: call RemoveLocation(udg_PathT_Loc[udg_PathRead])



The trigger work just fine but the chase is the problem i want it to be taunted as long as it is in its guard distance.


and how to link the trigger like in the editor instead of text?
Edit: Got the link right thanks
Edit: Removed the Wait time and added destroygroup but still no idea how to make them stop.
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
4,992
how to link the trigger like in the editor instead of text?
Put the text between [trigger][/trigger] tags:

  • Path Ability
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Tanks Path for GDD_DamageSource) Greater than 0
    • Actions
      • Set PathWrite = (PathWrite + 1)
      • Set PathT_Loc[PathWrite] = (Position of GDD_DamageSource)
      • Set PathT_Unit[1] = GDD_DamageSource
      • Set PathT_Group[PathWrite] = (Units within 150.00 of PathT_Loc[PathWrite] matching (((Matching unit) belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True))
      • Wait 1.00 seconds
      • Set PathRead = (PathRead + 1)
      • Unit Group - Pick every unit in PathT_Group[PathRead] and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack PathT_Unit[PathRead]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PathWrite Equal to PathRead
            • Then - Actions
              • Set PathWrite = 0
              • Set PathRead = 0
            • Else - Actions
      • Custom script: call RemoveLocation(udg_PathT_Loc[udg_PathRead])
 
Status
Not open for further replies.
Top