TriggerAddEvent Stuff

TheOverWhelm

Member
Reaction score
16
Question is, I am confused on how to add events through JASS to other JASS functions. I'm assuming it can be done, since that's how GUI does it and many others I imagine.
call TriggerRegisterUnitEvent(SummonerDies, GetTriggerUnit(), EVENT_UNIT_DEATH )
Like this, how would I pass the trigger? SummonerDies just goes to a 1 when it compiles.
Futurethanks
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Well, is SummonerDies your local trigger name?
JASS:
native TriggerRegisterUnitEvent takes trigger whichTrigger, unit whichUnit, unitevent whichEvent returns event

You need to create a local trigger first:
JASS:
local trigger trig = CreateTrigger()
call TriggerRegisterUnitEvent(trig, GetTriggerUnit(), EVENT_UNIT_DEATH)
...
set trig = null

Also, I don't believe [ljass]GetTriggerUnit()[/ljass] will work, since nothings actually died yet.
Use [ljass]TriggerRegisterAnyUnitEventBJ[/ljass]:
JASS:
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_DEATH)
...
set trig = null



And, just for the future, JASS questions this should be in the JASS Help sub-forum.
 

TheOverWhelm

Member
Reaction score
16
Oh, sorry, I thought I was there and hit Post ^_^
I should've said more too, SummonerDies is a trigger in the Mapscript that already exists, and this call is inside a trigger that adds the event. In this case, the GetTriggerUnit() is actually a unit.
 
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