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
534
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
534
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 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