Quick question: Will this leak?

MintJulep

New Member
Reaction score
4
Code:
Events
Unit - A unit enters (Region A)

Conditions
Actions
Unit - Kill (triggering unit)

It has to be a unit group for it to leak, right?
 

Flare

Stops copies me!
Reaction score
662
If region A is dynamic (i.e. not one of those regions created using the Region Palette, or a region that's defined once during the map), then yes, it does leak. If it's one you created using the Region Palette, or one that's created by triggers, but it's set to a variable and the variable isn't overwritten, then no, it doesn't leak

It has to be a unit group for it to leak, right?
Locations, unit/player groups, special effects, and regions (depending on how they were created) can leak
 

MintJulep

New Member
Reaction score
4
Really? I didn't know events could cause leaks like that. How d'we even prevent leaks in an event that uses a region created in another trigger then? The snippet from the other trigger was something like,

Code:
Variable - Set (Region A) equal to (Region centered at somepoint with size 300, 300)
Trigger - Add to (Trigger from first post) the Event - (Unit enters Region A)
Trigger - Turn on (Trigger from first post)
Wait 10.00 seconds.
Trigger - Turn off (Trigger from first post)
Custom Script: call RemoveRect (udg_Region A)
 

Tyman2007

Ya Rly >.
Reaction score
74
Create a region using a trigger.. i think..

Flare confuses me in a way that if someone confused me, i'd say hey, you're confusing me.
 

Flare

Stops copies me!
Reaction score
662
If Region A is one of those
Code:
Some region name <gen>
then there's no leak issue

If you did
Code:
Events:
  Map Init
Conditions:
  -
Actions:
  Set RegionVar = Create rect/region (I forget which one GUI uses) from points/coordinates/whatever
  Add the event (Unit enters RegionVar) to Trigger that registers enter region <gen>
No leak since you're defining the region once, and it's always in use

But...
Code:
  Set RegionVar = Create rect/region (I forget which one GUI uses) from points/coordinates/whatever
  Add the event (Unit enters RegionVar) to Trigger that registers enter region <gen>
  Set RegionVar = Create rect/region (I forget which one GUI uses) from points/coordinates/whatever
  Add the event (Unit enters RegionVar) to Trigger that registers enter region <gen>
Leaks - you've lost the reference to the first region set to RegionVar, but if you only do it a few times, it's not a big deal (since a leak or two here and there won't make a difference) -BUT- you won't be able to refer to the first region in Trigger that registers enter region <gen> because there's no reference to it

Flare confuses me in a way that if someone confused me, i'd say hey, you're confusing me.
As Borat would say, Great Success!
 
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