Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: PERXEO on Wed 24/05/2023 15:08:01

Title: Reset a TIMER
Post by: PERXEO on Wed 24/05/2023 15:08:01
I see that in AGS there are only two functions (as far as I know), which have to do with TIMER. One is
SetTimer(int timer_id, int timeout) and the other is
bool IsTimerExpired(int timer_id).
However, I would like to know how to override a SetTimer once it has started, ie something like StopTimer or ResetTimer. In any case, how do you cancel a timer so that it starts again from zero?
Title: Re: Reset a TIMER
Post by: Nahuel on Wed 24/05/2023 15:25:43
Hey there, to override the timer, you set it again. if you want to stop the timer just

SetTimer(timerNumber, 0;
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_General.html?highlight=timer%20timers&case_sensitive=1#settimer

QuotePass TIMEOUT as 0 to disable a currently running timer.
Title: Re: Reset a TIMER
Post by: PERXEO on Wed 24/05/2023 15:32:00
Oh thanks!! Il'l try it!!