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

Why sometimes units are chasing heroes forever?

Status
Not open for further replies.
Level 18
Joined
Jun 2, 2009
Messages
1,233
Hello everyone. I think finally i have solved my aggro issues by creating new system. But it seems there are flaws in this trigger.

  • AggroTest
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is A Hero) Equal to True
      • (DamageEventSource is A Hero) Equal to True
    • Actions
      • Set DamagePoint = (Position of DamageEventTarget)
      • Set DamageGroup = (Units within 1000.00 of DamagePoint)
      • Unit Group - Pick every unit in DamageGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in CreepsGroup) Equal to True
              • ((Picked unit) belongs to an enemy of (Owner of DamageEventSource)) Equal to True
            • Then - Actions
              • Unit - Order (Picked unit) to Attack DamageEventSource
              • Trigger - Run AggroEndsYeter <gen> (checking conditions)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_DamagePoint)
  • AggroEndsYeter
    • Events
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • Unit Group - Pick every unit in DamageGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in CreepsGroup) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to ClanDevilPlayer
                • Then - Actions
                  • Unit - Order (Picked unit) to Attack-Move To DevilOCCreep[(Level of creep seyi devil for (Picked unit))]
                  • Cinematic - Ping minimap for (All players) at DevilOCCreep[(Level of creep seyi devil for (Picked unit))] for 1.00 seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Equal to ClanReaperPlayer
                    • Then - Actions
                      • Unit - Order (Picked unit) to Attack-Move To ReaperOCCreep[(Level of creep seyi reaper for (Picked unit))]
                      • Cinematic - Ping minimap for (All players) at ReaperOCCreep[(Level of creep seyi reaper for (Picked unit))] for 1.00 seconds
                    • Else - Actions
            • Else - Actions
      • Custom script: call DestroyGroup(udg_DamageGroup)
Sometimes units are follows the attacker forever and i don't know what can cause this.
 
Level 24
Joined
Feb 27, 2019
Messages
833
The units keeps attacking because the Unit Group variable is overwritten before the 2 seconds have passed.

This trigger is probably fine. Probably. Does this trigger make sense to you? Youll need to fill in the blanks.
  • Untitled Trigger 002
    • Events
    • Conditions
    • Actions
      • Custom script: local integer int
      • Set VariableSet UnitGroupInt = (UnitGroupInt + 1)
      • Set VariableSet UnitGroup[UnitGroupInt] = (Units in (Playable map area))
      • Unit Group - Pick every unit in UnitGroup[UnitGroupInt] and do (Actions)
        • Loop - Actions
      • Custom script: set int = udg_UnitGroupInt
      • Wait 2.00 seconds
      • Custom script: set udg_UnitGroupInt = int
      • Unit Group - Pick every unit in UnitGroup[UnitGroupInt] and do (Actions)
        • Loop - Actions
      • Custom script: call DestroyGroup(udg_UnitGroup[udg_UnitGroupInt])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UnitGroupInt Greater than 200
        • Then - Actions
          • Set VariableSet UnitGroupInt = 0
        • Else - Actions
 
Last edited:
Level 18
Joined
Jun 2, 2009
Messages
1,233
WoW. What is happening in there? I have a no idea but i will try to do this. Probably it is famous mui thing. I will do this and let you know the results.
I made changes just like this, tonight i will try to test it with my players.

I hope i made it correctly. I am not sure about it.

  • AggroEndsYeter Copy
    • Events
    • Conditions
    • Actions
      • Custom script: local integer int
      • Set UnitGroupInt = (UnitGroupInt + 1)
      • Set UnitGroup[UnitGroupInt] = (Units in (Playable map area))
      • Unit Group - Pick every unit in UnitGroup[UnitGroupInt] and do (Actions)
        • Loop - Actions
      • Custom script: set int = udg_UnitGroupInt
      • Wait 2.00 seconds
      • Custom script: set udg_UnitGroupInt = int
      • Unit Group - Pick every unit in UnitGroup[UnitGroupInt] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in CreepsGroup) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to ClanDevilPlayer
                • Then - Actions
                  • Unit - Order (Picked unit) to Attack-Move To DevilOCCreep[(Level of creep seyi devil for (Picked unit))]
                  • Cinematic - Ping minimap for (All players) at DevilOCCreep[(Level of creep seyi devil for (Picked unit))] for 1.00 seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Equal to ClanReaperPlayer
                    • Then - Actions
                      • Unit - Order (Picked unit) to Attack-Move To ReaperOCCreep[(Level of creep seyi reaper for (Picked unit))]
                      • Cinematic - Ping minimap for (All players) at ReaperOCCreep[(Level of creep seyi reaper for (Picked unit))] for 1.00 seconds
                    • Else - Actions
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UnitGroupInt Greater than 200
        • Then - Actions
          • Set UnitGroupInt = 0
        • Else - Actions
 
