Page 1 of 1

Creating an Actorless Timer

PostPosted: Fri Feb 22, 2013 2:52 am
by bamby1983
Scenario:
When global function A is called, I would like to introduce a time delay after which global function B will be called, but no actor in particular will be associated with the delay.

Questions:
1) Is it possible to introduce the above delay without using a timer?
2) If yes, is it advisable to do this?
3) If no, is it possible to create a timer without assigning it to a particular actor?

Re: Creating an Actorless Timer

PostPosted: Fri Feb 22, 2013 4:20 am
by skydereign
bamby1983 wrote:1) Is it possible to introduce the above delay without using a timer?
2) If yes, is it advisable to do this?

No. The only delay you could do is to freeze the game for a certain amount of time.
bamby1983 wrote:3) If no, is it possible to create a timer without assigning it to a particular actor?

No, if you look at CreateTimer there is no way to not specify an actor. For this kind of thing though, you should use the view actor. No code anywhere in gE can be run without an actor. Actors are essential for any code to run, so if you want some code to trigger in a certain amount of time, you need it to be run by an actor. That's just the way things are. But again the view actor always exists, and there is only ever one of it, so use it for this kind of scenario.

Re: Creating an Actorless Timer

PostPosted: Fri Feb 22, 2013 4:56 am
by bamby1983
Thanks Sky! :)