Skip to content
All news
update

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

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 / IsServerLoaded
  • IsClientLoading / IsClientLoaded
  • IsLoadedForAll
  • Release

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, IsRescued
  • GetRescuer
  • GetPickUpStartTime / 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, GetConvarColor
  • SetConvar, which runs synchronously and is not gated by sv_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 / EndWarmup
  • GetTeamScore / AddTeamScore
  • TerminateRound

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.AddTeamMoney with CSTeamMoneyReason.NONE plus an amount, and fixed a related crash.
  • Corrected mismatches between the CSTeamMoneyReason and CSWeaponAttackType enums and their point_script.d.ts definitions.
  • Fixed CSRadarPoint.IsVisibleToTeam and CSObservablePoint.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_workshop command.

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.