Spellpack Goblin Blaster

Omni

Ultra Cool Member
Reaction score
37
after seeing a ton of tuorials getting approved i can only say: bump
 

Tinki3

Special Member
Reaction score
418
Everything seemed fine in all of your triggers, apart from this line:
Code:
call ForGroupBJ(GetUnitsInRangeOfLocMatching(800.00, L, [COLOR="Red"]Condition(function Trig_Blaster_Aura_Filter)[/COLOR]), function Trig_Blaster_Aura_UnitLoop)
Your code leaks a boolexpr there.

You could also rid the BJ from the 'ForGroup'.
 

Omni

Ultra Cool Member
Reaction score
37
Ok,

1. Whats a boolexpr?

2. how to fix it?

3. if that leaks does the GUI pick every unit in blabla matching,... leak too?
:)D cause i'd like that, and dont ask me why)
 

Tinki3

Special Member
Reaction score
418
>Whats a boolexpr?

Well, a boolexpr.
No need to go into detail really.
You just need to know that they leak.

>how to fix it?

JASS:
function filter takes nothing returns boolean
    return GetWidgetLife(GetFilterUnit()) > 0.405 
endfunction

function action takes nothing returns nothing
    local group g = CreateGroup()
    local boolexpr b = Condition(function filter)
    call GroupEnumUnitsInRange(g, X, Y, 500.0, b)
    //...
    call DestroyGroup(g)
    call DestroyBoolExpr(b)
    set g = null
    set b = null
endfunction

As you can see, we use the boolexpr variable to store the condition data,
which we use in the group g to filter units.

BoolExprs require to be destroyed and nulled after use.
To prevent mem. leaks.

Get the point?

>if that leaks does the GUI pick every unit in blabla matching,... leak too

I wouldn't say it doesn't.

EDIT:
>if GetRandomInt(1, 100) < ( GetUnitAbilityLevel(GetEnumUnit(), BlasterAura()) * BlasterChancePerLevel())

Why are you using EnumUnit's BlasterAura() level to get the chance?
Shouldn't Triggering unit be used here instead?
 

Omni

Ultra Cool Member
Reaction score
37
*Fixed*

well i already fixed it 10 mins afer you posted the solution tinkie :p
but for a misterious reason i had to go away...

so, approve it?

Edit:

Why are you using EnumUnit's BlasterAura() level to get the chance?
Shouldn't Triggering unit be used here instead?

because when a unit dies within range of a unit with blaster aura it might go boom
not when a unit dies with blaster aura it might go boom
 

Xapphire

Liberty, Simply said; a lie.
Reaction score
45
Hey, thats really cool, maybe for a nice goblin based map this would be the perfect spells for a boss. Good job
 

Sim

Forum Administrator
Staff member
Reaction score
532
boolexprs leak only once, so they do not need to be removed.

The first time, it is created, and stored somewhere.

The second time used, instead of being re-created, the same boolexpr created before is used again.

Since 1 leak is far from being a problem, especially that it doesn't really "leak" since it is re-used, it shouldn't be destroyed.

Also Vexorian stated that destroying boolexprs is not always a good idea :)
 

Tinki3

Special Member
Reaction score
418
>so they do not need to be removed
>1 leak is far from being a problem

That's debatable :p

What if I have 25 triggers that all use at least 5 boolexprs?
IMO, it'll turn into leak-land in no time with all of the usual(*) lag going on in the background.

(*) Other leaky triggers + normal map/b.net lag.

I do see what you're saying though,
"its not really a big deal",
"Might as well leave the leak be",
"Run along now little leak",
"Do your thing".

However, as you said,
"it doesn't really 'leak' since it is re-used, it shouldn't be destroyed"

:p
 

Sim

Forum Administrator
Staff member
Reaction score
532
No the real problem is that 1 leak is nothing compared to the problems destroying a boolexpr occasionally cause... ;)

it isn't worth the risk.

> What if I have 25 triggers that all use at least 5 boolexprs?

They would all need to use different boolexprs, and those boolexprs would only leak one, so a total of 125 leaks.

It sure is a big amount, a trigger that has only 1 leak every second would bypass that number in 2 minutes.

Plus, if you have 5 boolexprs per trigger you might want to reformulate how you are coding :p

EDIT: Heh, here's a link : http://wc3campaigns.net/showthread.php?t=93168&highlight=Condition()
 

Omni

Ultra Cool Member
Reaction score
37
Sorry for the long delay, i had to fly to swiss :)
(swiss keyboards suck they switched the Z and the Y and i cant find the excamation mark xD)

anyway, why not destroy boolexprs_ (aah where is the question mark __)

and Oyeah finally approved ^_______^

Edit:

"if you have 5 boolexprs per trigger you might want to reformulate how you are coding"

5 * triggers LOL
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    363 bots on the forum been like that for about a month this is the most bots we have ever consistently hosted
  • The Helper The Helper:
    and we are on cloud flare too right?
  • Stephen Stephen:
    Probably stupid AI garbage. It's harvesting our Nuon knowledge.
  • Stephen Stephen:
    The bots I mean.
  • The Helper The Helper:
    I suspect AI Bots as well
  • The Helper The Helper:
    Happy Saturday!!!
    +1
  • The Helper The Helper:
    I reorganized the forums somewhat but I doubt anyone would notice
  • The Helper The Helper:
    Happy Friday!
    +1
  • The Helper The Helper:
    Happy Saturday!
    +1
  • The Helper The Helper:
    The forum software says we have 554 members online now. We did not have that many unique visitors the whole day today. Too many bots and the disconnect between the forum counts and the stats.
  • Varine Varine:
    Currently it says 413 guests and 2 members
    +1
  • Varine Varine:
    Aww
  • The Helper The Helper:
    That is going to be mostly bots
  • The Helper The Helper:
    527 (members: 2, guests: 525)
  • The Helper The Helper:
    Happy Saturday!
    +1
  • V-SNES V-SNES:
    Happy Saturday!
    +1
  • The Helper The Helper:
    622 (members: 2, guests: 620)
  • The Helper The Helper:
    666 (members: 4, guests: 662) :)
    +1
  • Varine Varine:
    609 (members: 4, guests: 605)
  • The Helper The Helper:
    I was posting that last one because the 666 users online :)
    +1
  • The Helper The Helper:
    Happy Wednesday Night!
    +1
  • The Helper The Helper:
    Happy Thursday!
    +1
  • The Helper The Helper:
    Marathon watching The Expanse!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    leaving for the weekend in San Antonio will be gone until Sunday afternoon
    +1

    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