• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] How can i transfer this one into this (check inside)

Level 17
Joined
Jun 2, 2009
Messages
1,165
My map have a triggers like this

  • TimerKacmaLord
    • Events
      • Time - BotLorddanKacma[2] expires
      • Time - BotLorddanKacma[3] expires
      • Time - BotLorddanKacma[4] expires
      • Time - BotLorddanKacma[5] expires
      • Time - BotLorddanKacma[6] expires
      • Time - BotLorddanKacma[8] expires
      • Time - BotLorddanKacma[9] expires
      • Time - BotLorddanKacma[10] expires
      • Time - BotLorddanKacma[11] expires
      • Time - BotLorddanKacma[12] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if (GetExpiredTimer() == udg_BotLorddanKacma[bj_forLoopAIndex]) then
          • Set zBool_AILorddanKacmaInteger = (Integer A)
          • Custom script: exitwhen true
          • Custom script: endif
      • Set zBool_AIKaciyorLorddan[zBool_AILorddanKacmaInteger] = False
Instead of creating 10 triggers. But still i have few left just like this.

  • DevilHerodanKacP8
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) is in DevilHerolariPlayer) Equal to True
      • (Attacked unit) Equal to zU_AIHero[8]
      • zBool_AIFallBackHERO[8] Equal to False
      • ((Attacked unit) is in zUG_RegenReaper) Equal to False
    • Actions
      • Set xINT_TEMP[8] = (Level of (Attacking unit))
      • Set xINT_TEMP2[8] = (Level of (Attacked unit))
      • Set xINT_TEMP3[8] = (xINT_TEMP[8] - xINT_TEMP2[8])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • xINT_TEMP3[8] Greater than or equal to 3
        • Then - Actions
          • Set zBool_AIFallBackHERO[8] = True
          • Set TempPoint = ((Position of (Attacked unit)) offset by 800.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[8])) - 0.00) degrees)
          • Unit - Order (Attacked unit) to Move To TempPoint
          • Game - Display to PG_Debug for 1.00 seconds the text: (Name of the current trigger)
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Countdown Timer - Start BotHerodanKacma[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 4.00 seconds
          • Wait 4.00 seconds
          • Set zBool_AIFallBackHERO[8] = False
          • Set TempGroup = (Units within 800.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
                  • Game - Display to PG_Debug for 1.00 seconds the text: (Name of the current trigger)
                  • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of NextTarget[8])
                  • Custom script: call DestroyGroup (udg_TempGroup)
                • Else - Actions
                  • Custom script: call DestroyGroup (udg_TempGroup)
        • Else - Actions
As you can see there is a Wait action and this is why i was created this 10 times for per slots.

Now i want to implement it just like my first trigger but i am not good at custom scripts.

How can i shrink this triggers (this is for player 8) for all players jus like the first trigger?
 
Level 39
Joined
Feb 27, 2007
Messages
5,057
I and others have explained multiple times why A Unit is Attacked is a bad event that you should not use. In this case it may matter less if the attacking units are not controlled by players, though I still do not advocate for its use.

The Wait allows variables to be overwritten while multiple trigger instances are running. I’m sure you’re going to give up when I link this, but I think you need some variant of this method: local udg_
 
Level 17
Joined
Jun 2, 2009
Messages
1,165
I and others have explained multiple times why A Unit is Attacked is a bad event that you should not use. In this case it may matter less if the attacking units are not controlled by players, though I still do not advocate for its use.

The Wait allows variables to be overwritten while multiple trigger instances are running. I’m sure you’re going to give up when I link this, but I think you need some variant of this method: local udg_
Yes that is right you know me now. When i decide to answer of my question beyond my intelligence, i am giving up and telling people that. When I do this, i do not waste people's time. Yes i have no idea about local udg_ i read and downloaded the map and i do not understand.
I just want to detect which timer expired for which player in one trigger. No more i can learn new things after specific age. Because i am stupid person. I am living with the knowledge that i have already learned before.
Looking for solution.
 
Level 25
Joined
Sep 26, 2009
Messages
2,402
Trigger #1
Why not just do this instead:
  • TimerKacmaLord
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if (GetExpiredTimer() == udg_BotLorddanKacma[bj_forLoopAIndex]) then
          • Set zBool_AIKaciyorLorddan[(Integer A)] = False
          • Custom script: exitwhen true
          • Custom script: endif
Trigger #2
If I understand this correctly, if a unit owned by DevilHerolariPlayer is attacked and the attacker is 3 or more levels above the attacked unit, then the attacked unit will retreat. Unit cannot retreat more often than once every 4 seconds.

If so, there is no need to create complicated triggers. Not to mention using timers in the way you use them in Trigger #1 will not work correctly, as that approach is not MUI.
what @Pyrogasm linked is really the solution. It is enough to use the same approach as they have in 'test1' trigger in the linked map's description.
But to describe it, what you need to do is:
  • create a unit variable. Let's call it DevilHerodanKacP8Unit.
  • At the start of your DevilHerodanKacP8 use the following line:
    • Custom script: local unit udg_DevilHerodanKacP8Unit
  • Note that the name must be exactly the same, just prefixed with 'udg_'
  • Before wait, assign the (Attacked unit) into DevilHerodanKacP8Unit variable.
  • After wait, refer to (Attacked unit) via DevilHerodanKacP8Unit variable.
  • At the end of the trigger null the local variable via
    • Custom script: set udg_DevilHerodanKacP8Unit = null

Your trigger currently leaks the following locations:
  • (Position of (Attacked unit))
  • (Position of (Attacking unit))
  • (Center of PreviousTarget[8])

I would not use "Set zBool_AIFallBackHERO[8] = True" to determine if unit can retreat or not as that is not MUI. Either use hashtable or, if you are using unit indexer, use unit's custom value instead of constant number '8'.

This does not make sense:
  • Set TempGroup = (Units within 800.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
          • Game - Display to PG_Debug for 1.00 seconds the text: (Name of the current trigger)
          • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of NextTarget[8])
          • Custom script: call DestroyGroup (udg_TempGroup)
        • Else - Actions
          • Custom script: call DestroyGroup (udg_TempGroup)
You create a unit group, then for each unit inside the unit group you check how many units are in that very unit group, then order zU_AIHero[..] to attack-move somewhere and then always destroy the unit group.
So if TempGroup contains 8 units, you will order zU_AIHero[..] to attack-move 8 times.

What you want is actually
  • Set TempGroup = (Units within 800.00 of (Position of (Attacked unit)) matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
  • 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
      • Game - Display to PG_Debug for 1.00 seconds the text: (Name of the current trigger)
      • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of NextTarget[8])
      • Custom script: call DestroyGroup (udg_TempGroup)
    • Else - Actions
      • Custom script: call DestroyGroup (udg_TempGroup)
Also, since the If/Then/Else destroys the group one way or another, the action can be moved outside the If/Then/Else completely
  • Set TempGroup = (Units within 800.00 of (Position of (Attacked unit)) matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
  • 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
      • Game - Display to PG_Debug for 1.00 seconds the text: (Name of the current trigger)
      • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of NextTarget[8])
    • Else - Actions
  • Custom script: call DestroyGroup (udg_TempGroup)
The condition can be also changed. What you essentially check is if a unit group is empty or not. There is a boolean condition for that:
  • Set TempGroup = (Units within 800.00 of (Position of (Attacked unit)) matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (TempGroup is empty) Not equal to True
    • Then - Actions
      • Game - Display to PG_Debug for 1.00 seconds the text: (Name of the current trigger)
      • Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of NextTarget[8])
    • Else - Actions
  • Custom script: call DestroyGroup (udg_TempGroup)
Your trigger should have the following structure:
  • At start declare the local udg_ variable as described by me and in the map linked by Pyro
  • Check the level difference between two units
  • If difference is 3+ levels, then:
    • assign the attacked unit to the local udg_ variable via 'Set variable' action
    • set zBool_AIFallBackHERO to true (either using unit indexer or replacing this with hashtable)
    • order unit to retreat to some other point
    • clear location variable
    • wait 4 seconds
    • assign TempGroup, use the local udg_ unit variable instead of (Attacked unit)
    • check if unit group is empty the way I've describe. If its not empty, order zU_AIHero to go somewhere
    • clear TempGroup
  • set the local udg_ variable to null using custom script (this action should be outside all If/Then/Else actions)
 
Level 17
Joined
Jun 2, 2009
Messages
1,165
Hold on. First of all, probably it is a great explanation but i have a 2 problems. My intelligence, my English and Custom Scripts. As i mentioned i have no idea about Custom Scripts, i do not know what is happening there (except of creating and destroying groups and points)
And my main objective is less triggers because my map no more works if i will create more triggers. I have to eliminate 10 slot triggers for 10 players.

Now let us start with first trigger than for the make everything clear. As you can see i was created my own AI system and shared it in here (my signature)
If you spent your time for me, let me try to tell you step by step.

--- Chapter 1 - Attacked trigger ---

Yes probably you are right. There are leaks and let us begin with this.
When AI_HERO attacked by PLAYER_HERO and if there are 3 or more level difference, i just simply picking this Hero and sending it's previous location. I read your post 3 or 4 times and i realized we have to go step by step from here. Because as i mentioned i am stupid person, no more i can learn anything new after age 39 and my English and Custom Scripts are huge problem to me. It will be best if we can step by step.

Changing some Variable names for better understanding for you

Unit Group Team1HeroesPLAYER: Heroes selected by Humans in Team 1
Unit[array] HERO_AI[8]: Hero 8 selected by Computer (8 = slot 8)
Boolean[array] HERO_AI_RUN_FROM_HEROES[8]: I am setting this True when Hero started to fall back.

This trigger includes only Player 8 slot.

  • DevilHerodanKacP8
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) is in Team1HeroesPLAYER) Equal to True
      • (Attacked unit) Equal to HERO_AI[8]
      • HERO_AI_RUN_FROM_HEROES[8] Equal to False
      • ((Attacked unit) is in UG_REGEN_TEAM2) Equal to False
    • Actions
      • Set xINT_TEMP[8] = (Level of (Attacking unit))
      • Set xINT_TEMP2[8] = (Level of (Attacked unit))
      • Set xINT_TEMP3[8] = (xINT_TEMP[8] - xINT_TEMP2[8])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • xINT_TEMP3[8] Greater than or equal to 3
        • Then - Actions
