[Solved] How can i debug this one? (based on local integer)

Level 18
Joined
Jun 2, 2009
Messages
1,276
Question 1: Should i create pn2 integer in the variables for this? It seems it works without creating pn2 integer
Question 2: How can i check slot number after 2 seconds wait as condition? (i can if i will create pn2 variable but check the first question please)
Because my map is huge and exporting triggers on empty map and i will work on them on empty map. But before i do that i want to see both Player 3 and Player 4 slots separately. I am changing floating text in the map for the inspection.

I was created ai system for my moba map but everytime 1 or more triggers not turning off and bots are stucking...
This is custom trigger (i am not experienced about that) this is why i am asking. Still i am trying to create my testing environment.

  • run creep n tower
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • fAI_run_hero[(Player number of (Owner of DamageEventTarget))] Equal to False
      • (DamageEventTarget is in HerolarBotALL) Equal to True
    • Actions
      • Custom script: local integer pn2 = GetConvertedPlayerId(GetOwningPlayer(udg_DamageEventTarget))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventSource is A structure) Equal to True
        • Then - Actions
          • Custom script: set udg_fAI_run_creep[pn2] = true
          • Set TempPoint = (Center of PreviousTarget[(Player number of (Owner of DamageEventTarget))])
          • Unit - Order DamageEventTarget to Move To TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Floating Text - Change text of Floatlar[1] to fAi_run_creep |cfff... using font size 10.00
          • Wait 2.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HOW CAN I CHECK WHICH fAI_run_creep[pn2] ENDS IN HERE? 3 or 4?
            • Then - Actions
            • Else - Actions
          • Custom script: set udg_fAI_run_creep[pn2] = false
          • Floating Text - Change text of Floatlar[1] to fAi_run_creep |cff0... using font size 10.00
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget is in zUG_RegenALL) Equal to False
              • (Level of DamageEventTarget) Less than or equal to 21
              • Or - Any (Conditions) are true
                • Conditions
                  • (DamageEventSource is in zUG_CreepsDevil) Equal to True
                  • (DamageEventSource is in zUG_CreepsReaper) Equal to True
            • Then - Actions
              • Custom script: set udg_fAI_run_creep[pn2] = true
              • Set TempPoint2 = (Position of DamageEventTarget)
              • Set TempPoint3 = (Center of PreviousTarget[(Player number of (Owner of DamageEventTarget))])
              • Set TempPoint = (TempPoint2 offset by 375.00 towards (Angle from TempPoint2 to TempPoint3) degrees)
              • Unit - Order DamageEventTarget to Move To TempPoint
              • Custom script: call RemoveLocation (udg_TempPoint)
              • Custom script: call RemoveLocation (udg_TempPoint2)
              • Custom script: call RemoveLocation (udg_TempPoint3)
              • Wait 1.00 seconds
              • Custom script: set udg_fAI_run_creep[pn2] = false
            • Else - Actions
 
You can always set a global variable to be equal to a local variable. Then you can work with it like you're used to:
  • Wait 2.00 seconds
  • Custom script: set udg_PN = pn2
  • Set fAI_run_creep[PN] = False
PN in this example is an Integer variable. Here's another example of doing this:
  • Wait 0.10 seconds
  • Custom script: set udg_PN = pn2
  • Set fAI_run_creep[PN] = False
  • Wait 0.10 seconds
  • Custom script: set udg_PN = pn2
  • Set fAI_run_creep[PN] = True

Also, your Conditions aren't checking if udg_fAI_run_creep is set to False, so this trigger can run multiple times for the same unit and create a bunch of instances all fighting with one another.

Another thing, have you thought about using ONE Boolean variable to determine if a Unit is running away?
  • Events
    • ...
  • Conditions
    • fAI_Unit_Is_Fleeing[PN] Equal to False
  • Actions
    • Set fAI_Unit_Is_Fleeing[PN] = True
^ This would probably make things easier.
 
Last edited:
I am sorry. Second action is run_creep. Not run_hero.

  • run creep n tower Copy
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • fAI_run[(Player number of (Owner of (Triggering unit)))] Equal to False
    • Actions
      • Custom script: local integer pn2 = GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))
      • Custom script: set udg_fAI_run[pn2] = true
      • Set pn2 = (Player number of (Owner of (Triggering unit)))
      • Wait 4.00 seconds
      • Custom script: set udg_fAI_run[pn2] = false
      • Game - Display to (All players) for 1.00 seconds the text: (String(pn2))
I made some tests and it overrides the numbers. When i getting attacked with Player 2 and Player 3 Hero, it says 3 and 3. But i was expecting 2 and 3.

Another thing, have you thought about using ONE Boolean variable to determine if a Unit is running away?
Yes this is why i have started to delete variables like (run hero, run tower, run creep, run lord bla bla) because i need only one condition that checking BOT running away for a reason or not.

When enemy creep attacking you, you have to fall back for x seconds
When enemy tower attacking you, you have to fall back for x seconds
When enemy hero attacking you, you have to fall back for x seconds
When lord attacking you, you have to fall back for x seconds
When there are 2 or less creeps attacked by towers around you, you have to fall back for x seconds
When you try to cast spell enemy hero when enemy tower within range, you have to fall back for x seconds
 
Last edited:
I'm not too sure what you're trying to do in that trigger but if you want to Debug it you should do it like this:
  • run creep n tower Copy
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • fAI_run[(Player number of (Owner of (Triggering unit)))] Equal to False
    • Actions
      • Custom script: local integer pn2 = GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))
      • Custom script: set udg_fAI_run[pn2] = true
      • Custom script: set udg_PN = pn2
      • Game - Display to (All players) for 30.00 seconds the text: ((String(PN)) + = TRUE)
      • Wait 4.00 seconds
      • Custom script: set udg_fAI_run[pn2] = false
      • Custom script: set udg_PN = pn2
      • Game - Display to (All players) for 30.00 seconds the text: ((String(PN)) + = FALSE)
But you don't even need a local variable in this trigger since (Triggering unit) already works like a local variable:
  • run creep n tower Copy
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • fAI_run[(Player number of (Owner of (Triggering unit)))] Equal to False
    • Actions
      • Set PN = ((Player number of (Owner of (Triggering unit)))
      • Set fAI_run[PN] = true
      • Game - Display to (All players) for 30.00 seconds the text: ((String(PN)) + = TRUE)
      • Wait 4.00 seconds
      • Set PN = ((Player number of (Owner of (Triggering unit)))
      • Set fAI_run[PN] = false
      • Game - Display to (All players) for 30.00 seconds the text: ((String(PN)) + = FALSE)
 
Since 3 years my bots are stucking somehow. Currently i am creating debug system just like this.
Currently i did something like this. This seems works but can you see any problem in there?

  • run creep and tower
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • fAI_run[(Player number of (Owner of DamageEventTarget))] Equal to False
      • (DamageEventTarget is in HerolarBotALL) Equal to True
    • Actions
      • Custom script: local integer pn2 = GetConvertedPlayerId(GetOwningPlayer(udg_DamageEventTarget))
      • Custom script: set udg_fAI_run[pn2] = true
      • Custom script: set udg_PN = pn2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventSource is A structure) Equal to True
        • Then - Actions
          • Set TempPoint = (Center of PreviousTarget[(Player number of (Owner of DamageEventTarget))])
          • Unit - Order DamageEventTarget to Move To TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PN Equal to 3
            • Then - Actions
              • Floating Text - Change text of Floatlar[1] to |cff00ff00True|r using font size 10.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PN Equal to 4
            • Then - Actions
              • Floating Text - Change text of Floatlar[4] to |cff00ff00True|r using font size 10.00
            • Else - Actions
          • Wait 2.00 seconds
          • Custom script: set udg_fAI_run[pn2] = false
          • Custom script: set udg_PN = pn2
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PN Equal to 3
              • fAI_run[PN] Equal to False
            • Then - Actions
              • Floating Text - Change text of Floatlar[1] to |cffff0000False|r using font size 10.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PN Equal to 4
              • fAI_run[PN] Equal to False
            • Then - Actions
              • Floating Text - Change text of Floatlar[4] to |cffff0000False|r using font size 10.00
            • Else - Actions
        • Else - Actions
fAI_run[p2] turns True for damaged unit.
Trigger waits 2 seconds
Then fAI_run[p2] turns false.

@Uncle If you say "no problem in here" i will do this for every boolean and every unit group. Just tell me "it is correct, you are ready for debugging" :(
 

Attachments

  • false.png
    false.png
    271.6 KB · Views: 24
That looks fine to me.

If you want you can also design it like this:
  • run creep and tower
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • fAI_run[(Player number of (Owner of DamageEventTarget))] Equal to False
      • (DamageEventTarget is in HerolarBotALL) Equal to True
    • Actions
      • Custom script: local integer pn2
      • Set PN = (Player number of (Owner of DamageEventTarget))
      • Custom script: set pn2 = udg_PN
      • Custom script: set udg_fAI_run[pn2] = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventSource is A structure) Equal to True
        • Then - Actions
          • Set TempPoint = (Center of PreviousTarget[PN])
          • Unit - Order DamageEventTarget to Move To TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PN Equal to 3
            • Then - Actions
              • Floating Text - Change text of Floatlar[1] to |cff00ff00True|r using font size 10.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PN Equal to 4
            • Then - Actions
              • Floating Text - Change text of Floatlar[4] to |cff00ff00True|r using font size 10.00
            • Else - Actions
          • Wait 2.00 seconds
          • Custom script: set udg_fAI_run[pn2] = false
          • Custom script: set udg_PN = pn2
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PN Equal to 3
              • fAI_run[PN] Equal to False
            • Then - Actions
              • Floating Text - Change text of Floatlar[1] to |cffff0000False|r using font size 10.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PN Equal to 4
              • fAI_run[PN] Equal to False
            • Then - Actions
              • Floating Text - Change text of Floatlar[4] to |cffff0000False|r using font size 10.00
            • Else - Actions
        • Else - Actions
This way you don't have to use that "GetConvertedPlayerId(GetOwningPlayer())" crap.

Also, if you actually got rid of the Else - Actions section of the trigger then you can delete the "If Then Else" and change your Conditions.

So something like this:
  • Conditions
    • fAI_run[(Player number of (Owner of DamageEventTarget))] Equal to False
    • (DamageEventSource is A structure) Equal to True
    • (DamageEventTarget is in HerolarBotALL) Equal to True
 
Last edited:
During the tests in the empty map, this fAI_Run turns true and false without any issue.
But after i extracted triggers in my main map carefully, they will start running, turns on and NEVER turns off again.
After spending few days first time i said "it is done finally, 3 years old torment is over" but it does not work in my main map.

Am i missing something important?

  • RunBOT
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • fAI_run[(Player number of (Owner of DamageEventTarget))] Equal to False
      • (DamageEventTarget is in zUG_RegenALL) Equal to False
      • (DamageEventSource belongs to an enemy of (Owner of DamageEventTarget)) Equal to True
      • (DamageEventTarget is in HerolarBotALL) Equal to True
    • Actions
      • Custom script: local integer pn2
      • Set PN3 = (Player number of (Owner of DamageEventTarget))
      • Custom script: set pn2 = udg_PN3
      • Custom script: set udg_fAI_run[pn2] = true
      • -------- Tower 2 sec --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventSource is A structure) Equal to True
        • Then - Actions
          • Set TempPoint = (Center of PreviousTarget[PN3])
          • Unit - Order DamageEventTarget to Move To TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Wait 2.00 seconds
          • Custom script: set udg_fAI_run[pn2] = false
          • Custom script: set udg_PN3 = pn2
        • Else - Actions
      • -------- Creep 1 sec --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of DamageEventTarget) Less than or equal to 21
          • Or - Any (Conditions) are true
            • Conditions
              • (DamageEventSource is in zUG_CreepsDevil) Equal to True
              • (DamageEventSource is in zUG_CreepsReaper) Equal to True
        • Then - Actions
          • Set TempPoint2 = (Position of DamageEventTarget)
          • Set TempPoint3 = (Center of PreviousTarget[(Player number of (Owner of DamageEventTarget))])
          • Set TempPoint = (TempPoint2 offset by 375.00 towards (Angle from TempPoint2 to TempPoint3) degrees)
          • Unit - Order DamageEventTarget to Move To TempPoint
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call RemoveLocation (udg_TempPoint2)
          • Custom script: call RemoveLocation (udg_TempPoint3)
          • Wait 1.00 seconds
          • Custom script: set udg_fAI_run[pn2] = false
          • Custom script: set udg_PN3 = pn2
        • Else - Actions
      • -------- Hero 2 sec --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventSource is A Hero) Equal to True
        • Then - Actions
          • Set xINT_TEMP[(Player number of (Owner of DamageEventSource))] = (Level of DamageEventSource)
          • Set xINT_TEMP2[(Player number of (Owner of DamageEventTarget))] = (Level of DamageEventTarget)
          • Set TempInt = (xINT_TEMP[(Player number of (Owner of DamageEventSource))] - xINT_TEMP2[(Player number of (Owner of DamageEventTarget))])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempInt Greater than or equal to 3
            • Then - Actions
              • Unit - Order DamageEventTarget to Move To TempPoint2
              • Set TempPoint = (Center of PreviousTarget[PN3])
              • Unit - Order DamageEventTarget to Move To TempPoint
              • Custom script: call RemoveLocation (udg_TempPoint)
              • Custom script: call RemoveLocation (udg_TempPoint2)
              • Wait 2.00 seconds
              • Custom script: set udg_fAI_run[pn2] = false
              • Custom script: set udg_PN3 = pn2
            • Else - Actions
        • Else - Actions
Side note: I am using these variables in different triggers. It does makes sense? Or should i create PN5 PN6 PN7 bla bla for every trigger? Currently i am badly demoralized.
 
It's smart to put a unique PN variable in this trigger, but you don't necessarily have to do it for every trigger.

Anyway, you're not using the Else - Actions section of your If Then Elses, which you need to use. Do you understand how that works?

You have four different outcomes. You ONLY want ONE of them to happen at any time.

You either:
1) Run from a tower.
2) OR run from a creep.
3) OR run from a hero.
4) OR nothing happens because the (Damage source) was not one of those three.

  • RunBOT
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • fAI_run[(Player number of (Owner of DamageEventTarget))] Equal to False
      • (DamageEventTarget is in zUG_RegenALL) Equal to False
      • (DamageEventSource belongs to an enemy of (Owner of DamageEventTarget)) Equal to True
      • (DamageEventTarget is in HerolarBotALL) Equal to True
    • Actions
      • Custom script: local integer pn
      • Set PN = (Player number of (Owner of DamageEventTarget))
      • Custom script: set pn = udg_PN
      • -------- Tower 2 sec --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventSource is A structure) Equal to True
        • Then - Actions
          • Custom script: set udg_fAI_run[pn] = true
          • Set TempPoint = (Center of PreviousTarget[PN])
          • Unit - Order DamageEventTarget to Move To TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Wait 2.00 seconds
          • Custom script: set udg_fAI_run[pn] = false
        • Else - Actions
          • -------- Creep 1 sec --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of IsCreep for DamageEventSource) Greater than 0
              • (Level of DamageEventTarget) Less than or equal to 21
            • Then - Actions
              • Custom script: set udg_fAI_run[pn] = true
              • Set TempPoint2 = (Position of DamageEventTarget)
              • Set TempPoint3 = (Center of PreviousTarget[PN])
              • Set TempPoint = (TempPoint2 offset by 375.00 towards (Angle from TempPoint2 to TempPoint3) degrees)
              • Unit - Order DamageEventTarget to Move To TempPoint
              • Custom script: call RemoveLocation (udg_TempPoint)
              • Custom script: call RemoveLocation (udg_TempPoint2)
              • Custom script: call RemoveLocation (udg_TempPoint3)
              • Wait 1.00 seconds
              • Custom script: set udg_fAI_run[pn] = false
            • Else - Actions
              • -------- Hero 2 sec --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (DamageEventSource is A Hero) Equal to True
                  • ((Level of DamageEventSource) - (Level of DamageEventTarget)) Greater than or equal to 3
                • Then - Actions
                  • Custom script: set udg_fAI_run[pn] = true
                  • Unit - Order DamageEventTarget to Move To TempPoint2
                  • Set TempPoint = (Center of PreviousTarget[PN])
                  • Unit - Order DamageEventTarget to Move To TempPoint
                  • Custom script: call RemoveLocation (udg_TempPoint)
                  • Custom script: call RemoveLocation (udg_TempPoint2)
                  • Wait 2.00 seconds
                  • Custom script: set udg_fAI_run[pn] = false
              • Else - Actions
