Creating an Actorless Timer

Non-platform specific questions.

Creating an Actorless Timer

Postby bamby1983 » Fri Feb 22, 2013 2:52 am

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?
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score

Re: Creating an Actorless Timer

Postby skydereign » Fri Feb 22, 2013 4:20 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Creating an Actorless Timer

Postby bamby1983 » Fri Feb 22, 2013 4:56 am

Thanks Sky! :)
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron