How to stall in Vavoom C

Anything not covered by other topics

How to stall in Vavoom C

Postby TheCount » 07 Oct 2006 01:02

Is there any function that can delay execution by a specific amount of ticks? I'm looking for a function similar to the ACS function Delay(int). Is it possible?
Thank you very much.
TheCount
 
Posts: 18
Joined: 05 Sep 2006 17:47
Location: Buenos Aires, Argentina

Postby Janis Legzdinsh » 07 Oct 2006 08:06

No.
User avatar
Janis Legzdinsh
Site Admin
 
Posts: 1952
Joined: 13 Jan 2002 08:30
Location: Limassol, Cyprus

Postby Crimson Wizard » 07 Oct 2006 10:50

Yet, there's a common way to make a timer.

Assuming you have an Actor (some creature maybe), that need to be stopped for a moment and denied to perform any actions. You create new variable, say, float MyTimer. In appropriate moment you initialize it with 2.0 value (in seconds). Then, in Tick() function write following:

Code: Select all
void Tick (float deltaTime)
{

      if (MyTimer > 0.0)
      {
            MyTimer -= deltaTime;
            return;
      }

...........
...........
}


Well, ofcourse it is a simple sample, perhaps it won't fit your needs exactly.
Crimson Wizard
 
Posts: 881
Joined: 09 Nov 2005 14:21
Location: St. Petersburg, Russia


Return to General

Who is online

Users browsing this forum: fuzhou4s, inhighunretry, Oxqq76VMxz, tiemebymn and 1 guest

cron