Page 1 of 1

DestroyTimer actor

PostPosted: Sat Apr 28, 2012 3:10 pm
by Fojam
could you add a DestroyTimer2 function that lets you specify which actor you want to destroy a timer from?

Re: DestroyTimer actor

PostPosted: Sat Apr 28, 2012 3:52 pm
by skydereign
I've written one, along with function2 for getAnimName, getAnimIndex, and other gE functions that don't support it. It'll probably be added into the 1.5 release.

Re: DestroyTimer actor

PostPosted: Sat May 05, 2012 9:45 pm
by Fojam
Could you post the code for them? It would make my code a whole lot better until 1.5 comes out

Re: DestroyTimer actor

PostPosted: Sat May 05, 2012 9:54 pm
by skydereign
I wrote it in the source, so you'd have to build the source and create a new gE export with the function included. You could however use activation events to write a DestroyTimer2 function (but you would need any actor that receives it to have an activation event), which wouldn't involve building gE.

Re: DestroyTimer actor

PostPosted: Sat May 05, 2012 9:57 pm
by Fojam
Activation events are a pain. Couldn't you just write it in a .c file or something and i just use #include to import it?

Re: DestroyTimer actor

PostPosted: Sat May 05, 2012 10:07 pm
by skydereign
Activation events are one of the most powerful tools gE has. While gE has its share of bugs and other general problems, almost all of them are in some way avoidable because of activation events. They serve as a custom event for pretty much anything.

The reason I can't write a .c file is because I edited the source. The function can't be done in normal gE, it has to be provided, since it accesses parts of the engine that we don't have access to in the editor. You have to compile a version with the function inserted. Anyway, #include only allows you to insert gE code, so it is the same thing as putting it in global code.