← all updates

2025-09-24

34 changes

Per-Event Script Registration Replaces the Catch-All Game Event Hook

Instance.OnGameEvent was removed in favour of registering for each event individually — round start and end, bomb plant and defuse, player connect, kill and chat, gun fire and grenade throw — which allows stronger typing. Several crashes were fixed, including one when RunScriptInput was triggered with a null caller. A train_zoo.vmap shipped with all of Train's assets as examples for mapmakers.

Train

scripting

  • reworkUpdated tsconfig.json in the script_zoo, setting the target to "es2022" for more accurate type analysis.
  • reworkChanged point_script entity to no longer remove itself on a failed script load during spawn. Instead it will remain in an inactive state and listen for script changes if the game is running in tools mode.
  • fixFixed point_script entity to no longer potentially crash after an unsuccessful reload from an invalid script while running the game in tools mode.
  • reworkChanged point_script entity to hold onto the memory value returned by an Instance.OnBeforeReload callback until the next successful reload instead of forgetting it if the reload is unsuccessful.
  • reworkChanged methods expecting arguments of string type to now error instead of calling toString for arguments of the wrong type.
  • reworkChanged Instance.Msg and Instance.DebugScreenText to accept any type for the text value.
  • fixFixed a bug where RunScriptInput would crash the game when triggered with a null caller or activator.
  • reworkRemoved Instance.OnGameEvent in favor of per-event registration methods. This gives us tools for stronger API stability and creates a consistent API for events that are not gameevents.
  • reworkAdded Instance.DebugLine
  • reworkAdded Instance.DebugBox
  • reworkAdded Instance.OnPlayerConnect
  • reworkAdded Instance.OnPlayerActivate
  • reworkAdded Instance.OnPlayerDisconnect
  • reworkAdded Instance.OnRoundStart
  • reworkAdded Instance.OnRoundEnd
  • reworkAdded Instance.OnBombPlant
  • reworkAdded Instance.OnBombDefuse
  • reworkAdded Instance.OnPlayerKill
  • reworkAdded Instance.OnPlayerChat
  • reworkAdded Instance.OnGunFire
  • reworkAdded Instance.OnGrenadeThrow
  • reworkAdded an overload to Instance.EntFireAtName that allows setting caller and activator
  • reworkAdded an overload to Instance.EntFireAtTarget that allows setting caller and activator
  • reworkAdded normal vector to the result of Instance.GetTraceHit
  • reworkAdded Entity.GetGroundEntity
  • reworkAdded CSWeaponBase.GetOwner
  • reworkAdded CSPlayerController.GetName
  • reworkAdded CSObserverPawn.GetOriginalPlayerController
  • reworkAdded CSPlayerPawn.GetOriginalPlayerController
  • reworkAdded CSPlayerPawn.IsCrouching
  • reworkAdded CSPlayerPawn.IsCrouched
  • reworkAdded CSPlayerPawn.IsNoclipping
  • reworkSee maps/editor/zoo/scripts/point_script.d.ts for comprehensive details on the API
  • reworkAdded "train_zoo.vmap" with all de_train assets and examples for mapmakers.Train
Valve's original notes
[ MAP SCRIPTING ]
[list][*]Updated tsconfig.json in the script_zoo, setting the target to "es2022" for more accurate type analysis.
[*]Changed point_script entity to no longer remove itself on a failed script load during spawn. Instead it will remain in an inactive state and listen for script changes if the game is running in tools mode.
[*]Fixed point_script entity to no longer potentially crash after an unsuccessful reload from an invalid script while running the game in tools mode.
[*]Changed point_script entity to hold onto the memory value returned by an Instance.OnBeforeReload callback until the next successful reload instead of forgetting it if the reload is unsuccessful.
[*]Changed methods expecting arguments of string type to now error instead of calling toString for arguments of the wrong type.
[*]Changed Instance.Msg and Instance.DebugScreenText to accept any type for the text value.
[*]Fixed a bug where RunScriptInput would crash the game when triggered with a null caller or activator.
[*]Removed Instance.OnGameEvent in favor of per-event registration methods. This gives us tools for stronger API stability and creates a consistent API for events that are not gameevents.
[*]Added Instance.DebugLine
[*]Added Instance.DebugBox
[*]Added Instance.OnPlayerConnect
[*]Added Instance.OnPlayerActivate
[*]Added Instance.OnPlayerDisconnect
[*]Added Instance.OnRoundStart
[*]Added Instance.OnRoundEnd
[*]Added Instance.OnBombPlant
[*]Added Instance.OnBombDefuse
[*]Added Instance.OnPlayerKill
[*]Added Instance.OnPlayerChat
[*]Added Instance.OnGunFire
[*]Added Instance.OnGrenadeThrow
[*]Added an overload to Instance.EntFireAtName that allows setting caller and activator
[*]Added an overload to Instance.EntFireAtTarget that allows setting caller and activator
[*]Added normal vector to the result of Instance.GetTraceHit
[*]Added Entity.GetGroundEntity
[*]Added CSWeaponBase.GetOwner
[*]Added CSPlayerController.GetName
[*]Added CSObserverPawn.GetOriginalPlayerController
[*]Added CSPlayerPawn.GetOriginalPlayerController
[*]Added CSPlayerPawn.IsCrouching
[*]Added CSPlayerPawn.IsCrouched
[*]Added CSPlayerPawn.IsNoclipping
[*]See maps/editor/zoo/scripts/point_script.d.ts for comprehensive details on the API
[*]Added "train_zoo.vmap" with all de_train assets and examples for mapmakers.[/list]

Published by Valve on Steam.