'groupenum leaks if you dont use a filter'

substance

New Member
Reaction score
34
JASS:
GroupEnumUnitsInRange(g,x,y,100,null)


Apparently that leaks because it doesnt use a filter.

So what's a way around it? Just make a global boolexp and use it whenever you call a groupenum.

No, I havent tested it so I'm not 100% sure if this is true, but what's the harm if it isnt? =p

Just thought i'd share with you guys because I didnt know and I havent seen a tutorial that has mentioned this and it's kind of a big deal.
 
this is true, afaik
 
Actually.. Does it really leak if you use nothing as a boolexpr? If it does, it's so small leak ;D
 
> No, I havent tested it so I'm not 100% sure if this is true

Tested what ? Why you tell it leaks ?

I was told by someone from wc3c, apparently it was discussed a while ago on there... but i've never seen anyone say it to the people here on these boards.

Most people who are forced to use a short periodic event, ie. 'Every 0.03 seconds' use groupenum in the function, so if that leaks you can imagine how much power is lost.
 
It' s so imba, when you use filter it still eats performance and not few ! Do unlogical comparison what is always true or even better return just true

JASS:

function AlwaysTrueFilter takes nothing returns boolean
     return true
endfunction

function Test takes nothing returns nothing
     local group allUnits = CreateGroup()
     local boolexpr alwaysTrueFilter = Condition (function AlwaysTrueFilter)

     local real locationX = 0.
     local real locationY = 0.

     call GroupEnumUnitsInRange(allUnits,locationX,locationY,100,alwaysTrueFilter)
endfunction
 
i don't understand how exacly entering a null value instead of boolexpr is leaking?
i mean it's null.... it doesn't contain anything in it, it's like a pass on me action
also the fact that it replace a boolexpr which doesn't leak anyway so if u say he leaks as a boolexpr it's nott exacly true....
and btw u didn't say exacly what it leaks....

>Sooda
i don't know if it would work but it would be easier if u do:
JASS:
function Test takes nothing returns nothing
     local group allUnits = CreateGroup()

     local real locationX = 0.
     local real locationY = 0.

     call GroupEnumUnitsInRange(allUnits,locationX,locationY,100,Condition (true)
endfunction

i never tried to do this but theoretically it should work i think
 
at map init create a global boolexpr varialbe, no need to create a new one everytime you need it
 
a boolean and a boolexpr(filter) are not the same thing.

it isn't technically a leak, it's more like WC3 gobbles more memory every time you do a groupenum with a null filter. It caps eventually but it causes excessively high memory usage and will cause lag before long if you use groupenums often.

put a boolexpr that returns true in a global var and use that instead of null.
 
I don't understand why using null there leaks
Nobody does, but it is true.

I used to have something like this:

JASS:

library BoolexprUtils initializer init
    globals 
          boolexpr BOOLEXPR_TRUE
          boolexpr BOOLEXPR_FALSE
    endglobals

    private function rtrue takes nothing returns boolean
          return true
    endfunction

    private function rfalse takes nothing returns boolean
          return false
    endfunction


     private function init takes nothing returns nothing
           set BOOLEXPR_TRUE = Condition(function rtrue)
           set BOOLEXPR_FALSE = Condition(function rfalse)
     endfunction
     
endlibrary


But it is actually useless since because Condition() doesn't create new boolexprs everytime you can just use Condition(function SomethingReturnsTrue) instead, although I think boolexprutils make code easier to read...
 
Condition takes code so no, you can't do it that way.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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