Periodic Timer lagging?

NeosDany

Member
Reaction score
1
As the title says does this trigger ( or another with the same structure ) generate lag ?
Ex.

Trigger:
  • Trigger 1
    • Event - Every 1 second
    • Condition - None
    • Actions -
    • Set Temp_Group : units in region owned by player 1
    • Custom Script : call DestroyGroup (udg_Temp_Group)


Trigger:
  • Trigger 2
    • Event - Every 1 second
    • Condition - None
    • Actions -
    • Set Temp_Group : units in region owned by player 2
    • Custom Script : call DestroyGroup (udg_Temp_Group)


I know that both events could be in one trigger.

Question 1 : does that triggers generate lag because each uses the same variable : Temp_Group

Question 2 : if i put both triggers on one the lag will be reduced ?

Question 3 : if I create Temp_Group[array] for every player the lag will be reduced?
 

Ashlebede

New Member
Reaction score
43
Q1 : Using the same variable won't mean more lag. It will mean less RAM usage = a tidbit tad unnoticeable bit less lag (no actual difference). The only reason you should use more than one variable is waits.

Q2 : What? You mean merging the triggers? Then yes, it will be reduced. Definitely not noticeable or anything, but reduced. If you have many triggers like this, it can make a difference.

Q3 : Nope. You only need a single group for this. See Q1.
 

NeosDany

Member
Reaction score
1
omg, so I dont know why my map is lagging so much, well thanks for helping

May this lag? :

Event - Unit enters region
Condition - None
Actions -
Set Temp_Point : Center Of X region
Issue a order targeting a point order entering unit to move and attack Temp_Point
call RemoveLocation (udg_Temp_Point)
 

Ashlebede

New Member
Reaction score
43
It shouldn't. Look for lag somewhere else ; otherwise, it might just be your computer that's installing an update or something.
 

Flare

Stops copies me!
Reaction score
662
omg, so I dont know why my map is lagging so much
Can you identify (approximately) when the map starts lagging? Is it persistent lag, or momentary freezing (e.g. during the hero selection in DotA)? If you can find out when it's happening, it'll make it easier for us (and you) to find potential sources for the lag.
 

NeosDany

Member
Reaction score
1
Well, the map isnt lagging alwais, the map is like blood tournament. You build a structure and when timer drops to 0 your units beggin to spawn. When the units start to spawn the game slowly beggins to be laggy more and more, I dont think that the spawning trigger is the error cause, it turns off when certain ammount of units are created, 175 exactly, but the lag becomes worse.
The spawning trigger is like
Event -
Condition - None
Action -
If then else do actions
set Temp_Group : ( resuming, units alive, of type soldier (structure) owned by player in region x )
then set variable : soldier = soldier +1 (integer)
call DestroyGroup (udg_Temp_Group)

this calculates how many units of that kind you should have... This trigger executes only once per round (other trigger executes this trigger once per round), then the other trigger...

Event - Every 1.00 second
Condition - None
Actions -
set Temp_Group : units owned of player alive in region battle
if soldier > 0 ( Soldier is a integer, if is larger than 0 )
and if number of units in Temp_Group < 175
create 1 soldier in Temp_Point
set soldier = soldier - 1
call RemoveLocation (udg Temp_Point) and call DestroyGroup (udg Temp_Group) in the trigger of course...

I will paste the trigger ( it is in spanish sorry xd - look the events )

Trigger:
  • Acciones
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[1] Mayor que 0
      • Entonces: Acciones
        • Set Archer[1] = (Archer[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Archer for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[1] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[1] = (Bandit[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Bandit for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[1] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[1] = (EliteArcher[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Elite Archer for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[1] Mayor que 0
      • Entonces: Acciones
        • Set Footman[1] = (Footman[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Footman for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[1] Mayor que 0
      • Entonces: Acciones
        • Set Knights[1] = (Knights[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Knight for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[1] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[1] = (Longbow[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Longbow for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • -------- ------------------------- --------
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[2] Mayor que 0
      • Entonces: Acciones
        • Set Archer[2] = (Archer[2] - 1)
        • Unidad - Create 1 Archer for Jugador 2 (azul) at (Center of P2Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[2] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[2] = (Bandit[2] - 1)
        • Unidad - Create 1 Bandit for Jugador 2 (azul) at (Center of P2Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[2] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[2] = (EliteArcher[2] - 1)
        • Unidad - Create 1 Elite Archer for Jugador 2 (azul) at (Center of P2Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[2] Mayor que 0
      • Entonces: Acciones
        • Set Footman[2] = (Footman[2] - 1)
        • Unidad - Create 1 Footman for Jugador 2 (azul) at (Center of P2Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[2] Mayor que 0
      • Entonces: Acciones
        • Set Knights[2] = (Knights[2] - 1)
        • Unidad - Create 1 Knight for Jugador 2 (azul) at (Center of P2Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[2] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[2] = (Longbow[2] - 1)
        • Unidad - Create 1 Longbow for Jugador 2 (azul) at (Center of P2Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • -------- ------------------------- --------
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[3] Mayor que 0
      • Entonces: Acciones
        • Set Archer[3] = (Archer[3] - 1)
        • Unidad - Create 1 Archer for Jugador 3 (teja) at (Center of P3Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[3] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[3] = (Bandit[3] - 1)
        • Unidad - Create 1 Bandit for Jugador 3 (teja) at (Center of P3Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[3] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[3] = (EliteArcher[3] - 1)
        • Unidad - Create 1 Elite Archer for Jugador 3 (teja) at (Center of P3Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[3] Mayor que 0
      • Entonces: Acciones
        • Set Footman[3] = (Footman[3] - 1)
        • Unidad - Create 1 Footman for Jugador 3 (teja) at (Center of P3Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[3] Mayor que 0
      • Entonces: Acciones
        • Set Knights[3] = (Knights[3] - 1)
        • Unidad - Create 1 Knight for Jugador 3 (teja) at (Center of P3Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[3] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[3] = (Longbow[3] - 1)
        • Unidad - Create 1 Longbow for Jugador 3 (teja) at (Center of P3Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • -------- ------------------------- --------
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[4] Mayor que 0
      • Entonces: Acciones
        • Set Archer[4] = (Archer[4] - 1)
        • Unidad - Create 1 Archer for Jugador 4 (morado) at (Center of P4Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[4] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[4] = (Bandit[4] - 1)
        • Unidad - Create 1 Bandit for Jugador 4 (morado) at (Center of P4Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[4] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[4] = (EliteArcher[4] - 1)
        • Unidad - Create 1 Elite Archer for Jugador 4 (morado) at (Center of P4Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[4] Mayor que 0
      • Entonces: Acciones
        • Set Footman[4] = (Footman[4] - 1)
        • Unidad - Create 1 Footman for Jugador 4 (morado) at (Center of P4Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[4] Mayor que 0
      • Entonces: Acciones
        • Set Knights[4] = (Knights[4] - 1)
        • Unidad - Create 1 Knight for Jugador 4 (morado) at (Center of P4Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[4] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[4] = (Longbow[4] - 1)
        • Unidad - Create 1 Longbow for Jugador 4 (morado) at (Center of P4Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • -------- ------------------------- --------
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[5] Mayor que 0
      • Entonces: Acciones
        • Set Archer[5] = (Archer[5] - 1)
        • Unidad - Create 1 Archer for Jugador 5 (amarillo) at (Center of P5Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[5] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[5] = (Bandit[5] - 1)
        • Unidad - Create 1 Bandit for Jugador 5 (amarillo) at (Center of P5Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[5] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[5] = (EliteArcher[5] - 1)
        • Unidad - Create 1 Elite Archer for Jugador 5 (amarillo) at (Center of P5Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[5] Mayor que 0
      • Entonces: Acciones
        • Set Footman[5] = (Footman[5] - 1)
        • Unidad - Create 1 Footman for Jugador 5 (amarillo) at (Center of P5Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[5] Mayor que 0
      • Entonces: Acciones
        • Set Knights[5] = (Knights[5] - 1)
        • Unidad - Create 1 Knight for Jugador 5 (amarillo) at (Center of P5Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[5] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[5] = (Longbow[5] - 1)
        • Unidad - Create 1 Longbow for Jugador 5 (amarillo) at (Center of P5Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • -------- ------------------------- --------
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[6] Mayor que 0
      • Entonces: Acciones
        • Set Archer[6] = (Archer[6] - 1)
        • Unidad - Create 1 Archer for Jugador 6 (naranja) at (Center of P6Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[6] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[6] = (Bandit[6] - 1)
        • Unidad - Create 1 Bandit for Jugador 6 (naranja) at (Center of P6Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[6] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[6] = (EliteArcher[6] - 1)
        • Unidad - Create 1 Elite Archer for Jugador 6 (naranja) at (Center of P6Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[6] Mayor que 0
      • Entonces: Acciones
        • Set Footman[6] = (Footman[6] - 1)
        • Unidad - Create 1 Footman for Jugador 6 (naranja) at (Center of P6Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[6] Mayor que 0
      • Entonces: Acciones
        • Set Knights[6] = (Knights[6] - 1)
        • Unidad - Create 1 Knight for Jugador 6 (naranja) at (Center of P6Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[6] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[6] = (Longbow[6] - 1)
        • Unidad - Create 1 Longbow for Jugador 6 (naranja) at (Center of P6Spawn &lt;gen&gt;) facing Vista edificio predeterminada degrees
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
 

vypur85

Hibernate
Reaction score
803
175 is quite a huge number. It makes it worse if all the units are concentrated in similar location/point. I guess that's the problem. Otherwise, the trigger seems fine except with a few leaks which won't affect much in performance (I believe you're aware of it as well).
 

NeosDany

Member
Reaction score
1
So there is no solution for my problem? the lag is for creation in the same point, Dont know, there is no way to reduce the lag maybe...
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Thats one huge trigger. thats definitely not very good.

not is the GUI known to bug sometimes if triggers become too big, this lot of if/then/else combined with alot of unit groups being generated periodically is a high lag potential.

i havent read the whole trigger but i couldnt find any memory leaks within the parts i read.

your problem sounds pretty much like memory leaks, i see you know what they are and how to deal with them. check every single trigger for leaking variables.
keep in mind that not just points and groups leak. forces and special effects do so as well.

besides, i would definitely change this trigger. its size and the performance it wastes both are incredible.

as a base rule, you could make this trigger only use 1 single unit group.
set Temp_Group = (Units in Region de Batalla <gen> matching ((((Matching unit) is alive) Igual a True)))
and then you could use some integer variable or the food cost to determine the number of units owned by the single players. the array indexes would become (Player number of (owner of (picked unit))) and the spawn points would need to be initially saved within an array with its indexes matching the owning players.

Edit:
i now saw the leaks in the trigger. only for the 1 player the point leaks at the spawn are removed!
 

NeosDany

Member
Reaction score
1
Still laggin when more than 20 units, my map has no effects via triggers, there are not any leak visible trigger... but there is no lagg when there are no units in map... new trigger :
Trigger:
  • Acciones
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[1] Mayor que 0
      • Entonces: Acciones
        • Set Archer[1] = (Archer[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Archer for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[1] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[1] = (Bandit[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Bandit for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[1] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[1] = (EliteArcher[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Elite Archer for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[1] Mayor que 0
      • Entonces: Acciones
        • Set Footman[1] = (Footman[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Footman for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[1] Mayor que 0
      • Entonces: Acciones
        • Set Knights[1] = (Knights[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Knight for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in Region de Batalla &lt;gen&gt; matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 1 (rojo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[1] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[1] = (Longbow[1] - 1)
        • Set Temp_Point[1] = (Center of P1Spawn &lt;gen&gt;)
        • Unidad - Create 1 Longbow for Jugador 1 (rojo) at Temp_Point[1] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • -------- ------------------------- --------
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[2] Mayor que 0
      • Entonces: Acciones
        • Set Archer[2] = (Archer[2] - 1)
        • Set Temp_Point[2] = (Center of P2Spawn &lt;gen&gt;)
        • Unidad - Create 1 Archer for Jugador 2 (azul) at Temp_Point[2] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[2])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[2] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[2] = (Bandit[2] - 1)
        • Set Temp_Point[2] = (Center of P2Spawn &lt;gen&gt;)
        • Unidad - Create 1 Bandit for Jugador 2 (azul) at Temp_Point[2] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[2])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[2] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[2] = (EliteArcher[2] - 1)
        • Set Temp_Point[2] = (Center of P2Spawn &lt;gen&gt;)
        • Unidad - Create 1 Elite Archer for Jugador 2 (azul) at Temp_Point[2] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[2])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[2] Mayor que 0
      • Entonces: Acciones
        • Set Footman[2] = (Footman[2] - 1)
        • Set Temp_Point[2] = (Center of P2Spawn &lt;gen&gt;)
        • Unidad - Create 1 Footman for Jugador 2 (azul) at Temp_Point[2] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[2])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[2] Mayor que 0
      • Entonces: Acciones
        • Set Knights[2] = (Knights[2] - 1)
        • Set Temp_Point[2] = (Center of P2Spawn &lt;gen&gt;)
        • Unidad - Create 1 Knight for Jugador 2 (azul) at Temp_Point[2] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[2])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 2 (azul))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[2] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[2] = (Longbow[2] - 1)
        • Set Temp_Point[2] = (Center of P2Spawn &lt;gen&gt;)
        • Unidad - Create 1 Longbow for Jugador 2 (azul) at Temp_Point[2] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[2])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • -------- ------------------------- --------
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[3] Mayor que 0
      • Entonces: Acciones
        • Set Archer[3] = (Archer[3] - 1)
        • Set Temp_Point[3] = (Center of P3Spawn &lt;gen&gt;)
        • Unidad - Create 1 Archer for Jugador 3 (teja) at Temp_Point[3] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[3])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[3] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[3] = (Bandit[3] - 1)
        • Set Temp_Point[3] = (Center of P3Spawn &lt;gen&gt;)
        • Unidad - Create 1 Bandit for Jugador 3 (teja) at Temp_Point[3] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[3])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[3] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[3] = (EliteArcher[3] - 1)
        • Set Temp_Point[3] = (Center of P3Spawn &lt;gen&gt;)
        • Unidad - Create 1 Elite Archer for Jugador 3 (teja) at Temp_Point[3] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[3])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[3] Mayor que 0
      • Entonces: Acciones
        • Set Footman[3] = (Footman[3] - 1)
        • Set Temp_Point[3] = (Center of P3Spawn &lt;gen&gt;)
        • Unidad - Create 1 Footman for Jugador 3 (teja) at Temp_Point[3] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[3])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[3] Mayor que 0
      • Entonces: Acciones
        • Set Knights[3] = (Knights[3] - 1)
        • Set Temp_Point[3] = (Center of P3Spawn &lt;gen&gt;)
        • Unidad - Create 1 Knight for Jugador 3 (teja) at Temp_Point[3] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[3])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[3] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[3] = (Longbow[3] - 1)
        • Set Temp_Point[3] = (Center of P3Spawn &lt;gen&gt;)
        • Unidad - Create 1 Longbow for Jugador 3 (teja) at Temp_Point[3] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[3])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • -------- ------------------------- --------
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[4] Mayor que 0
      • Entonces: Acciones
        • Set Archer[4] = (Archer[4] - 1)
        • Set Temp_Point[4] = (Center of P4Spawn &lt;gen&gt;)
        • Unidad - Create 1 Archer for Jugador 4 (morado) at Temp_Point[4] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[4])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[4] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[4] = (Bandit[4] - 1)
        • Set Temp_Point[4] = (Center of P4Spawn &lt;gen&gt;)
        • Unidad - Create 1 Bandit for Jugador 4 (morado) at Temp_Point[4] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[4])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[4] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[4] = (EliteArcher[4] - 1)
        • Set Temp_Point[4] = (Center of P4Spawn &lt;gen&gt;)
        • Unidad - Create 1 Elite Archer for Jugador 4 (morado) at Temp_Point[4] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[4])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[4] Mayor que 0
      • Entonces: Acciones
        • Set Footman[4] = (Footman[4] - 1)
        • Set Temp_Point[4] = (Center of P4Spawn &lt;gen&gt;)
        • Unidad - Create 1 Footman for Jugador 4 (morado) at Temp_Point[4] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[4])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[4] Mayor que 0
      • Entonces: Acciones
        • Set Knights[4] = (Knights[4] - 1)
        • Set Temp_Point[4] = (Center of P4Spawn &lt;gen&gt;)
        • Unidad - Create 1 Knight for Jugador 4 (morado) at Temp_Point[4] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[4])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[4] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[4] = (Longbow[4] - 1)
        • Set Temp_Point[4] = (Center of P4Spawn &lt;gen&gt;)
        • Unidad - Create 1 Longbow for Jugador 4 (morado) at Temp_Point[4] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[4])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • -------- ------------------------- --------
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[5] Mayor que 0
      • Entonces: Acciones
        • Set Archer[5] = (Archer[5] - 1)
        • Set Temp_Point[5] = (Center of P5Spawn &lt;gen&gt;)
        • Unidad - Create 1 Archer for Jugador 5 (amarillo) at Temp_Point[5] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[5])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[5] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[5] = (Bandit[5] - 1)
        • Set Temp_Point[5] = (Center of P5Spawn &lt;gen&gt;)
        • Unidad - Create 1 Bandit for Jugador 5 (amarillo) at Temp_Point[5] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[5])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[5] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[5] = (EliteArcher[5] - 1)
        • Set Temp_Point[5] = (Center of P5Spawn &lt;gen&gt;)
        • Unidad - Create 1 Elite Archer for Jugador 5 (amarillo) at Temp_Point[5] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[5])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[5] Mayor que 0
      • Entonces: Acciones
        • Set Footman[5] = (Footman[5] - 1)
        • Set Temp_Point[5] = (Center of P5Spawn &lt;gen&gt;)
        • Unidad - Create 1 Footman for Jugador 5 (amarillo) at Temp_Point[5] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[5])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[5] Mayor que 0
      • Entonces: Acciones
        • Set Knights[5] = (Knights[5] - 1)
        • Set Temp_Point[5] = (Center of P5Spawn &lt;gen&gt;)
        • Unidad - Create 1 Knight for Jugador 5 (amarillo) at Temp_Point[5] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[5])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 5 (amarillo))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[5] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[5] = (Longbow[5] - 1)
        • Set Temp_Point[5] = (Center of P5Spawn &lt;gen&gt;)
        • Unidad - Create 1 Longbow for Jugador 5 (amarillo) at Temp_Point[5] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[5])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • -------- ------------------------- --------
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Archer[6] Mayor que 0
      • Entonces: Acciones
        • Set Archer[6] = (Archer[6] - 1)
        • Set Temp_Point[6] = (Center of P6Spawn &lt;gen&gt;)
        • Unidad - Create 1 Archer for Jugador 6 (naranja) at Temp_Point[6] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[6])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Bandit[6] Mayor que 0
      • Entonces: Acciones
        • Set Bandit[6] = (Bandit[6] - 1)
        • Set Temp_Point[6] = (Center of P6Spawn &lt;gen&gt;)
        • Unidad - Create 1 Bandit for Jugador 6 (naranja) at Temp_Point[6] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[6])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • EliteArcher[6] Mayor que 0
      • Entonces: Acciones
        • Set EliteArcher[6] = (EliteArcher[6] - 1)
        • Set Temp_Point[6] = (Center of P6Spawn &lt;gen&gt;)
        • Unidad - Create 1 Elite Archer for Jugador 6 (naranja) at Temp_Point[6] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[6])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Footman[6] Mayor que 0
      • Entonces: Acciones
        • Set Footman[6] = (Footman[6] - 1)
        • Set Temp_Point[6] = (Center of P6Spawn &lt;gen&gt;)
        • Unidad - Create 1 Footman for Jugador 6 (naranja) at Temp_Point[6] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[6])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Knights[6] Mayor que 0
      • Entonces: Acciones
        • Set Knights[6] = (Knights[6] - 1)
        • Set Temp_Point[6] = (Center of P6Spawn &lt;gen&gt;)
        • Unidad - Create 1 Knight for Jugador 6 (naranja) at Temp_Point[6] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[6])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 6 (naranja))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Number of units in Temp_Group) Menor que o igual a 175
        • Longbow[6] Mayor que 0
      • Entonces: Acciones
        • Set Longbow[6] = (Longbow[6] - 1)
        • Set Temp_Point[6] = (Center of P6Spawn &lt;gen&gt;)
        • Unidad - Create 1 Longbow for Jugador 6 (naranja) at Temp_Point[6] facing Vista edificio predeterminada degrees
        • Custom script: call RemoveLocation (udg_Temp_Point[6])
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)
 

X-maul

AKA: Demtrod
Reaction score
201
You should try to experiment with doing it with a loop, that would decrease lag (I think) and make the trigger much shorter.
(you are doing the same actions over and over again and only changing one single integer value every time)

You create a seperate trigger where you set all the points, unit types and variable stuff at initialization
(If you get what i mean)


I wanted to create some demo triggers, but i do not fully understand your system :(
____________________________________

And btw you do not need to make
Temp_Point[1] = blahblah
//Actions
call RemoveLocation(Temp_Point[1])

Temp_Point[2] = blahblah
//Actions
call RemoveLocation(Temp_Point[2])

that doesnt matter when you clear the variable right after you use it. It should just be
Temp_Point = blahblah
//Actions
call RemoveLocation(Temp_Point)
 

Ashlebede

New Member
Reaction score
43
You should try to experiment with doing it with a loop, that would decrease lag (I think) and make the trigger much shorter.

It will not decrease the lag. It will only make the code easier to read (which I suggest, seeing the size of that monstrosity). After all, the same actions will be re-done, except you won't need to write them all. The only 2 differences :

=> Needs something like 400 bytes of RAM (we honestly don't care about 400bytes nowadays).
=> Will increment a variable every time a condition is checked = a few more actions for the processor. (I can guarantee there is no significant difference there, either, even on the worst computer in the world.)

Anyhow, it doesn't decrease lag, but rather increases delay by something wayyy under 1ms. But my philosophy is "don't replace what works and re-write it from scratch unless you have a good reason to". So basically don't lose too much time re-writing it.

I'd say the source of the lag would be the multiple :

Trigger:
  • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 4 (morado))))


Since it ends up like this :

Trigger:
  • //
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • -------- Conditions --------
        • Entonces: Acciones
          • -------- Actions --------
        • Otros: Acciones
    • -------- You don&#039;t need to create a new group here : --------
    • Custom script: call DestroyGroup (udg_Temp_Group)&lt;&lt;&lt;&lt;&lt;&lt;
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))&lt;&lt;&lt;&lt;&lt;&lt;
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • -------- Conditions ---------
      • Entonces: Acciones
        • -------- Actions --------
      • Otros: Acciones
    • Custom script: call DestroyGroup (udg_Temp_Group)


Also, counting the units in the group every time means cycling through the group every time. Ditto for creating the group. So, in the end, it should be :

Trigger:
  • //Hand-written
    • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is alive) Igual a True) and ((Owner of (Matching unit)) Igual a Jugador 3 (teja))))
    • Set HowManyUnits = (Count units in Temp_Group)
    • If (All conditions are true) then do (then actions) else do (else actions)
      • If - Conditions
        • HowManyUnits Less than or equal to 175
        • -------- And others... --------
      • Then - Actions
      • Else - Actions
    • -------- We don&#039;t need to remove &amp; recreate a group here, since it is the same. However, make a new one when you change player --------
    • If (All conditions are true) then do (then actions) else do (else actions)
      • If - Conditions
        • HowManyUnits Less than or equal to 175
        • -------- And others... --------
      • Then - Actions
      • Else -Actions
    • -------- And so on --------


And yes, 175 is way too much. Having too many units at a time on the field will screw up their Artifical intelligence and/or pathfinding, which means they'll be retarded, slow and won't even be able to walk.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top