Counter-Strike 2 Update
Extensive expansion of the map scripting API adds new hostage interaction logic, console variable controls, and GameRules management for creators.
Key Changes
- 1Added CSHostage class and comprehensive hostage interaction events for map scripting
- 2Introduced Console export for synchronous ConVar manipulation bypassing sv_cheats
- 3Added GameRules export to control round termination, scores, and warmup states
- 4Implemented CSPrecache to track server and client loading status
- 5Fixed a crash occurring when using GameRules.AddTeamMoney with CSTeamMoneyReason.NONE
- 6Enabled radar_element to appear in all game modes
- 7Added HUD_TEAMMENU_VISIBLE and HUD_CHAT_VISIBLE layout classes
- 8Improved developer logging with JS call stacks and 0-indexed argument counting
All Changes
📜Map Scripting(43)
- newInstance: Added Instance.Precache which returns a CSPrecache object
- newCSPrecache: Added CSPrecache.IsServerLoading method
- newCSPrecache: Added CSPrecache.IsServerLoaded method
- newCSPrecache: Added CSPrecache.IsClientLoading method
- newCSPrecache: Added CSPrecache.IsClientLoaded method
- newCSPrecache: Added CSPrecache.IsLoadedForAll method
- newCSPrecache: Added CSPrecache.Release method
- newCSHostage: Added CSHostage class for script interactions
- newCSHostage: Added CSHostage.IsBeingPickedUp method
- newCSHostage: Added CSHostage.IsBeingCarried method
- newCSHostage: Added CSHostage.IsRescued method
- newCSHostage: Added CSHostage.GetRescuer method
- newCSHostage: Added CSHostage.GetPickUpStartTime method
- newCSHostage: Added CSHostage.GetPickUpFinishTime method
- newCSPlayerPawn: Added CSPlayerPawn.GetHostage method
- newInstance: Added Instance.OnHostagePickUpStart event
- newInstance: Added Instance.OnHostagePickUpAbort event
- newInstance: Added Instance.OnHostagePickUp event
- newInstance: Added Instance.OnHostageDrop event
- newInstance: Added Instance.OnHostageRescue event
- newInstance: Added Instance.OnHostageKill event
- newConsole: Added new top level export Console
- newConsole: Added Console.GetConvarBoolean method
- newConsole: Added Console.GetConvarNumber method
- newConsole: Added Console.GetConvarString method
- newConsole: Added Console.GetConvarVector method
- newConsole: Added Console.GetConvarQAngle method
- newConsole: Added Console.GetConvarColor method
- newConsole: Added Console.SetConvar method; not restricted by sv_cheats and executes synchronously
- changeInstance: Renamed Instance.Msg to Console.Log
- changeConsole: Moved Instance.ClientCommand, ServerCommand and RegisterCheatCommand to Console
- newGameRules: Added new top level export GameRules
- newGameRules: Added GameRules.StartWarmup method
- newGameRules: Added GameRules.EndWarmup method
- newGameRules: Added GameRules.GetTeamScore method
- newGameRules: Added GameRules.AddTeamScore method
- newGameRules: Added GameRules.TerminateRound method
- changeGameRules: Moved IsWarmupPeriod, IsFreezePeriod, IsTeamIntroPeriod, GetRoundsPlayed, GetRoundRemainingTime, SetRoundRemainingTime and AddTeamMoney from Instance to GameRules
- changeMap Scripting: Moved and renamed methods remain available in original locations but are now deprecated
- newGameRules: Added support for GameRules.AddTeamMoney with CSTeamMoneyReason.NONE and a specific amount
- changeMap Scripting: Logged warnings now include the JS call stack
- changeMap Scripting: Logged warnings now include details about bad argument values
- changeMap Scripting: Logged warnings now count arguments starting from 0 instead of 1
🖥️UI/UX(4)
- newHUD: Added top-level custom_hud_layout class HUD_TEAMMENU_VISIBLE
- newHUD: Added top-level custom_hud_layout class HUD_CHAT_VISIBLE
- changeradar_element: radar_element can now appear on the radar in every game mode, not just Rush
- changemap_workshop: Improved auto complete functionality for the map_workshop command
🛠️Bug Fixes(5)
- fixGameRules: Fixed a crash in GameRules.AddTeamMoney when using CSTeamMoneyReason.NONE
- fixCSTeamMoneyReason: Fixed CSTeamMoneyReason enum values not matching point_script.d.ts
- fixCSWeaponAttackType: Fixed CSWeaponAttackType enum values not matching point_script.d.ts
- fixCSRadarPoint: Fixed CSRadarPoint.IsVisibleToTeam returning a number instead of a boolean
- fixCSObservablePoint: Fixed CSObservablePoint.IsObservableForTeam returning a number instead of a boolean
Summary
Map Scripting Overhaul
This update significantly expands the VScript API for Counter-Strike 2, providing map creators with deeper access to game systems. Key additions include a dedicated CSHostage class for tracking rescue states and a Console export that allows scripts to read and write console variables directly, bypassing standard cheat restrictions.
Systemic Improvements
The GameRules and Precache systems have been formalized into their own exports, moving away from the generic Instance object. Developers also receive better debugging tools with JavaScript call stacks and improved argument logging in warnings.
Bug Fixes
Several technical issues were addressed, including a crash related to team money logic and incorrect return types for radar visibility checks. Additionally, the radar_element has been enabled for all game modes.
