Counter-Strike 2 Update Expands Scripting API for Map and Mode Developers

Counter-Strike 2 Update Expands Scripting API
This update focuses on the point_script scripting system used by custom game modes and maps. It introduces new top-level exports, reorganizes existing functions, and fixes several API inconsistencies.
Precache System
A new Instance.Precache call returns a CSPrecache object that lets scripts track asset loading more precisely. Available methods include:
IsServerLoading/IsServerLoadedIsClientLoading/IsClientLoadedIsLoadedForAllRelease
This gives map authors finer control over when assets are ready on both server and client before triggering gameplay events.
Hostage Rescue Scripting
A new CSHostage class exposes hostage state directly to scripts:
IsBeingPickedUp,IsBeingCarried,IsRescuedGetRescuerGetPickUpStartTime/GetPickUpFinishTime
CSPlayerPawn.GetHostage links a player to the hostage they are carrying. New instance-level events also fire for the full hostage lifecycle: OnHostagePickUpStart, OnHostagePickUpAbort, OnHostagePickUp, OnHostageDrop, OnHostageRescue, and OnHostageKill. These additions make it possible to build custom hostage-based game modes with proper scripted feedback.
New Console Export
A new top-level Console export centralizes console and convar access:
GetConvarBoolean,GetConvarNumber,GetConvarString,GetConvarVector,GetConvarQAngle,GetConvarColorSetConvar, which runs synchronously and is not gated bysv_cheats
Instance.Msg has been renamed to Console.Log, and ClientCommand, ServerCommand, and RegisterCheatCommand have moved from Instance to Console. The original Instance versions still work but are now deprecated.
New GameRules Export
A new top-level GameRules export groups round and match control logic:
StartWarmup/EndWarmupGetTeamScore/AddTeamScoreTerminateRound
Several existing functions have also moved here from Instance, including IsWarmupPeriod, IsFreezePeriod, IsTeamIntroPeriod, GetRoundsPlayed, GetRoundRemainingTime, SetRoundRemainingTime, and AddTeamMoney. As with the Console changes, the old Instance entry points remain functional but deprecated.
HUD and Radar Updates
Two new custom_hud_layout classes, HUD_TEAMMENU_VISIBLE and HUD_CHAT_VISIBLE, give scripts more control over HUD element visibility. Additionally, radar_element can now appear on the radar in any game mode, rather than being limited to Rush.
Fixes and Improvements
This update also resolves several scripting bugs and quality-of-life issues:
- Added support for
GameRules.AddTeamMoneywithCSTeamMoneyReason.NONEplus an amount, and fixed a related crash. - Corrected mismatches between the
CSTeamMoneyReasonandCSWeaponAttackTypeenums and theirpoint_script.d.tsdefinitions. - Fixed
CSRadarPoint.IsVisibleToTeamandCSObservablePoint.IsObservableForTeam, which previously returned numbers instead of booleans. - Logged warnings now include the JavaScript call stack and details about invalid argument values, and argument indexing now starts at 0 instead of 1 for consistency with JavaScript conventions.
- Improved autocomplete behavior for the
map_workshopcommand.
Together, these changes give community developers deeper and more reliable control over game logic, hostage mechanics, HUD behavior, and console interaction through the scripting API.
