Will these cause leaks?

meehael

New Member
Reaction score
6
Hi everyone,

Will this cause any leaks:
Code:
Destructible - Pick every destructible in [B](Entire map)[/B] and do (Actions)
    Loop - Actions
        ...
What if I put "Start <gen>" which is a preplaced region, or MyRegion which is a variable -> instead of (Entire map)?

And what about this:
Code:
Player Group - Pick every player in [B](All players)[/B] and do (Actions)
    Loop - Actions
        ...
What if I put MyPlayerGroup which is a variable instead of (All players)?

And what about adding/removing units or players to a unit group or a player group which is a variable. For ex. Add (unit)Grunt to (unit group)RaidParty. Does this cause leaks?

I read both tutorials I could find, but some things aren't clear to me. I'm new to memory leak removals.

Thanks for the help,
Regards!
 

wellwish3r

wishes wells.
Reaction score
52
(All Players) does not, im not sure about the entire map though, but i don't think so.
 

vypur85

Hibernate
Reaction score
803
Both Regions and All Player (and only All player) do not leak that way. No worries about them.

> adding/removing units or players to a unit group or a player group which is a variable

No leak.


Edit again:
> MyPlayerGroup

It actually depends on how you create the Player group.

This is not a good idea:
Code:
Set MyPlayerGroup = (All players)
...actions...
Custom Script:      call DestroyForce (udg_MyPlayerGroup)


This is a good idea:
Code:
Set MyPlayerGroup = [I]Other than All players[/I]
...actions...
Custom Script:      call DestroyForce (udg_MyPlayerGroup)
 

SFilip

Gone but not forgotten
Reaction score
633
(Entire map) leaks.

For future referrence - regions (rects) that leak (all are under Function, preplaced regions never leak):
  • Entire Map
  • Current Camera Bounds
  • Region With Offset
  • Conversion - Convert Point With Size To Region
  • Conversion - Convert Coordinates To Region
  • Conversion - Convert Points To Region

To fix this leak, you need a region variable, lets call it MyRegion.
Example leakless Entire Map:
Code:
Actions
    [B]Set MyRegion = (Entire map)[/B]
    Destructible - Pick every destructible in [B]MyRegion[/B] and do (Actions)
        Loop - Actions
            -- actions here --
    [B]Custom script:   call RemoveRect(udg_MyRegion)[/B]
 

meehael

New Member
Reaction score
6
vypur85 said:
Both Regions and All Player (and only All player) do not leak that way. No worries about them.
There are three regions :p. Entire map, Start <gen> and MyRegion. Which don't leak?
You mentioned that only "All players" doesn't leak. So you say that, e.g. "Allies of Player" leaks?

vypur85 said:
It actually depends on how you create the Player group.
I just added a few players (those "slots" that are actually playing) to the group at map initialization.
 

meehael

New Member
Reaction score
6
@sfilip:
OK, it's good to know that. And what about variable regions? Do they ever leak?

Do these:
  • Initial Camera Bounds
  • Playable Map Area
also leak?
 

meehael

New Member
Reaction score
6
And does this cause a leak:
Code:
Camera - Lock camera target for (Picked player) to (Last created unit), offset by (-5.00, 171.20) using Default rotation
What if I replaced (Last created unit) with (Random Unit from (Units in a Region)) or Event Response - Dying Unit?

Thanks! :)
 
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