Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mouth for war on Mon 24/10/2005 18:11:47

Title: Timer won´t work
Post by: Mouth for war on Mon 24/10/2005 18:11:47
ok it's like this. I've got a guy laying on a beach, passed out...after a few seconds i want to display a message
this is how the script looks like...why won't it work?

  // script for Room: First time player enters screen
SetTimer(1,3000);
if (IsTimerExpired(1)== 1)  {
DisplayMessage(1);


Title: Re: Timer won´t work
Post by: GarageGothic on Mon 24/10/2005 18:16:37
You will have to call IsTimerExpired in the Repeatedly_Execute. If you call it in the First Time player enters screen script it will only check once, in the very first cycle (and thus never get to 3000).
Title: Re: Timer won´t work
Post by: Mouth for war on Mon 24/10/2005 18:23:27
i tried that to but...no message appearing
Title: Re: Timer won´t work
Post by: Ashen on Mon 24/10/2005 18:27:58
[obvious]You didn't put the timer declaration (SetTimer(1,3000);) in rep_ex as well, did you?

Also, are you waiting long enough? Assuming you haven't changed the game speed, 3000 loops is 1min 15, a little longer than 'a few seconds' in my book.[/obvious]

EDIT: So, I'm guessing one of them did it?
Title: Re: Timer won´t work
Post by: Mouth for war on Mon 24/10/2005 18:32:53
ah ok...thanks
Title: Re: Timer won´t work
Post by: Mouth for war on Mon 24/10/2005 19:00:35
That works fine but...when the message has been displayed i want to play an animation of the character standing up...but the scripteditor have no "play quickanimation" function...or am i just a total newbie?

Edit:
got it working...you may lock this thread now. Thanks!!! ;D