Note that I made your Creep detection a lot more efficient by checking for a custom ability on the DamageEventSource. The idea is to give your Creeps in the Object Editor the IsCreep ability. You should base it on Storm Hammers and set it's Art - Button Positions to 0,-11 so that it's hidden.

I recommend doing the same thing with this Bot check as well:
  • (DamageEventTarget is in HerolarBotALL) Equal to True
  • (Level of IsBot for DamageEventTarget) Greater than 0
It's much faster to check for an Ability then to loop through an entire Unit Group trying to find if your Unit is in it.
 
Last edited:
Yes, they will fall back when one of those actions happens. But is it not setting run_creep True?
When you get damaged from tower it turns True and dmg_creep and dmg_hero will not going to work. Because it is true.
If the hero getting damaged by tower they are running away for 2 seconds and if they will take damage from creeps nothing happens and this is not a problem. Hero is already retreating.

@Uncle I will implement your changes but i need answers as well

Why this trigger works 100% in the test map
But why not works in my main map? Are variables conflict with each other?

Sometimes finding what is wrong with the trigger is far better than solution. I want to learn and improve. I am sure you appreciate that.
 
You have other triggers causing problems. I can't tell you which ones, so you'll have to look around for anything that:

1) Sets fAI_run to True/False.
2) Interrupts orders.
3) Issues orders.

Things that interrupt orders -> Stuns, Roots, Pausing, Hiding/Unhiding, New Orders.

The Computer's own AI could interfere as well.
 
Currently listed just like this

  • RunBOT Copy
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • fAI_run[(Player number of (Owner of DamageEventTarget))] Equal to False
      • (DamageEventTarget is in zUG_RegenALL) Equal to False
      • (DamageEventSource belongs to an enemy of (Owner of DamageEventTarget)) Equal to True
      • (DamageEventTarget is in HerolarBotALL) Equal to True
    • Actions
      • Custom script: local integer pn2
      • Set PN3 = (Player number of (Owner of DamageEventTarget))
      • Custom script: set pn2 = udg_PN3
      • Custom script: set udg_fAI_run[pn2] = true
      • -------- Tower 2 sec --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventSource is A structure) Equal to True
        • Then - Actions
          • Set TempPoint = (Center of PreviousTarget[PN3])
          • Unit - Order DamageEventTarget to Move To TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Wait 2.00 seconds
          • Custom script: set udg_fAI_run[pn2] = false
          • Custom script: set udg_PN3 = pn2
        • Else - Actions
          • -------- Creep 1 sec --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of DamageEventTarget) Less than or equal to 21
              • Or - Any (Conditions) are true
                • Conditions
                  • (DamageEventSource is in zUG_CreepsDevil) Equal to True
                  • (DamageEventSource is in zUG_CreepsReaper) Equal to True
            • Then - Actions
              • Set TempPoint2 = (Position of DamageEventTarget)
              • Set TempPoint3 = (Center of PreviousTarget[(Player number of (Owner of DamageEventTarget))])
              • Set TempPoint = (TempPoint2 offset by 375.00 towards (Angle from TempPoint2 to TempPoint3) degrees)
              • Unit - Order DamageEventTarget to Move To TempPoint
              • Custom script: call RemoveLocation (udg_TempPoint)
              • Custom script: call RemoveLocation (udg_TempPoint2)
              • Custom script: call RemoveLocation (udg_TempPoint3)
              • Wait 1.00 seconds
              • Custom script: set udg_fAI_run[pn2] = false
              • Custom script: set udg_PN3 = pn2
            • Else - Actions
              • -------- Hero 2 sec --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (DamageEventSource is A Hero) Equal to True
                • Then - Actions
                  • Set xINT_TEMP[(Player number of (Owner of DamageEventSource))] = (Level of DamageEventSource)
                  • Set xINT_TEMP2[(Player number of (Owner of DamageEventTarget))] = (Level of DamageEventTarget)
                  • Set TempInt = (xINT_TEMP[(Player number of (Owner of DamageEventSource))] - xINT_TEMP2[(Player number of (Owner of DamageEventTarget))])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempInt Greater than or equal to 3
                    • Then - Actions
                      • Unit - Order DamageEventTarget to Move To TempPoint2
                      • Set TempPoint = (Center of PreviousTarget[PN3])
                      • Unit - Order DamageEventTarget to Move To TempPoint
                      • Custom script: call RemoveLocation (udg_TempPoint)
                      • Custom script: call RemoveLocation (udg_TempPoint2)
                      • Wait 2.00 seconds
                      • Custom script: set udg_fAI_run[pn2] = false
                      • Custom script: set udg_PN3 = pn2
                    • Else - Actions
                • Else - Actions