Last edited:
Level 24
Joined
Feb 27, 2019
Messages
833
Yes its kind of MUI, it allows a max of 200 instances of the trigger to run simultaneously. The number can be increased if needed.

You added AggroEndsYeter after the wait which is correct. You also need to add AggroTest before the wait. These two triggers are now one.

Edit: I made a small mistake so I corrected it. Try making this trigger and post it here again.
  • AggroTest and AggroEndsYeter
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is A Hero) Equal to True
      • (DamageEventSource is A Hero) Equal to True
    • Actions
      • Custom script: local integer index
      • Set VariableSet DamageGroupIndex = (DamageGroupIndex + 1)
      • Set VariableSet DamagePoint = (Position of DamageEventTarget)
      • Set VariableSet DamageGroup[DamageGroupIndex] = (Units within 1000.00 of DamagePoint.)
      • Unit Group - Pick every unit in DamageGroup[DamageGroupIndex] and do (Actions)
        • Loop - Actions
          • -------- Add your actions from unit group loop in AggroTest --------
      • Custom script: call RemoveLocation(udg_DamagePoint)
      • Custom script: set index = udg_DamageGroupIndex
      • Wait 2.00 seconds
      • Custom script: set udg_TempInt = index
      • Unit Group - Pick every unit in DamageGroup[TempInt] and do (Actions)
        • Loop - Actions
          • -------- Add your actions from unit group loop in AggroEndsYeter --------
      • Custom script: call DestroyGroup(udg_DamageGroup[udg_TempInt])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageGroupIndex Greater than 200
        • Then - Actions
          • Set VariableSet DamageGroupIndex = 0
        • Else - Actions
 
Last edited:
Level 18
Joined
Jun 2, 2009
Messages
1,233
I think i made corrections. Here is the final trigger.
DamageGroup: UnitGroup Array 20


  • AggroTest
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is A Hero) Equal to True
      • (DamageEventSource is A Hero) Equal to True
    • Actions
      • Custom script: local integer index
      • Set DamageGroupIndex = (DamageGroupIndex + 1)
      • Set DamagePoint = (Position of DamageEventTarget)
      • Set DamageGroup[DamageGroupIndex] = (Units within 1000.00 of DamagePoint)
      • Unit Group - Pick every unit in DamageGroup[DamageGroupIndex] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in CreepsGroup) Equal to True
              • ((Picked unit) belongs to an enemy of (Owner of DamageEventSource)) Equal to True
            • Then - Actions
              • Unit - Order (Picked unit) to Attack DamageEventSource
            • Else - Actions
      • Custom script: call RemoveLocation(udg_DamagePoint)
      • Custom script: set index = udg_DamageGroupIndex
      • Wait 2.00 seconds
      • Custom script: set udg_TempInt = index
      • Unit Group - Pick every unit in DamageGroup[TempInt] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in CreepsGroup) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to ClanDevilPlayer
                • Then - Actions
                  • Unit - Order (Picked unit) to Attack-Move To DevilOCCreep[(Level of creep seyi devil for (Picked unit))]
                  • Cinematic - Ping minimap for (All players) at DevilOCCreep[(Level of creep seyi devil for (Picked unit))] for 1.00 seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Equal to ClanReaperPlayer
                    • Then - Actions
                      • Unit - Order (Picked unit) to Attack-Move To ReaperOCCreep[(Level of creep seyi reaper for (Picked unit))]
                      • Cinematic - Ping minimap for (All players) at ReaperOCCreep[(Level of creep seyi reaper for (Picked unit))] for 1.00 seconds
                    • Else - Actions
            • Else - Actions
      • Custom script: call DestroyGroup(udg_DamageGroup[udg_TempInt])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageGroupIndex Greater than 200
        • Then - Actions
          • Set DamageGroupIndex = 0
        • Else - Actions
Please let me know if somethings wrong because i am not similar with MUI systems. Sadly i cannot test it at the moment. I have to return home for the test it. And i have turned off AggroEndsYeter.
 
Status
Not open for further replies.
Top