Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Dr Fred Rubacant Edison on Sun 12/04/2009 21:48:26

Title: Is there away to have more then 20 timers in AGS
Post by: Dr Fred Rubacant Edison on Sun 12/04/2009 21:48:26
Just wondering Is there away to have more then 20 timers in AGS

Mabey using a Plugin or Modules mabey?? I looked on Google but cant find any :(.


Or dose MMM have its own special timers i can use?


Title: Re: Is there away to have more then 20 timers in AGS
Post by: Vince Twelve on Sun 12/04/2009 21:53:11
You could use a custom variable and just count it down in repeatedly_execute_always.



//in header
int timer21=-1;

//in whatever function you need to use to set the timer
timer21=1000; //equivalent to SetTimer(21, 1000);

//in repeatedly_execute_always
if(timer21>0) timer21--;

//in whatever function you need to use to check the timer
if(timer21==0){
  timer21=-1;
  ...
}
//or
while(timer21>0){
  Wait(1);
}
timer21=-1;
...
Title: Re: Is there away to have more then 20 timers in AGS
Post by: Dr Fred Rubacant Edison on Sun 12/04/2009 21:54:09
OH cool Thank you
Title: Re: Is there away to have more then 20 timers in AGS
Post by: Trent R on Mon 13/04/2009 00:39:55
Quote from: Rubacant on Sun 12/04/2009 21:48:26
I looked on Google but cant find any :(.
I'd suggest a forum search rather than a Google search.

Indeed, there is a Timers Module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28979.0). Two, in fact! (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=29409.0)


~Trent
Title: Re: Is there away to have more then 20 timers in AGS
Post by: Dr Fred Rubacant Edison on Mon 13/04/2009 01:28:44
:) :) THANK YOU THANK YOU