Development Forum |
|
C2 Extra events (numbers 16-29) | |
|
dingus
|
11/21/2020 | 1 |
Hello. First post to the dev forum. Forgive me if this isn't the correct place.
Lately I've been tinkering with the simplest of objects in an attempt to better understand the engine's event prioritisation, pre-emption and routing.
I've discovered a curious behaviour that makes no sense without an insight into the problem it was intended to solve. Maybe you've gained that insight and will share it with us.
If an object has a handler for Extra Activate 1 (EA1), the Activate 1 (A1) handler is never invoked. I won't bore you with the details but I've conducted sufficient experiments to be certain this is not a random glitch.
It's possible that there's some precondition, that I've not yet met, that is preventing A1 from being invoked. I have determined that the object is NOT active at the moment the A1 event is triggered (i.e. actv == 0).
I have tried explicitly triggering A1 from within the EA1 handler. There's no evidence that the A1 handler is ever invoked. I've modified the same line of CAOS in the EA1 handler to trigger a user-defined event (UDE). That UDE handler is invoked as expected.
I can't yet say whether this apparent "suppression" is evident in other Extra non-extra Event pairs but I plan to explore that possibility.
Has anyone else observed this behaviour? What purpose does it serve?
Please share your knowledge (or speculations).
dingus |
dingus
|
11/29/2020 | 1 |
A couple of fresh gobbets for those following along at home.
The (vanilla) Eden Scriptorium contains wildcard Extra Activate [12] handlers:
I suspect they are the default handlers that are invoked if an object doesn't define its own. Does anyone know whether this is true? If noone can say for sure I'll hack in some BBLEs and then we'll know.
After my last post I had an epiphany. I'd made a newb mistake when attempting to trigger A1 from within the EA1 handler. The first dozen message numbers used in calls to MESG WRIT and MESG WRT+ are not Event numbers. Consequently I was sending Message 1 which was triggering A2 (and my test object had no A2 handler).
After changing my code to use Message 0, I was able to fire A1 from within EA1.
The wildcard EA1 and EA2 handlers in the Scriptorium that do this too. Which kinda suggests that this is the way it should be done.
dingus
|
bedalton
|
1/5/2021 | |
I have had this problem in C1 as well. In the C1 scriptorium, I believe all or at least most extra scripts, manually call the event script on the object. So for an extra activate 1 script, it calls .
I do not know why this is a thing, but I just encountered this a week or two ago, when using the extra activate script for the first time. |
bedalton
|
1/5/2021 | |
Sorry, missed your second post somehow (not enough sleep i think), where you say essentially the same thing. Sorry couldn't add anything more helpful. |
|