Timerset is driving me nuts! (solved)

Started by Herooftime1000, Thu 14/03/2013 17:07:04

Previous topic - Next topic

Herooftime1000

  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?

selmiak

Code: AGS
  if (boolFearon == true){
    boolFearon = false;
    SetTimer(1, 40);
  }


try this. Otherwise you restart the timer every gameloop.

Herooftime1000

Quote from: selmiak on Thu 14/03/2013 17:11:15
Code: AGS
  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.

selmiak

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?

Herooftime1000

Oh! That did it. Thank you ever so much with my simple problem.

SMF spam blocked by CleanTalk