Destructible group in Jass

wellwish3r

wishes wells.
Reaction score
52
Stupid question, but what is a destructible group in JASS?

EDIT: Okay, i just saw that there isn't even a destructible group variable type in the GUI variable menu. So does a destructible group even exist?
 

Tom Jones

N/A
Reaction score
437
It doesn't. We have EnumDestrutablesInRect(...) or something like that, where can filter destructables we don't want enumerated.
 

wellwish3r

wishes wells.
Reaction score
52
I was just wondering, cause storing them in a variable would shorten some functions/triggers considerably ;) (Don't have to EnumDestructablesInRect() all the time)
 

Romek

Super Moderator
Reaction score
963
I made TriggerGroups a long, long time ago.
So I could make this without problem.

Though I don't see the use for it...
Why would you need it?
 

Romek

Super Moderator
Reaction score
963
Nicer for what?
Be shorter than what?

I've never needed to store desctructables in a group.
And nothing is shorter or faster than EnumDestructablesInRange...
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
Any replacement alternatives to EnumDestructablesInRect would be considerably less efficient and be far more complicated to make than to use the native, nevertheless how ugly it might be.
 

wellwish3r

wishes wells.
Reaction score
52
Nicer for what?
Be shorter than what?

I've never needed to store desctructables in a group.
And nothing is shorter or faster than EnumDestructablesInRange...

Here for example:
JASS:
function MakeDestroBossOneVul takes nothing returns nothing
    if GetDestructableTypeId(GetEnumDestructable()) == 'B002' then
        call SetDestructableInvulnerable(GetEnumDestructable(),false)
    endif
endfunction

function MakeDestroBossTwoVul takes nothing returns nothing
    if GetDestructableTypeId(GetEnumDestructable()) == 'B001' then
        call SetDestructableInvulnerable(GetEnumDestructable(),false)
    endif
endfunction

function Trig_MakeDoodVul_Actions takes nothing returns nothing
    local integer id = GetUnitTypeId(GetTriggerUnit())
    if id == 'n00N' then
        call EnumDestructablesInRect(GetPlayableMapRect(),null, function MakeDestroBossOneVul)
    endif
    if id == 'n00O' then
        call EnumDestructablesInRect(GetPlayableMapRect(),null, function MakeDestroBossTwoVul)
    endif
endfunction

//===========================================================================
function InitTrig_MakeDoodVul takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( t, function Trig_MakeDoodVul_Actions )
endfunction


Here for example it would save the if statements (in the action functions), and i just like to store stuff in variable, that's all :D
 

Romek

Super Moderator
Reaction score
963
That's still probably faster than any 'destructablegroup' anybody could create.
Natives are extremely fast.

That's not particularly long either. :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top