• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Solved] Why i cannot go there? It seems still i do not understand about triggering yet

Level 18
Joined
Jun 2, 2009
Messages
1,276
I can see 1 as a number in here
  • Game - Display to (All players) for 0.10 seconds the text: (String((Number of units in TempGroup2)))
But it never goes to ELSE?

  • Unit Group - Pick every unit in TempGroup2 and do (Actions)
    • Loop - Actions
      • Game - Display to (All players) for 0.10 seconds the text: (String((Number of units in TempGroup2)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup2) Less than or equal to 2
        • Then - Actions
        • Else - Actions
          • Game - Display to (All players) the text: ETRAFTA CREEP YOK
Here is the full trigger if you want to check

  • KuledenKacDevil Copy Copy Copy Copy Copy CopyCopy
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) is in zUG_CreepsDevil) Equal to True
      • ((Attacking unit) is in zUG_TowersReaper) Equal to True
    • Actions
      • Set TempPoint = (Position of (Attacked unit))
      • Set TempGroup = (Units within 1000.00 of TempPoint matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Less than or equal to 2
        • Then - Actions
          • Custom script: call DestroyGroup (udg_TempGroup)
          • Set TempPoint = (Position of (Attacked unit))
          • Set TempGroup = (Units within 800.00 of TempPoint)
          • 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
                  • ((Picked unit) is in HerolarYapayZekaDevil) Equal to True
                  • ((Picked unit) is in zUG_TankDEF_DEVIL) Equal to False
                • Then - Actions
                  • Set TempUnit = (Picked unit)
                  • Set bool_RUN_TOWER[(Player number of (Owner of (Picked unit)))] = False
                  • Set fAI_run_tower[(Player number of (Owner of TempUnit))] = True
                  • Set TempGroup2 = (Units within 1000.00 of (Position of TempUnit) matching ((((Matching unit) is in zUG_CreepsDevil) Equal to True) and ((Owner of (Matching unit)) Equal to Player 1 (Red))))
                  • Custom script: call DestroyGroup (udg_TempGroup)
                  • Custom script: call RemoveLocation (udg_TempPoint)
                  • Unit Group - Pick every unit in TempGroup2 and do (Actions)
                    • Loop - Actions
                      • Game - Display to (All players) for 0.10 seconds the text: (String((Number of units in TempGroup2)))
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in TempGroup2) Less than or equal to 2
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Picked unit) is in zUG_CreepsDevil) Equal to True
                              • ((Picked unit) is alive) Equal to True
                              • ((Picked unit) is in EBENGRUP) Equal to False
                              • zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] Equal to False
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (TempUnit is in zUG_LanerDevilBOT) Equal to True
                                  • (Point-value of (Picked unit)) Equal to 91
                                • Then - Actions
                                  • Set zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] = True
                                  • Unit - Order TempUnit to Right-Click (Picked unit)
                                  • Cinematic - Ping minimap for (All players) at (Position of (Picked unit)) for 1.00 seconds
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (TempUnit is in zUG_LanerDevilMID) Equal to True
                                      • (Point-value of (Picked unit)) Equal to 92
                                    • Then - Actions
                                      • Game - Display to (All players) for 2.00 seconds the text: (MID LANER: + (Name of TempUnit))
                                      • Set zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] = True
                                      • Unit - Order TempUnit to Right-Click (Picked unit)
                                      • Cinematic - Ping minimap for (All players) at (Position of (Picked unit)) for 1.00 seconds
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (TempUnit is in zUG_LanerDevilTOP) Equal to True
                                          • (Point-value of (Picked unit)) Equal to 93
                                        • Then - Actions
                                          • Set zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] = True
                                          • Unit - Order TempUnit to Right-Click (Picked unit)
                                          • Cinematic - Ping minimap for (All players) at (Position of (Picked unit)) for 1.00 seconds
                                        • Else - Actions
                            • Else - Actions
                        • Else - Actions
                          • Game - Display to (All players) the text: ETRAFTA CREEP YOK N...
                  • Custom script: call DestroyGroup (udg_TempGroup2)
                • Else - Actions
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup (udg_TempGroup)
 

Attachments

  • asgdagdadsgadsgnjhadsgjh.png
    asgdagdadsgadsgnjhadsgjh.png
    54.6 KB · Views: 39
Based on what you wrote, "(Number of units in TempGroup2)" returns 1.
Is 1 less than or equal 2? Yes it is, so why do you assume it should go to "Else" block?
Uhm. That is the proof how much i am tired. Yes, you are right.
My AI was trying to fall back when there are 2 or less creeps around them. But in the same time i am trying to check for previous wave and that is where the problems started.
If there was NO wave behind (it can be happen for few reasons) they cannot find any creeps and my huge problems starts in here.
Anyway i will send the heroes to their PreviousTarget points.

How would you do it @Nichilus? Maybe this one is bit of complicated. It seems i have to check previous wave and does not include the new wave with current wave.

