Skip to content

game_timer entity and HL2 generic timer HUD element#442

Merged
Blixibon merged 1 commit into
mapbase-source:developfrom
Blixibon:mapbase/feature/game-timer
Jul 27, 2025
Merged

game_timer entity and HL2 generic timer HUD element#442
Blixibon merged 1 commit into
mapbase-source:developfrom
Blixibon:mapbase/feature/game-timer

Conversation

@Blixibon
Copy link
Copy Markdown
Member

@Blixibon Blixibon commented Jul 7, 2025

A new entity which shows a timer on the player's HUD. It can be displayed with a caption and use various parameters to control the timer’s behavior.

In the following example, 3 timers with different parameters are shown, with each reducing the player's health by 5 as a generic output:

https://drive.google.com/file/d/13uw0VRfQbKzid7939AZsgZ2ZzniEkvNn/view?usp=sharing

This is designed to be a generic version of team_round_timer from TF2, an entity used to control the round timer. game_timer uses the same I/O/KV syntax and general functionality. This includes the ability to pause, count up or down, etc.

Features specific to game_timer include the ability to specify a warning time, control the progress bar, change the timer’s position on the screen, etc.

This feature will also be available in the TF2 branch, with the unique ability to display multiple timers in that game, although that is not currently present in this PR.


PR Checklist

  • My PR follows all guidelines in the CONTRIBUTING.md file
  • My PR targets a develop branch OR targets another branch with a specific goal in mind

@CoolDude034
Copy link
Copy Markdown

This would be useful, i tried implementing this for my own mod but end up failing

Comment thread sp/src/game/shared/mapbase/game_timer.cpp Outdated
Comment thread sp/src/game/shared/mapbase/game_timer.cpp
@azzyr
Copy link
Copy Markdown
Collaborator

azzyr commented Jul 24, 2025

Additional bug found: The timer HUD does not ever close if using saverestore with an active timer

@Blixibon Blixibon force-pushed the mapbase/feature/game-timer branch from 96393ba to 983f2b7 Compare July 26, 2025 02:06
@Blixibon Blixibon requested a review from azzyr July 26, 2025 02:06
@Blixibon Blixibon merged commit 8de0119 into mapbase-source:develop Jul 27, 2025
4 checks passed
@Blixibon Blixibon deleted the mapbase/feature/game-timer branch July 27, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants