Question is bit long for title.

Level 13
Joined
Jun 2, 2009
Messages
711
Let me tell you what happens in here.
When my AI controlled heroes attacked by enemy units, they are falling back for 1 second. Then checking if there are friendly units around.

Now currently i have a problem with this trigger. When creeps keeps spamming attack the AI controlled hero, they keep retreating. First i want to solve this issue. I believe i can make them ignore enemy units for x seconds and i can detect it with timer but still this trigger is just for one slot.
How can i make my system better? I know it looks so amateur. I have decided to create extra 10 triggers for 10 slots and i was started to think i am doing this with difficult way...This is why i am here.

  • Events
    • Unit - A unit Is attacked
  • Conditions
    • (Attacked unit) Equal to zU_AIHero[12]
    • ((Attacked unit) is in zUG_RegenReaper) Equal to False
    • ((Attacking unit) is in zUG_CreepsDevil) Equal to True
    • zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] Equal to False
    • (Level of (Attacked unit)) Less than or equal to 21
  • Actions
    • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = True
    • Set TempPoint = ((Position of (Attacked unit)) offset by 375.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])) - 0.00) degrees)
    • Unit - Order (Attacked unit) to Move To TempPoint
    • Custom script: call RemoveLocation (udg_TempPoint)
    • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + Ãœhü vurdular kaçiyom)
    • Wait (2.00 - ((Real((Level of (Attacked unit)))) x 0.10)) seconds
    • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = False
    • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + Ehe kaçmam bitti)
    • Set TempGroup = (Units within 500.00 of (Position of zU_AIHero[12]) matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in TempGroup) Greater than or equal to 1
          • Then - Actions
            • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of NextTarget[(Player number of (Owner of (Attacked unit)))])
            • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + 1 taneden fazla creep var ben savasmaya devam)
          • Else - Actions
            • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + hmmm creep yok )
            • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])
    • Custom script: call DestroyGroup (udg_TempGroup)
 
Level 9
Joined
Dec 13, 2009
Messages
216
If I understand it correctly, you have a copy of this trigger for every hero in zU_AIHero? You can add all AI heroes into a unit group, then check whether the Attacked hero is in that group instead of checking whether it is zU_AIHero[1-12].

  • Actions
    • Set TempPoint = ((Position of (Attacked unit)) offset by 375.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])) - 0.00) degrees)
    • Unit - Order (Attacked unit) to Move To TempPoint
    • Custom script: call RemoveLocation (udg_TempPoint)
You're leaking a point here. You need to do the same thing you're doing with temppoint to (Position of (Attacked unit)).

If you want to disable the trigger when a hero is being attacked, do:
  • Conditions
    • ignoreAttacks[Player number of (Owner of (Attacked unit()))] Equal to False
    • -------- Your other Conditions --------
  • Actions
    • Set VariableSet ignoreAttacks[Player number of (Owner of (Attacked unit()))] = True
    • -------- Your Actions --------
    • Set VariableSet ignoreAttacks[Player number of (Owner of (Attacked unit()))] = False
 
Level 13
Joined
Jun 2, 2009
Messages
711
I want to add extra 1 or 2 seconds wait after they will ordered again. Because currenty heroES spams fall back for each damage.
Hero takes damage, falls back for 1 second as expected. Then ordered again. There are no problem since here. But after they will ordered again, i want to PREVENT them fall back again just for 1 or 2 seconds.

Current trigger

12:51 - Hero attacked and fall back
12:52 - Fall back completed, now hero can attack
12:53 - Hero attacked again and fall back
12:54 - Fall back completed, now hero can attack
12:55 - Hero attacked again and fall back

It goes on FOREVER

This is what i want

12:51 - Hero attacked and fall back
12:52 - Fall back completed, now hero can attack
12:53 - Hero attacked again but recently ordered again, do NOTHING! Let him fight again at least 2 seconds
12:54 -
12:55 - Hero attacked and fall back
 
Last edited:
Level 9
Joined
Dec 13, 2009
Messages
216
Does this not work?

  • Events
    • Unit - A unit Is attacked
  • Conditions
    • (Attacked unit) Equal to zU_AIHero[12]
    • ((Attacked unit) is in zUG_RegenReaper) Equal to False
    • ((Attacking unit) is in zUG_CreepsDevil) Equal to True
    • zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] Equal to False
    • (Level of (Attacked unit)) Less than or equal to 21
  • Actions
    • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = True
    • Set TempPoint = ((Position of (Attacked unit)) offset by 375.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])) - 0.00) degrees)
    • Unit - Order (Attacked unit) to Move To TempPoint
    • Custom script: call RemoveLocation (udg_TempPoint)
    • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + Ãœhü vurdular kaçiyom)
    • Wait (2.00 - ((Real((Level of (Attacked unit)))) x 0.10)) seconds
    • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + Ehe kaçmam bitti)
    • Set TempGroup = (Units within 500.00 of (Position of zU_AIHero[12]) matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in TempGroup) Greater than or equal to 1
          • Then - Actions
            • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of NextTarget[(Player number of (Owner of (Attacked unit)))])
            • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + 1 taneden fazla creep var ben savasmaya devam)
          • Else - Actions
            • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + hmmm creep yok )
            • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])
    • Custom script: call DestroyGroup (udg_TempGroup)
    • Wait 2.00 seconds
    • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = False
 
From what you describe, you would have to make a timer that ticks a boolean (bHasFleed to true/false) and once the timer runs out, it switches the boolean again, enabling the previous trigger to run again (for the unit to flee).

I would however say that the way you are doing it right now seems quite inefficient, I'd recommend not making each unit have their own "system" written, but have a system implemented that just retrieves unit variables (essentially one trigger that only refers to variables), this however means you cannot use "waits" but you need to use timers instead, and make timers unit-indexes. This might be out of your skill scope though.

Also note, that "Unit is attacked" does not trigger when the unit takes damage, but when another unit is ordered to "Attack" the unit.
 

Uncle

Warcraft Moderator
Level 42
Joined
Aug 10, 2018
Messages
4,198
From what you describe, you would have to make a timer that ticks a boolean (bHasFleed to true/false) and once the timer runs out, it switches the boolean again, enabling the previous trigger to run again (for the unit to flee).

I would however say that the way you are doing it right now seems quite inefficient, I'd recommend not making each unit have their own "system" written, but have a system implemented that just retrieves unit variables (essentially one trigger that only refers to variables), this however means you cannot use "waits" but you need to use timers instead, and make timers unit-indexes. This might be out of your skill scope though.

Also note, that "Unit is attacked" does not trigger when the unit takes damage, but when another unit is ordered to "Attack" the unit.
He doesn't really need timers though. He can just delete this condition:
  • (Attacked unit) Equal to zU_AIHero[12]
And replace it with something like this to determine whether or not the unit was a bot:
  • Level of Bot Classification for (Attacked unit) Equal to 1
This would be a hidden passive ability that serves as a Classification.

Then assuming that each Bot is owned by a different player, and each player only owns 1 Bot, then everything will work fine.

Something like this:
  • Events
    • Unit - A unit Is attacked
  • Conditions
    • (Level of Bot Classification for (Attacked unit)) Equal to 1
    • zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] Equal to False
    • (Level of (Attacked unit)) Less than or equal to 21
    • ((Attacked unit) is in zUG_RegenReaper) Equal to False
    • ((Attacking unit) is in zUG_CreepsDevil) Equal to True
  • Actions
    • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = True
    • Set TempPoint = ((Position of (Attacked unit)) offset by 375.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])) - 0.00) degrees)
    • Unit - Order (Attacked unit) to Move To TempPoint
    • Custom script: call RemoveLocation (udg_TempPoint)
    • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + Ãœhü vurdular kaçiyom)
    • Wait (2.00 - ((Real((Level of (Attacked unit)))) x 0.10)) seconds
    • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + Ehe kaçmam bitti)
    • Set TempGroup = (Units within 500.00 of (Position of (Attacked unit) matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in TempGroup) Greater than or equal to 1
          • Then - Actions
            • Unit - Order (Attacked unit) to Attack-Move To (Center of NextTarget[(Player number of (Owner of (Attacked unit)))])
            • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + 1 taneden fazla creep var ben savasmaya devam)
          • Else - Actions
            • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + hmmm creep yok )
            • Unit - Order (Attacked unit) to Attack-Move To (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])
    • Custom script: call DestroyGroup (udg_TempGroup)
    • Wait 2.00 seconds
    • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = False
There's also a bunch of Point leaks throughout the trigger. Anywhere there is (Center of region) or (Position of unit) it's leaking a Point.

You would need to do something like this for the first TempPoint:
  • Set AttackingPos = (Position of (Attacking unit))
  • Set AttackedPos = (Position of (Attacked unit))
  • Set PreviousPos = (Center of PreviousTarget[(Player number...]))
  • Set TempPoint = (AttackedPos offset by 375.00 towards (Angle from AttackingPos to PreviousPos) degrees)
  • Custom script: call RemoveLocation(udg_AttackingPos)
  • Custom script: call RemoveLocation(udg_AttackedPos)
  • Custom script: call RemoveLocation(udg_PreviousPos)
Then fix the leak in TempGroup:
  • Set AttackedPos = (Position of (Attacked unit))
  • Set TempGroup = (Units within 500.00 of (AttackedPos matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
  • Custom script: call RemoveLocation(udg_AttackedPos)
And lastly fix the leaks when you order the unit to Attack-Move to Next/Previous Target:
  • Set TempPoint = (Center of NextTarget[(Player number of (Owner of (Attacked unit))]
  • Unit - Order (Attacked unit) to Attack-Move To TempPoint
  • Custom script: call RemoveLocation(udg_AttackedPos)
 
Last edited:
Level 13
Joined
Jun 2, 2009
Messages
711
He doesn't really need timers though. He can just delete this condition:
  • (Attacked unit) Equal to zU_AIHero[12]
And replace it with something like this to determine whether or not the unit was a bot:
  • Level of Bot Classification for (Attacked unit) Equal to 1
This would be a hidden passive ability that serves as a Classification.

Then assuming that each Bot is owned by a different player, and each player only owns 1 Bot, then everything will work fine.

Something like this:
  • Events
    • Unit - A unit Is attacked
  • Conditions
    • (Level of Bot Classification for (Attacked unit)) Equal to 1
    • zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] Equal to False
    • (Level of (Attacked unit)) Less than or equal to 21
    • ((Attacked unit) is in zUG_RegenReaper) Equal to False
    • ((Attacking unit) is in zUG_CreepsDevil) Equal to True
  • Actions
    • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = True
    • Set TempPoint = ((Position of (Attacked unit)) offset by 375.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])) - 0.00) degrees)
    • Unit - Order (Attacked unit) to Move To TempPoint
    • Custom script: call RemoveLocation (udg_TempPoint)
    • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + Ãœhü vurdular kaçiyom)
    • Wait (2.00 - ((Real((Level of (Attacked unit)))) x 0.10)) seconds
    • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + Ehe kaçmam bitti)
    • Set TempGroup = (Units within 500.00 of (Position of (Attacked unit) matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in TempGroup) Greater than or equal to 1
          • Then - Actions
            • Unit - Order (Attacked unit) to Attack-Move To (Center of NextTarget[(Player number of (Owner of (Attacked unit)))])
            • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + 1 taneden fazla creep var ben savasmaya devam)
          • Else - Actions
            • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + hmmm creep yok )
            • Unit - Order (Attacked unit) to Attack-Move To (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])
    • Custom script: call DestroyGroup (udg_TempGroup)
    • Wait 2.00 seconds
    • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = False
There's also a bunch of Point leaks throughout the trigger. Anywhere there is (Center of region) or (Position of unit) it's leaking a Point.

You would need to do something like this for the first TempPoint:
  • Set AttackingPos = (Position of (Attacking unit))
  • Set AttackedPos = (Position of (Attacked unit))
  • Set PreviousPos = (Center of PreviousTarget[(Player number...]))
  • Set TempPoint = (AttackedPos offset by 375.00 towards (Angle from AttackingPos to PreviousPos) degrees)
  • Custom script: call RemoveLocation(udg_AttackingPos)
  • Custom script: call RemoveLocation(udg_AttackedPos)
  • Custom script: call RemoveLocation(udg_PreviousPos)
Then fix the leak in TempGroup:
  • Set AttackedPos = (Position of (Attacked unit))
  • Set TempGroup = (Units within 500.00 of (AttackedPos matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
  • Custom script: call RemoveLocation(udg_AttackedPos)
And lastly fix the leaks when you order the unit to Attack-Move to Next/Previous Target:
  • Set TempPoint = (Center of NextTarget[(Player number of (Owner of (Attacked unit))]
  • Unit - Order (Attacked unit) to Attack-Move To TempPoint
  • Custom script: call RemoveLocation(udg_AttackedPos)
This looks fine but is something wrong happens if another hero attacked? Because it has wait actions. Does it works for all players?
 
This looks fine but is something wrong happens if another hero attacked? Because it has wait actions. Does it works for all players?
Yes, it only works for one instance with the WAIT. That is why I said you need to use unit indexed timers instead.
If you do not run a condition check on which unit is being attacked, then everytime a unit is attacked (with the waits) then the unit being referred to will be changed.
 
Level 13
Joined
Jun 2, 2009
Messages
711
Yes, it only works for one instance with the WAIT. That is why I said you need to use unit indexed timers instead.
If you do not run a condition check on which unit is being attacked, then everytime a unit is attacked (with the waits) then the unit being referred to will be changed.
I think i am gonna make it for all 10 slots separately.
So this will gonna work for AIHero[2]

  • DevilHerodanKacP88
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacked unit) Equal to zU_AIHero[8]
      • ((Attacked unit) is in zUG_RegenReaper) Equal to False
      • ((Attacking unit) is in zUG_CreepsDevil) Equal to True
      • zBool_AIKaciyor_Creepten[8] Equal to False
      • (Level of (Attacked unit)) Less than or equal to 21
    • Actions
      • Set zBool_AIKaciyor_Creepten[8] = True
      • Set TempPoint = ((Position of (Attacked unit)) offset by 375.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])) - 0.00) degrees)
      • Unit - Order (Attacked unit) to Move To TempPoint
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Wait 1.00 seconds
      • Set TempGroup = (Units within 500.00 of (Position of zU_AIHero[8]) matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in TempGroup) Greater than or equal to 1
            • Then - Actions
              • Unit - Order zU_AIHero[8] to Attack-Move To (Center of NextTarget[8])
            • Else - Actions
              • Unit - Order zU_AIHero[8] to Attack-Move To (Center of PreviousTarget[8])
      • Wait 2.00 seconds
      • Set zBool_AIKaciyor_Creepten[8] = False
      • Custom script: call DestroyGroup (udg_TempGroup)
I want to test it first. If it is works for each 10 slots, i will request aid for better version of this trigger. But i want to test it first and see what is happening. But of course still you can show me the trigger if you already created. I don't know about unit indexer. If you let me do that, probably i will create 20 triggers (10 timer, 10 fall back trigger just like this)
 
Level 9
Joined
Dec 13, 2009
Messages
216
Yes, it only works for one instance with the WAIT. That is why I said you need to use unit indexed timers instead.
If you do not run a condition check on which unit is being attacked, then everytime a unit is attacked (with the waits) then the unit being referred to will be changed.
(Attacked unit) does not change even when another trigger fires, and it's the only reference in the trigger that needs to persist through waits.
 

Uncle

