Page 1 of 1

Activation Events

PostPosted: Mon May 06, 2013 4:46 pm
by Hblade
I never used these, what exactly do these do?

Re: Activation Events

PostPosted: Mon May 06, 2013 5:42 pm
by skydereign
Activation events in my opinion are one of the more powerful tools provided by gE. If you set them up properly, they act as custom events that you can insert at any point in code. For instance if you wanted to have a Create Actor 2 event which triggers after the actor has already been created (useful if you want to change some values of the actor after its actual create).

Re: Activation Events

PostPosted: Mon May 06, 2013 6:43 pm
by lcl
They are very useful! For example, Sabre won't exist without activation events.
Activation events allow you to activate code in other actors, even multiple times per one frame!
When a script executes a SendActivationEvent() -call, the code interpretation of the current event is stopped for the time the activation event is being executed. You won't of course notice that since it all happens in one frame, but it really does and gives one great possibilities.

Sabre uses activation events to change the texture actors animation and animation position for every single vertical line on the screen, so it happens as many times in a frame as the views width is (default 640). Without the use of activation events, the animation and animation position would be changed only once per frame, and that would make all the vertical lines to have the same animation and animation position. That's why Sabre needs activation events.

There is also much more you can do with activation events, but that's the basic idea of them. :)

EDIT: Sky explained the basic idea better than I did. He told the idea, I told what I use it for.... Well,anyway, I hope my post is helpful. :)

Re: Activation Events

PostPosted: Mon May 06, 2013 7:33 pm
by Hblade
Thanks guys :D