Page 1 of 1

T-Kill/Unit patrol

Posted: Fri Feb 03, 2012 12:16 pm
by DarkJustice12
this is for anyone who wants it but mostly i want 3ice to check it for leaks

Re: T-Kill/Unit patrol

Posted: Fri Feb 03, 2012 12:35 pm
by 3ICE
That's a bad way to do it. Good idea and nice effort, but you generate much more lag than the currently accepted standard does. (Which is 11 kill triggers, one for each player.) Unit comes within range of unit is much faster than Pick every unit in (Units within PickingRange of UnitLoc) on a tight 0.03 timer.

I'm ignoring all leaks in setup because they only leak once.

PatrolUnits would imply a unit group because it is plural. Rename it to (Current/Picked)PatrolUnit.

Actually, Set PatrolUnits = (Picked unit) is probably unnecessary. Referring to Picked unit is faster. Warcraft 3 correctly handles nested unit groups, so you won't have conflicts just because there are two picked units at the same time. The inner block will use the second picked unit and the outer block will use the first.

Unit Group - Pick every unit in (Units within PickingRange of UnitLoc) leaks a group (Units within PickingRange of UnitLoc) every 0.03 seconds and is generally much slower than the standard kill triggers as noted above.

Change ((Picked unit) belongs to an enemy of (Owner of PatrolUnits)) Equal to True to (Picked unit) belongs to an enemy of Player 12 (Brown) or the even simpler (Owner of (Picked unit)) Not equal to Player 12 (Brown).

I created a similar system and then deleted it after realizing it was slower than the hated (but still the best) 11 kill triggers standard.

If you have 100 patrolling units, your system will temporarily create 100 empty groups every 0.03 seconds and often store actual units in them before discarding them. The accepted standard keeps it at 11, no matter how many patrols you have.