JASS Question

S

sonic_kun

Guest
OK, so I'm using JASS editor....and I'm trying to create a trigger from scratch. I want my event to be "a unit dies".

When I convert that event to custom text, it uses

"call TriggerRegisterAnyUnitEventBJ( gg_trg_test_glow, EVENT_PLAYER_UNIT_DEATH )"


Instead, can I use the

"TriggerRegisterDeathEvent takes trigger whichTrigger, widget whichWidget returns event"?


If so, what is a widget and what eidget should I use in this scenario?
Thanks in advance!
 
D

Dino.pl

Guest
You can't use
Code:
TriggerRegisterDeathEvent takes trigger whichTrigger, widget whichWidget returns event
You can use
Code:
call TriggerRegisterDeathEvent(trigger, widget)
...

>what is a widget
Look at this image (it doesn't show all handles, though).
 
S

sonic_kun

Guest
that's what I meant :p forgot to include the "call" in the post.....

Anyways looks like I'll have to go read up on handlers.....
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
The only occurence of "TriggerRegisterDeathEvent" in Blizzard.j is the "A destructible in region dies".

Code:
function TriggerRegisterAnyUnitEventBJ takes trigger trig, playerunitevent whichEvent returns nothing
    local integer index

    set index = 0
    loop
        call TriggerRegisterPlayerUnitEvent(trig, Player(index), whichEvent, null)

        set index = index + 1
        exitwhen index == bj_MAX_PLAYER_SLOTS
    endloop
endfunction

So, it registers a "player unit event" for every player.
And, "TriggerRegisterPlayerUnitEvent" is a native.


Besides, there's not much of a point trying to optimize trigger creation functions.
They only run once anyway.
The difference is in the micro-seconds...
 

SFilip

Gone but not forgotten
Reaction score
634
you dont
handle=any variable
widget=unit, item or destructible

in other words
TriggerRegisterDeathEvent = Unit - Specific Unit Event - <some unit> dies
TriggerRegisterAnyUnitEventBJ = Unit - Generic Unit Event
 
D

Dino.pl

Guest
> handle = any variable
Nope.
Integer, string, real, boolean and code aren't handles.

> The only occurence of "TriggerRegisterDeathEvent" in Blizzard.j is the "A destructible in region dies".
It takes a widget so I guess it will work (for single units).
 
S

sonic_kun

Guest
Yeah I get it now........I can't use RegisterDeathEvent for the same reason why I can't use "specific unit dies....." events because I'm using unit variables....thanks guys!
 

SFilip

Gone but not forgotten
Reaction score
634
Dino.pl said:
> handle = any variable
Nope.
Integer, string, real, boolean and code aren't handles.
yeah well...i dont even consider them as variables although i know that is wrong. :p
 
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