Is this leaking, how to improve it

Fuin

New Member
Reaction score
0
This is my trigger for sending players units, it usually send more then 70 units even 150
Trigger:
  • Mass Red
    • Events
      • Unit - A unit enters Red Mass <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to Player 1 (Red)
      • (Unit-type of (Entering unit)) Equal to Mass Sender
    • Actions
      • Set Red = (Units in Mapa <gen> owned by Player 1 (Red))
      • Set cel_footmenow = (Center of Cel Footmenow <gen>)
      • Set wisp = (Center of Red Wisp <gen>)
      • Unit - Kill (Entering unit)
      • Unit - Create 1 Mass Sender for Player 1 (Red) at wisp facing Default building facing degrees
      • Unit Group - Pick every unit in Red and do (Unit - Order (Picked unit) to Attack-Move To cel_footmenow)
      • Custom script: call RemoveLocation(udg_cel_footmenow)
      • Custom script: call RemoveLocation(udg_wisp)

So the question is: Does it leak? If yes where and how remove it, also i have a one problem with it. When I use it to send 12-24 units it's just fine, but when it comes to 100 or more (and it's usually used for that) units move like... don't know how to describe it well they're moving like on laggs few of them go first and then next few, the biggest problem during this is that you don't have control on units, ofc you can click one and order it to go elsewhere but before this unit will move where you ordered there is like 5-10 sec while it's just staying and doing nothing, so trying to rescue a hero for example is impossible. Is there any way to prevent this or every trigger will cause those situations.
I'm sorry for my english I hope you will understand what i mean, if not i may try to describe it once again.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, yeah it leaks... You're not removing this variable:
Trigger:
  • Set Red = (Units in Mapa <gen> owned by Player 1 (Red))


Add this:

Trigger:
  • Custom script: call DestroyGroup(udg_Red)
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
Code:
Unit Group - Pick every unit in Red and do (Unit - Order (Picked unit) to Attack-Move To cel_footmenow)
this line does leak. its a unitgroup variable which has to be used in here.
 

HydraRancher

Truth begins in lies
Reaction score
197
>Accname

What? he does use a Unit - Group variable - "Red"

This line does not leak:
Trigger:
  • Unit Group - Pick every unit in Red and do (Unit - Order (Picked unit) to Attack-Move To cel_footmenow)


Just do what Komaqtion said and its fine.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
He uses a unit group there:
Code:
Unit Group - Pick every unit in [COLOR="Red"]Red[/COLOR] and do (Unit - Order (Picked unit) to Attack-Move To cel_footmenow)

Just not destroying it :D
 

vypur85

Hibernate
Reaction score
803
> moving like on laggs few of them go first and then next few

This can't be helped if you're creating multiple units and giving them order simultaneously. The game needs to 'think' the movement path and so creating this lag if enormous amount of unit is involved.

A workaround is to create unit one by one and order them respectively. (If you play Element TD, you'll know what I mean.)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top