Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Herooftime1000 on Thu 14/03/2013 17:07:04

Title: Timerset is driving me nuts! (solved)
Post by: Herooftime1000 on Thu 14/03/2013 17:07:04
  if (boolFearon == true){
    SetTimer(1, 40);
  }
  if (IsTimerExpired(1)){
    Display("It works!");
  }

So simple, right? Well...
I placed it under rep-execute-always
It didn't work.
I placed it in the room script.
I didn't work.
The bool works.
The timer didn't work.
I made a new game and tested out settimer there without the custom bool.
IT. DIDN'T. WORK!!!

What is going on? What is possessing my program to not set off the timer! The gamer isn't paused, it's not being blocked, what gives?
Title: Re: Timerset is driving me nuts!
Post by: selmiak on Thu 14/03/2013 17:11:15
Code (AGS) Select
  if (boolFearon == true){
    boolFearon = false;
    SetTimer(1, 40);
  }


try this. Otherwise you restart the timer every gameloop.
Title: Re: Timerset is driving me nuts!
Post by: Herooftime1000 on Thu 14/03/2013 17:15:56
Quote from: selmiak on Thu 14/03/2013 17:11:15
Code (AGS) Select
  if (boolFearon == true){
    boolFearon = false;
    SetTimer(1, 40);
  }


try this. Otherwise you restart the timer every gameloop.

Doesn't work. I thank you for pointing out my looping, but I tried to set the timer in other scripts, and it doesn't work at all.
Title: Re: Timerset is driving me nuts!
Post by: selmiak on Thu 14/03/2013 17:18:58
of course this goes into rep-ex of the room. Did you put the check in rep-ex and somehere else set the boolFearon to true?
Title: Re: Timerset is driving me nuts!
Post by: Herooftime1000 on Thu 14/03/2013 17:27:31
Oh! That did it. Thank you ever so much with my simple problem.