Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: NickyNyce on Mon 01/04/2013 14:47:32

Title: (Solved)Force timer to expire
Post by: NickyNyce on Mon 01/04/2013 14:47:32
I've searched the forum but have failed to find what I'm looking for.

I'm having an issue with a timer. Everything about it works fine except if my character leaves the room before it expires.

Inside this room the timer starts when the player interacts with a hotspot. An object turns visible and shuts off when it expires. If the player leaves the room before the timer expires and re-enters the room later, the object is still visible for a second and shuts off. I'm hoping to force this timer to expire when the player (leaves the room) so that this object is not visible upon returning.

I know there is SetTimer and IsTimerExpired but I feel I'm missing another timer command.
Title: Re: Force timer to expire
Post by: Crimson Wizard on Mon 01/04/2013 14:54:48
From the manual:
Quote
SetTimer (int timer_id, int timeout)

Pass TIMEOUT as 0 to disable a currently running timer.

I don't recall I ever tested that, but I hope it does what I think it should.
Title: Re: Force timer to expire
Post by: NickyNyce on Mon 01/04/2013 14:59:07
My god I knew it would be something easy like this. I'm sorry I didn't see it.

Works like a charm.
Thanks again.