But they are retreating and never their run_ai turning true.
Now i am thinking using "unique" variables for those three. I will update my message after i done.
 

Attachments

  • asd.png
    asd.png
    3 MB · Views: 34
Well, you're still making mistakes in the trigger, it doesn't look like the one I posted. You fixed the If Then Else stuff but there was other important changes. Try to make it look just like mine, although you can ignore the Storm Hammers Ability thingy for now.
 
I will but i realized something. When creeps hit the Heroes it turns True but they are NEVER moving back. Is it can give us a hint? Currently removing many triggers in my map and working on it. It is tedious work. Because i have to optimize and save the map for every test. Still i am working on this terribly boring thing and i will update this post after many tests.

Update 1: I have deleted Tower and Hero attacks, trigger just like this and they are not moving backward. NEVER
I have also removed many conditions. This is the situation. And i will never see this message

game.gif
Game - Display to (All players) for 2.00 seconds the text: ((Name of DamageEventSource) + ( attacking + (Name of DamageEventTarget)))

  • RunBOT Copy Copy Copy Copy Copy Copy
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • fAI_run[(Player number of (Owner of DamageEventTarget))] Equal to False
    • Actions
      • Custom script: local integer pn2
      • Game - Display to (All players) the text: ha
      • Set PN3 = (Player number of (Owner of DamageEventTarget))
      • Custom script: set pn2 = udg_PN3
      • Custom script: set udg_fAI_run[pn2] = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of DamageEventTarget) Less than or equal to 21
          • Or - Any (Conditions) are true
            • Conditions
              • (DamageEventSource is in zUG_CreepsDevil) Equal to True
              • (DamageEventSource is in zUG_CreepsReaper) Equal to True
        • Then - Actions
          • Set TempPoint2 = (Position of DamageEventTarget)
          • Set TempPoint3 = (Center of PreviousTarget[(Player number of (Owner of DamageEventTarget))])
          • Set TempPoint = (TempPoint2 offset by 375.00 towards (Angle from TempPoint2 to TempPoint3) degrees)
          • Game - Display to (All players) for 2.00 seconds the text: ((Name of DamageEventSource) + ( attacking + (Name of DamageEventTarget)))
          • Unit - Order DamageEventTarget to Move To TempPoint
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call RemoveLocation (udg_TempPoint2)
          • Custom script: call RemoveLocation (udg_TempPoint3)
          • Wait 1.00 seconds
          • Custom script: set udg_fAI_run[pn2] = false
          • Custom script: set udg_PN3 = pn2
        • Else - Actions
 
Last edited:
If you aren't seeing the "attacking" Text Message then that means the If - Conditions aren't being met.

So one or more of these isn't working:
  • If - Conditions
    • (Level of DamageEventTarget) Less than or equal to 21
    • Or - Any (Conditions) are true
      • Conditions
        • (DamageEventSource is in zUG_CreepsDevil) Equal to True
        • (DamageEventSource is in zUG_CreepsReaper) Equal to True
If you aren't seeing the "ha" message then fAI_run[] is still True.



Also, not too important, but remember to use your variables.

Bad:
  • Set TempPoint3 = (Center of PreviousTarget[(Player number of (Owner of DamageEventTarget))])
Good:
  • Set TempPoint3 = (Center of PreviousTarget[PN3])
 
My last post has the solution to your problem, and it's one that you need to solve yourself.

You have to make sure that your Conditions are working. In order for them work, you need to make sure that:

1) You're Adding units to the correct Unit Groups -> zUG_CreepsDevil, zUG_CreepsReaper,
2) Your Hero is low enough level -> (Level of DamageEventTarget) Less than or equal to 21.
3) If the Actions aren't running at all then make sure -> fAI_run[(Player number of (Owner of DamageEventTarget))] is set to False.

Remember, you can disable Conditions temporarily to test which ones might not be working. You should also make sure that you don't have other triggers interfering.
 
Back
Top