[TF2] Game Instructor support and integration into training/notification HUD#469
Merged
Blixibon merged 5 commits intoSep 5, 2025
Conversation
1e16cd0 to
5d17ac6
Compare
azzyr
approved these changes
Sep 3, 2025
Co-authored-by: azzy <67557558+azzyr@users.noreply.github.com>
…F2 implementation
5d17ac6 to
265818b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes several changes to adapt the Game Instructor into TF2, many of which were ported from TF2 Classic.
env_instructor_hintteam and TF2 class supportThis allows
env_instructor_hintto transmit its team and spawnflags to the hint, filtering by team and player class. This was originally done for TF2C and has been tweaked so that the team value can be used in HL2DM mods as well.TF2-style instructor hint HUD
This gives instructor hints background and text shadow panels to make it fit in with other HUD elements in TF2. This was also originally done for TF2C with changes made to coexist with the default hint appearance. This can also theoretically be used outside of TF2 mods by changing
locator_background_styleand having appropriate changes to the.resfile, although this hasn't been tested.Restore/port potential use target for Game Instructor with optional TF2 implementation
This partially ports the "potential use target" feature included in the Alien Swarm SDK, which can be used by the Game Instructor, but was lost when the Game instructor was initially brought over. It is essentially the entity that the player can immediately interact with, even if the player cannot literally initiate +USE on it. In L4D2, this is used to show hints about picking up items, giving items to teammates, among other things.
This PR also adds an optional implementation of this feature to TF2 for use in the Game Instructor and/or VScript. Normally, the potential use entity is calculated on demand, although a
tf_scan_potential_use_targetcvar can be used to enable periodically scanning and firing theuse_targetevent for the potential use targets, which some instructor lessons may listen to. This cvar is enabled automatically if any lessons withuse_targetare detected.Hook Game Instructor to TF training and notification HUD
This adds custom lesson actions for TF2 game logic and new lesson types for its HUD elements. Using a new
lesson_typekeyvalue, you can make a lesson use either the training HUD or the notification (game_text_tf) HUD instead of the default locator hint. Note that these hints may not support certain display keyvalues, such as icon targets.As part of this integration, the training HUD now supports an optional image that can be specified in a lesson in the same way as a locator icon. This can also be used directly within training mode with a new
ShowTrainingImageinput ontf_logic_training_mode, although this blanks out the message content and must be fired earlier.Example of an instructor lesson which uses the training HUD:
Note that these new hint types currently cannot be initiated with
env_instructor_hintand must be defined inscripts/mod_lessons.txtorscripts/instructor_lessons.txt, although that may change in the future.Additionally, this PR adds the previously missing
c_mod_lesson_stubs.cppfrom the Alien Swarm SDK with a new stub for custom lesson types, although it is excluded from the TF2 VPC.PR Checklist
developbranch OR targets another branch with a specific goal in mind