Now i am changing it like this. I can delete detect attack comes from human or AI.

Unit Group HerolarBotALL: ALL Heroes controlled by Computer.
Unit Group UG_REGEN_TEAM2: One of my triggers controls Heroes within this group for the fall back and go to the base for the heal and buy items.

  • FALLBACK_FROM_HEROES
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is in HerolarBotALL) Equal to True
      • HERO_AI_RUN_FROM_HEROES[(Player number of (Owner of DamageEventTarget))] Equal to False
      • (DamageEventTarget is in UG_REGEN_TEAM2) Equal to False
    • 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
          • Set HERO_AI_RUN_FROM_HEROES[(Player number of (Owner of DamageEventTarget))] = True
          • Set TempPoint = (Position of DamageEventSource)
          • Set TempPoint2 = ((Position of DamageEventTarget) offset by 800.00 towards ((Angle from TempPoint to (Center of PreviousTarget[(Player number of (Owner of DamageEventTarget))])) - 0.00) degrees)
          • Unit - Order DamageEventTarget to Move To TempPoint2
          • Game - Display to PG_Debug for 1.00 seconds the text: (Name of the current trigger)
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call RemoveLocation (udg_TempPoint2)
Now i have improved my trigger. Before we proceed @Nichilus can you verify this is correct or not?

