I may be missing something basic here, but if I make a custom event, is there any way for a trigger to get what the event parameters were? For example, with native events you can use functions like (Triggering Player). The workaround I'm using for now is to use global variables to store info, but that's ugly and I'm a little worried about race conditions.
Are you having an issue where it keeps saying "Wrong number of Parameters!" when you try to save (which causes a failed compile)? I'm trying to get around that too.
Native events don't really have parameters tho, it's all functions which return a global value.
You'll notice that if you wait in an event handler you will in fact get a race condition.
Events DO have parameters. Custom events are currnetly broken.
The first implicit and hidden parameter is of type trigger, to the callback. GUI seems to have forgotten this.
Depends on how you define parameters, SC2's event model seems to be very different from the normal paradigm, probably due to being synchronous.
Anyways, race conditions do seem occur between event callbacks, i.e
boolgt_A_Func(booltestConds,boolrunActions){if(!runActions){returntrue;}Wait(10)// if trigger B has called at this time, // it will point to whichever player triggered that event.TriggerDebugOutput(1,IntToText(EventPlayer()),true);}boolgt_B_Func(booltestConds,boolrunActions){if(!runActions){returntrue;}TriggerDebugOutput(1,IntToText(EventPlayer()),true);}
By this fact it's a rather safe bet that EventPlayer etc are globals. (would have assumed it was thread local but that's not the case)
Native events don't really have parameters tho, it's all functions which return a global value. You'll notice that if you wait in an event handler you will in fact get a race condition.
O Rly! Thanks for the info, proberbly saved me ALOT of debuging some time down the line!!!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I may be missing something basic here, but if I make a custom event, is there any way for a trigger to get what the event parameters were? For example, with native events you can use functions like (Triggering Player). The workaround I'm using for now is to use global variables to store info, but that's ugly and I'm a little worried about race conditions.
Are you having an issue where it keeps saying "Wrong number of Parameters!" when you try to save (which causes a failed compile)? I'm trying to get around that too.
Native events don't really have parameters tho, it's all functions which return a global value. You'll notice that if you wait in an event handler you will in fact get a race condition.
@caspersc: Go
Events DO have parameters. Custom events are currnetly broken. The first implicit and hidden parameter is of type trigger, to the callback. GUI seems to have forgotten this.
Depends on how you define parameters, SC2's event model seems to be very different from the normal paradigm, probably due to being synchronous.
Anyways, race conditions do seem occur between event callbacks, i.e
By this fact it's a rather safe bet that EventPlayer etc are globals. (would have assumed it was thread local but that's not the case)
Edit: Nvm! :D
O Rly! Thanks for the info, proberbly saved me ALOT of debuging some time down the line!!!