So what's up with the GUI custom events? How do I get one to work? I started making one thinking I'd figure it out as I go, but it looks like they're not in a working state. If you add a custom event to a trigger and try to compile it errors because in the trigger initialization it attempts to call your custom event, passing the trigger as the first parameter, which isn't in the event function's argument list. Example:
voidgf_GameSomethingSpecialHappens(){// no argument list}boolgt_test_trigger_Func(booltestConds,boolrunActions){// Stuff}//--------------------------------------------------------------------------------------------------voidgt_test_trigger_Init(){gt_test_trigger=TriggerCreate("gt_test_trigger_Func");gf_GameSomethingSpecialHappens(gt_test_trigger);// It's trying to pass the trigger, which would be useful if it compiled my function to accept one..}
So am I missing something or do these just not work?
I did some work with this stuff the other day. As far as I can tell, it's absolutely impossible in GUI.
In Galaxy itself, it's also messy because you have to maintain a list of the triggers that are "listening" on the event (big array potentially).
The problem, as you pointed out, lies with the first "implicit" parameter of trigger that GUI seems to completely forget about and ignore.
I wouldn't mind keeping track of the triggers myself...I just figured since they put it in the GUI it would actually work. I really liked the idea of letting users of a custom lib register for an event directly into the GUI, as opposed to some action TriggerAddEventMyEvent(a trigger, ....).
Yeah. Atm I'm just working around it by having a periodic event that checks whether conditions the event would be fired under are met. It's rather sloppy but I imagine Blizzard will eventually fix it. I have the exact same custom library situation. Lol
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So what's up with the GUI custom events? How do I get one to work? I started making one thinking I'd figure it out as I go, but it looks like they're not in a working state. If you add a custom event to a trigger and try to compile it errors because in the trigger initialization it attempts to call your custom event, passing the trigger as the first parameter, which isn't in the event function's argument list. Example:
So am I missing something or do these just not work?
Bump :)
I did some work with this stuff the other day. As far as I can tell, it's absolutely impossible in GUI.
In Galaxy itself, it's also messy because you have to maintain a list of the triggers that are "listening" on the event (big array potentially).
The problem, as you pointed out, lies with the first "implicit" parameter of trigger that GUI seems to completely forget about and ignore.
I wouldn't mind keeping track of the triggers myself...I just figured since they put it in the GUI it would actually work. I really liked the idea of letting users of a custom lib register for an event directly into the GUI, as opposed to some action TriggerAddEventMyEvent(a trigger, ....).
@ubermikeleet: Go
Yeah. Atm I'm just working around it by having a periodic event that checks whether conditions the event would be fired under are met. It's rather sloppy but I imagine Blizzard will eventually fix it. I have the exact same custom library situation. Lol