My current objective is changing attack to > any damage taken
10 Triggers for 10 slots > 1 Trigger for 10 slots
If level 12 Hero damages level 9 or below hero, i want to order fall back to damaged unit.
When you verify, i will continue.
 
Level 25
Joined
Sep 26, 2009
Messages
2,402
Does computer player 8 have only a single AI hero?
If yes, then the following:
  • Set HERO_AI_RUN_FROM_HEROES[(Player number of (Owner of DamageEventTarget))] = True
will work correctly for you. BUT if player 8 can have multiple AI heroes, then the above will NOT work correctly.

This is correct:
  • 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))])
but it can be simplified - these temp variables are set and used only for the condition "TempInt Greater than or equal to 3". As such, there is no need to use an array:
  • Set tempInt1 = (Level of DamageEventSource)
  • Set tempInt2 = (Level of DamageEventTarget)
  • Set TempInt = (tempInt1 - tempInt2)
You can see that this is way easier to read.
Since tempInt1 and tempInt2 are used only to determine value of TempInt, this can be further simplified to:
  • Set TempInt = ((Level of DamageEventSource) - (Level of DamageEventTarget))
----
This:
  • Set TempPoint2 = ((Position of DamageEventTarget) offset by 800.00 towards ((Angle from TempPoint to (Center of PreviousTarget[(Player number of (Owner of DamageEventTarget))])) - 0.00) degrees)