Warcraft Moderator
Level 42
Joined
Aug 10, 2018
Messages
4,198
Yes, it only works for one instance with the WAIT. That is why I said you need to use unit indexed timers instead.
If you do not run a condition check on which unit is being attacked, then everytime a unit is attacked (with the waits) then the unit being referred to will be changed.
(Attacked unit) should act like a local variable.
 
Level 13
Joined
Jun 2, 2009
Messages
711
Hmmm. Yes it not works properly. I am checking debug messages and not works as i expected.

  • First of all it has fall back for 1 second
  • Then it has fight back for 1 second even if it takes damage
  • After 1 seconds still it is taking damage, fall back again.

But not works properly.

  • DevilCreeptenKac
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacked unit) Equal to Paladin 0000 <gen>
      • zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] Equal to False
    • Actions
      • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = True
      • Set TempPoint = ((Position of (Attacked unit)) offset by 375.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])) - 0.00) degrees)
      • Unit - Order (Attacked unit) to Move To TempPoint
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Wait 1.00 seconds
      • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of Region 000 <gen>)
      • Wait 1.00 seconds
      • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = False
  • Untitled Trigger 001
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • zBool_AIKaciyor_Creepten[1] Equal to True
        • Then - Actions
          • Game - Display to (All players) for 1.00 seconds the text: TRUE
        • Else - Actions
          • Game - Display to (All players) for 1.00 seconds the text: FALSE
Here is the full version of my trigger in my map. This one is important one because i will gonna work on this.

  • DevilCreeptenKac
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) is in zUG_RegenALL) Equal to False
      • ((Attacked unit) is in HerolarBotDevil) Equal to True
      • ((Attacking unit) is in zUG_CreepsReaper) Equal to True
      • zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] Equal to False
      • (Level of (Attacked unit)) Less than or equal to 21
    • Actions
      • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = True
      • Set TempPoint = ((Position of (Attacked unit)) offset by 375.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])) - 0.00) degrees)
      • Unit - Order (Attacked unit) to Move To TempPoint
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + Ãœhü vurdular kaçiyom)
      • Wait (2.00 - ((Real((Level of (Attacked unit)))) x 0.10)) seconds
      • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = False
      • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + Ehe kaçmam bitti)
      • Set TempGroup = (Units within 500.00 of (Position of (Attacked unit)) matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in TempGroup) Greater than or equal to 1
            • Then - Actions
              • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of NextTarget[(Player number of (Owner of (Attacked unit)))])
              • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + 1 taneden fazla creep var ben savasmaya devam)
            • Else - Actions
              • Game - Display to DebugGroup3 for 1.00 seconds the text: (PlayerNames[(Player number of (Owner of (Attacked unit)))] + hmmm creep yok )
              • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Wait 2.00 seconds
      • Set zBool_AIKaciyor_Creepten[(Player number of (Owner of (Attacked unit)))] = False
 

Attachments

  • test3333.w3x
    18 KB · Views: 3
Level 9
Joined
Dec 13, 2009
Messages
216
What is the PreviousTarget variable? It is not set anywhere in your test map, so it just defaults to the center of the map. I think the line
  • Set TempPoint = ((Position of (Attacked unit)) offset by 375.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])) - 0.00) degrees)
is the one that's not correct. If I change it like I did in the map attached, the hero behaves in the way I think you want it to.
 

Attachments

  • test3333_antaresEdit.w3x
    19 KB · Views: 2
Level 13
Joined
Jun 2, 2009
Messages
711
What is the PreviousTarget variable? It is not set anywhere in your test map, so it just defaults to the center of the map. I think the line
  • Set TempPoint = ((Position of (Attacked unit)) offset by 375.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])) - 0.00) degrees)
is the one that's not correct. If I change it like I did in the map attached, the hero behaves in the way I think you want it to.
Hmmm yes you are right. Now i can change it as something for the test purpose. By the way i cannot open this map on previous version. We are playing some of my maps at Gameranger and my friends have an old version.
 
Top