This one was my original trigger with flaws. Sometimes they we're not retreating with this one.

  • KuledenKacDevil
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacked unit)) Equal to ClanDevilPlayer
      • ((Attacked unit) is in zUG_CreepsDevil) Equal to True
      • ((Attacking unit) is in zUG_TowersReaper) Equal to True
    • Actions
      • Set TempPoint = (Position of (Attacked unit))
      • Set TempGroup = (Units within 1000.00 of TempPoint matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Less than or equal to 2
        • Then - Actions
          • Custom script: call DestroyGroup (udg_TempGroup)
          • Set TempPoint = (Position of (Attacked unit))
          • Set TempGroup = (Units within 800.00 of TempPoint matching ((((Matching unit) is in HerolarYapayZekaDevil) Equal to True) and (((Matching unit) is in zUG_TankOFF_DEVIL) Equal to False)))
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Set TempUnit = (Picked unit)
              • Set bool_RUN_TOWER[(Player number of (Owner of (Picked unit)))] = False
              • Set fAI_run_tower[(Player number of (Owner of TempUnit))] = True
              • Unit Group - Pick every unit in (Units within 5000.00 of (Position of TempUnit)) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in zUG_CreepsDevil) Equal to True
                      • ((Picked unit) is alive) Equal to True
                      • ((Picked unit) is in EBENGRUP) Equal to False
                      • zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] Equal to False
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (TempUnit is in zUG_LanerDevilBOT) Equal to True
                          • (Point-value of (Picked unit)) Equal to 91
                        • Then - Actions
                          • Set zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] = True
                          • Unit - Order TempUnit to Right-Click (Picked unit)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (TempUnit is in zUG_LanerDevilMID) Equal to True
                              • (Point-value of (Picked unit)) Equal to 92
                            • Then - Actions
                              • Set zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] = True
                              • Unit - Order TempUnit to Right-Click (Picked unit)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (TempUnit is in zUG_LanerDevilTOP) Equal to True
                                  • (Point-value of (Picked unit)) Equal to 93
                                • Then - Actions
                                  • Set zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] = True
                                  • Unit - Order TempUnit to Right-Click (Picked unit)
                                • Else - Actions
                    • Else - Actions
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup (udg_TempGroup)
 
Just keep track of it in unit group array variable, where each unit group represents one wave?
Let's say you have an array variable of type 'unit group' called AttackWave[]:
  • Create group and assign it to "unit group" variable called 'grp'.
  • Spawn wave
  • Add all spawned units into group 'grp'
  • Assign 'grp' group to AttackWave[] variable, let's say first wave will be under index 1, so AttackWave[1] = grp
  • Do not destroy 'grp' group via custom script, as that group is assigned to AttackWave[1] and it would be destroyed there as well

When you spawn next wave, you assign it to AttackWave[2], third wave to AttackWave[3] and so on.
Then, let's say you want to check if there is any unit in previous wave and you want to perform that check for AttackWave[2]. Well, you can simply check if any unit is alive in group AttackWave[1].

In theory, unless you can reach over 32.000 waves in single game, you don't even need any complicated clean up of obsolete groups in AttackWave array.
 
Good idea. Already fixed it easily. Very similar to previous one but it is "proper" than before. My problem was creating and removing groups under pick every unit etc etc and realized that.
hank you for your help again dear Nichilus.


  • KuledenKacDevil
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) is in zUG_CreepsDevil) Equal to True
      • ((Attacking unit) is in zUG_TowersReaper) Equal to True
    • Actions
      • Set TempPoint = (Position of (Attacked unit))
      • Set TempGroup = (Units within 1000.00 of TempPoint matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Less than or equal to 2
        • Then - Actions
          • Custom script: call DestroyGroup (udg_TempGroup)
          • Set TempPoint = (Position of (Attacked unit))
          • Set TempGroup = (Units within 800.00 of TempPoint)
          • 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
                  • ((Picked unit) is in HerolarYapayZekaDevil) Equal to True
                  • ((Picked unit) is in zUG_TankDEF_DEVIL) Equal to False
                • Then - Actions
                  • Set TempUnit = (Picked unit)
                  • Set bool_RUN_TOWER[(Player number of (Owner of TempUnit))] = False
                  • Set fAI_run_tower[(Player number of (Owner of TempUnit))] = True
                  • Set TempGroup2 = (Units within 10000.00 of (Position of TempUnit) matching ((((Matching unit) is in zUG_CreepsDevil) Equal to True) and (((Matching unit) is in EBENGRUP) Equal to False)))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] Equal to False
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in TempGroup2) Greater than 0
                        • Then - Actions
                          • Unit Group - Pick every unit in TempGroup2 and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (TempUnit is in zUG_LanerDevilBOT) Equal to True
                                  • (Point-value of (Picked unit)) Equal to 91
                                • Then - Actions
                                  • Set zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] = True
                                  • Unit - Order TempUnit to Right-Click (Picked unit)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (TempUnit is in zUG_LanerDevilMID) Equal to True
                                      • (Point-value of (Picked unit)) Equal to 92
                                    • Then - Actions
                                      • Set zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] = True
                                      • Unit - Order TempUnit to Right-Click (Picked unit)
                                      • Cinematic - Ping minimap for (All players) at (Position of (Picked unit)) for 1.00 seconds
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (TempUnit is in zUG_LanerDevilTOP) Equal to True
                                          • (Point-value of (Picked unit)) Equal to 93
                                        • Then - Actions
                                          • Set zBool_BotCreepBuldu[(Player number of (Owner of TempUnit))] = True
                                          • Unit - Order TempUnit to Right-Click (Picked unit)
                                        • Else - Actions
                        • Else - Actions
                          • Game - Display to (All players) for 1.00 seconds the text: ARKADA BIRIM YOK
                    • Else - Actions
                • Else - Actions
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call DestroyGroup (udg_TempGroup)
          • Custom script: call DestroyGroup (udg_TempGroup2)
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Custom script: call DestroyGroup (udg_TempGroup2)
 
Back
Top