still leaks locations:
  • (Position of DamageEventTarget)
  • (Center of PreviousTarget[(Player number of (Owner of DamageEventTarget))])

You can do for example
  • -------- determine the angle first --------
  • Set TempPoint = (Position of DamageEventSource)
  • Set TempPoint2 = (Center of PreviousTarget[(Player number of (Owner of DamageEventTarget))])
  • Set angle = (Angle from TempPoint to TempPoint2)
  • -------- clear points used to determine angle, as we have no use for them anymore --------
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Custom script: call RemoveLocation(udg_TempPoint2)
  • -------- determine the target point for order --------
  • Set TempPoint = (Position of DamageEventTarget)
  • Set TempPoint2 = (TempPoint offset by 800.00 towards (angle - 0.00) degrees)
  • Unit - Order DamageEventTarget to Move To TempPoint2
  • ...
Other than this I think the rest looks ok.
 
Level 17
Joined
Jun 2, 2009
Messages
1,165
Yes. Every slot have 1 Hero. Thank you. I will add fixes later. If everything is done, let us continue.

--- Chapter 1 Part 2 ---
We found the weak Hero and ordered to fall back. This is the rest of the trigger. Now let us configure here for every player.
Just realized that, timer -array BotHerodanKacma not using in anywhere. Probably i was created this for later use and it turns out to my first question asked.

  • Custom script: call RemoveLocation (udg_TempPoint)
  • Custom script: call RemoveLocation (udg_TempPoint2)
  • Countdown Timer - Start BotHerodanKacma[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 4.00 seconds
  • Wait 4.00 seconds
  • Set HERO_AI_RUN_FROM_HEROES[8] = False
  • Set TempGroup = (Units within 800.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
          • Game - Display to PG_Debug for 1.00 seconds the text: (Name of the current trigger)
          • Unit - Order HERO_AI[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of NextTarget[8])
          • Custom script: call DestroyGroup (udg_TempGroup)
        • Else - Actions
          • Custom script: call DestroyGroup (udg_TempGroup)
  • Else - Actions
After 4 seconds wait, i want to do that.
If 4 seconds wait finished for player 8, i want to change EXAMPLEBOOL[8] to False
And if 4 seconds wait finished for player 11, i want to change EXAMPLEBOOL[11] to False

How can i do that? You can ignore any actions. I just need example. It can be with wait action or timer or anything. @Nichilus

--- Exact question is ---

Hello. I am creating 4 seconds timers for player slots. After 4 seconds i want to run action for the owner of expired timer.
I do not want to create 10 triggers for 10 different players.

I did something like this. Is it works well or causes problems? I did some tests and it looks nice but i wanted to ask.

  • TimerKacmaHero
    • Events
      • Time - AI_FALLBACK_FROM_HEROES[2] expires
      • Time - AI_FALLBACK_FROM_HEROES[3] expires
      • Time - AI_FALLBACK_FROM_HEROES[4] expires
      • Time - AI_FALLBACK_FROM_HEROES[5] expires
      • Time - AI_FALLBACK_FROM_HEROES[6] expires
      • Time - AI_FALLBACK_FROM_HEROES[8] expires
      • Time - AI_FALLBACK_FROM_HEROES[9] expires
      • Time - AI_FALLBACK_FROM_HEROES[10] expires
      • Time - AI_FALLBACK_FROM_HEROES[11] expires
      • Time - AI_FALLBACK_FROM_HEROES[12] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if (GetExpiredTimer() == udg_AI_FALLBACK_FROM_HEROES[bj_forLoopAIndex]) then
          • Set TempInt = (Integer A)
          • Custom script: exitwhen true
          • Custom script: endif
      • Set HERO_AI_FALLBACK_FROM_HERO[TempInt] = False
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,402
If 4 seconds wait finished for player 8, i want to change EXAMPLEBOOL[8] to False
And if 4 seconds wait finished for player 11, i want to change EXAMPLEBOOL[11] to False
You already do this in trigger's FALLBACK_FROM_HEROES condition:
  • HERO_AI_RUN_FROM_HEROES[(Player number of (Owner of DamageEventTarget))] Equal to False
You don't have a constant value 8 or 11, you use (Player number of (Owner of DamageEventTarget)). Use this in other places as well and you can have single trigger.

Your "TimerKacmaHero" trigger WILL work only if you also put in there everything you have in "FALLBACK_FROM_HEROES" trigger after this action:
  • Wait 4.00 seconds
in other words: the TempGroup creation and ordering of HERO_AI[..] to attack-move somewhere.


How it would look with local udg_ variables that Pyro and me talked about is as follows:
  • In the trigger editor create a unit variable called "AI_FALLBACK_HERO" - it is NOT an array.
  • In trigger FALLBACK_FROM_HEROES have this as the very first action:
    • Custom script: local unit udg_AI_FALLBACK_HERO
  • As the very last action in trigger FALLBACK_FROM_HEROES (outside of all If/Then/Else actions) have this:
    • Custom script: set udg_AI_FALLBACK_HERO = null
  • the trigger would then look like this:
  • Actions
    • Custom script: local unit udg_AI_FALLBACK_HERO
    • Set TempInt = ((Level of DamageEventSource) - (Level 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
        • Set AI_FALLBACK_HERO = DamageEventTarget
        • Set HERO_AI_RUN_FROM_HEROES[(Player number of (Owner of AI_FALLBACK_HERO))] = True
        • -------- determine the angle first --------
        • Set TempPoint = (Position of DamageEventSource)
        • Set TempPoint2 = (Center of PreviousTarget[(Player number of (Owner of AI_FALLBACK_HERO))])
        • Set angle = (Angle from TempPoint to TempPoint2)
        • -------- clear points used to determine angle, as we have no use for them anymore --------
        • Custom script: call RemoveLocation(udg_TempPoint)
        • Custom script: call RemoveLocation(udg_TempPoint2)
        • -------- determine the target point for order --------
        • Set TempPoint = (Position of AI_FALLBACK_HERO)
        • Set TempPoint2 = (TempPoint offset by 800.00 towards (angle - 0.00) degrees)
        • Unit - Order AI_FALLBACK_HERO to Move To TempPoint2
        • Game - Display to PG_Debug for 1.00 seconds the text: (Name of the current trigger)
        • Custom script: call RemoveLocation (udg_TempPoint)
        • Custom script: call RemoveLocation (udg_TempPoint2)
        • Wait 4.00 seconds
        • Set HERO_AI_RUN_FROM_HEROES[(Player number of (Owner of AI_FALLBACK_HERO))] = False
        • Set TempPoint = (Position of AI_FALLBACK_HERO)
        • Set TempGroup = (Units within 800.00 of TempPoint) matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (TempGroup is empty) Not equal to True
          • Then - Actions
            • Game - Display to PG_Debug for 1.00 seconds the text: (Name of the current trigger)
            • Set TempPoint2 = (Center of NextTarget[(Player number of (Owner of AI_FALLBACK_HERO))])
            • Unit - Order zU_AIHero[(Player number of (Owner of AI_FALLBACK_HERO))] to Attack-Move To TempPoint2
            • Custom script: call RemoveLocation(udg_TempPoint2)
          • Else - Actions
        • Custom script: call RemoveLocation(udg_TempPoint)
        • Custom script: call DestroyGroup (udg_TempGroup)
    • Custom script: set udg_AI_FALLBACK_HERO = null
With this approach, there is no need for trigger TimerKacmaHero.
The reason why what I've shown will work even through the 4.0 second wait is due to declaring a local variable udg_AI_FALLBACK_HERO at the start of the trigger via custom script and this variable's name matches 1:1 to the global variable created via trigger editor.
 
Level 17
Joined
Jun 2, 2009
Messages
1,165
Thank you for your explanation but i think you missed my last message :) i was told you it was previous outdated version. I have updated it and created new one. You can completely ignore the last actions. By the way my trigger that i have posted (last one) seems works well. If you say "yes, there is no problem with this trigger" we can say this one solved.
 
Top