Triggeractions.

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Is it possible for me to attach a struct to a triggeraction (yes), and reference the triggeraction being run in the triggeraction? Something like GetTriggerEventId() for triggeractions? If so that would help a bunch.

JASS:
function Actions takes nothing returns nothing
    local unit kill=GetHandleUnit(GetRunningTriggerAction())
    call KillUnit(kill)
endfunction


Moreover, if I do:

JASS:
function Blah takes unit u, trigger t returns nothing
    local triggeraction ta=TriggerAddAction(t,function Actions)
    call SetHandleUnit(ta,u)
endfunction


Can I call that multiple times on the same trigger, with different units, and expect 'Actions' to run as many times as I added it? (and will each action run have a unique id?)


The idea of this is to add an infinite number of objects to a singular object through triggering. Triggeractions can be added and removed, and I need triggers to run differently for each time I add the action, but, I want them all to run at once. I just need some help with this.
 

emjlr3

Change can be a good thing
Reaction score
395
do not think you can g et the running trigger action, unless that function you posedted existed

only way to get the unit woulld prolly to attach it to the trigger, however, you could alternativly, attach the ta to the triggers, grab the ta from the triggeringtrigger, and then the unit from the ta, though that would kind of defeat the purpose
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Yes it would. Turns out I decided to trade this method in for a different, equally limitless, slightly faster method.
 
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