GUI Chronosphere leak

Super.Gnome

New Member
Reaction score
0
I'm stealing an ability from dota. The chronosphere ability pauses everything in an area, and everything that enters that area during the duration. It takes me two simple triggers to accomplish the effect.

Trigger:
  • ChronoSphere
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chronosphere
    • Actions
      • Set CS_Point = (Target point of ability being cast)
      • Set CS_Caster = (Casting unit)
      • Trigger - Turn on Chronosphere Effect <gen>
      • Unit - Create 1 ChronoSphere for (Owner of (Triggering unit)) at CS_Point facing Default building facing degrees
      • Set CSdummy = (Last created unit)
      • Set CS_effect = (Last created special effect)
      • Wait (2.00 x (Real((Level of Chronosphere for (Triggering unit))))) seconds
      • Trigger - Turn off Chronosphere Effect <gen>
      • Unit - Remove CSdummy from the game
      • Unit Group - Pick every unit in CS_Group and do (Unit - Unpause (Picked unit))
      • Custom script: call RemoveLocation (udg_CS_Point)


And

Trigger:
  • Chronosphere Effect
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set CS_Group = (Units within 500.00 of CS_Point matching (((Matching unit) Not equal to CS_Caster) and ((((Triggering unit) is A structure) Equal to False) and (((Triggering unit) is Magic Immune) Equal to False))))
      • Unit Group - Remove CSdummy from CS_Group
      • Unit Group - Pick every unit in CS_Group and do (Unit - Pause (Picked unit))



The problem I have is that the second trigger leaks a unit group. But if I clear that leak I can't unpause the units in the first trigger.

Any ideas on how to clear the leak, and maintain a functional spell? I'm sure there is a way...
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, you can simply have one single unit-group which you only add and remove units from, instead of creating a new on each 0.01 seconds. (I'd recommend you increasing this to maybe 0.05, or 0.1 or so ;)

Like this then:
Trigger:
  • Set CS_TempGroup = (Units within 500.00 of CS_Point matching (((Matching unit) Not equal to CS_Caster) and ((((Triggering unit) is A structure) Equal to False) and (((Triggering unit) is Magic Immune) Equal to False))))
    • Unit Group - Remove CSdummy from CS_TempGroup
    • Unit Group - Pick every unit in CS_TempGroup and do (Unit - Pause (Picked unit))
    • Unit Group - Add all units of CS_TempGroup to CS_Group
    • Custom Script: call DestroyGroup(udg_CS_TempGroup)


Freehanded... Don't have WE with me :(
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
It might be better if you pause them in the "ChronoSphere" trigger and at the end or somewhere in this trigger to start a timer that will expire in "[lJASS](2.00 x (Real((Level of Chronosphere for (Triggering unit)))))[/lJASS] seconds".
Then in some other trigger with the event <timer name> expires unpause the units. Idk...if it's better or not but still : ))
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
Make a dummy unit with pathing collision radius 0 and place it in a non used region on your map.Then do that
Trigger:
  • Chronosphere
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Channel
    • Actions
      • Set CS_Point = (Target point of ability being cast)
      • Set CS_Caster = (Casting unit)
      • Unit - Move Dummy &lt;gen&gt; instantly to (CS_Point)
      • Wait (2.00 x (Real((Level of Channel for (CS_Caster))))) seconds
      • Unit Group - Pick every unit in CS_Group and do (Unit - Unpause (Picked unit))
      • Unit - Move Dummy &lt;gen&gt; instantly to (&quot;unused_region&quot;)
      • Custom script: call RemoveLocation (udg_CS_Point)
      • Custom Script: call DestroyGroup(udg_CS_Group)

And that
Trigger:
  • Chronosphere
    • Events
      • Unit - A unit comes within 500.00 of Dummy &lt;gen&gt;
    • Conditions
      • (((Triggering unit) Not equal to CS_Caster) and ((((Triggering unit) is A structure) Equal to False) and (((Triggering unit) is Magic Immune) Equal to False))))
    • Actions
      • Unit Group - Add (Triggering unit) to (CS_Group)
      • Unit Group - Pick every unit in CS_Group and do (Unit - Pause (Picked unit))
 
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