Pausing timers

zahndah

professional letter
aa
Jul 4, 2015
721
642
Is there a way to pause a timer halfway through timing then unpause it to pick up where it left off?
I need to use this to fix a bug for my map but have no idea and after testing 'toggle' and 'enable / disable' it seems they all reset the timer.
 
S

saph

I know that you can pause timers for KotH (/pausing-the-koth-timer.25763/), so it should be possible for cp_mcmurdo depending on your entity setup. I'd need to look at and play around with your entities or you could set it up as a multi-point KotH. What is the base gamemode you are using and what is the timer entity? (Use the trigger_capture_area to pause whatever timer you're using.)
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
logic_timer will reset after a restart

team_round_timer will not. I haven't tried using multiple timers at once, but it may well be possible to use many as long as they're all hidden from the hud. You can mark them as silent so the announcer doesn't say anything either. Then use pause/resume for accurate pausing.
 

zahndah

professional letter
aa
Jul 4, 2015
721
642
I have the team_round_timer pausing when a player is on the point but it isn't directly linked to the changing of the points, would i have to link it to be able to stop what is happening. To be more specific, since it isn't linked, if a player stands on the point but doesn't cap the timer says 'X seconds before points switch' but then the point switches. I could probably link it but id have to do some testing. I will try now.
 
S

saph

Try using OnStartCap to pause it. When the player enters the trigger_capture_area, the timer will pause. Then try OnBreakCap (if someone blocks them or if they die) and/or OnEndCap (if they capture the point) to unpause the timer.
 

zahndah

professional letter
aa
Jul 4, 2015
721
642
i had that but if they just step off the point it doesn't unpause and if the point is partialy capped and they step on it doesn't pause with the onstartcap. it should be fixed now but i will have to do further testing.