CS2 October 22 2026 update: the new Console and GameRules script exports, CSPrecache, and CSHostage

Focused on community-created content for CS 2, including new maps, skins, and other customizations.
Post Reply
ice
Site Admin
Posts: 145
Joined: Tue Aug 27, 2024 5:17 am

CS2 October 22 2026 update: the new Console and GameRules script exports, CSPrecache, and CSHostage

Post by ice »

Quick summary
Valve shipped a Counter-Strike 2 update on October 22, 2026 that is aimed at map scripters. The notes add three new top level script exports, give scripts access to the hostage entity, and add two HUD classes. Methods that moved are still available where they were, marked deprecated.

CSPrecache
The new CSPrecache object reports loading state. It is reached through Instance.Precache.
  • CSPrecache.IsServerLoading
  • CSPrecache.IsServerLoaded
  • CSPrecache.IsClientLoading
  • CSPrecache.IsClientLoaded
  • CSPrecache.IsLoadedForAll
  • CSPrecache.Release
CSHostage and the hostage events
  • CSHostage.IsBeingPickedUp
  • CSHostage.IsBeingCarried
  • CSHostage.IsRescued
  • CSHostage.GetRescuer
  • CSHostage.GetPickUpStartTime
  • CSHostage.GetPickUpFinishTime
  • CSPlayerPawn.GetHostage
  • Instance.OnHostagePickUpStart
  • Instance.OnHostagePickUpAbort
  • Instance.OnHostagePickUp
  • Instance.OnHostageDrop
  • Instance.OnHostageRescue
  • Instance.OnHostageKill
Console
The new Console export reads and writes convars from script.
  • Console.GetConvarBoolean
  • Console.GetConvarNumber
  • Console.GetConvarString
  • Console.GetConvarVector
  • Console.GetConvarQAngle
  • Console.GetConvarColor
  • Console.SetConvar
The notes state that Console.SetConvar is not restricted by sv_cheats and executes synchronously. Instance.Msg was renamed to Console.Log, and Instance.ClientCommand, ServerCommand and RegisterCheatCommand were moved to Console.

GameRules
  • GameRules.StartWarmup
  • GameRules.EndWarmup
  • GameRules.GetTeamScore
  • GameRules.AddTeamScore
  • GameRules.TerminateRound
Instance.IsWarmupPeriod, IsFreezePeriod, IsTeamIntroPeriod, GetRoundsPlayed, GetRoundRemainingTime, SetRoundRemainingTime and AddTeamMoney were moved to GameRules.

HUD and radar
  • Two new top level custom_hud_layout classes: HUD_TEAMMENU_VISIBLE and HUD_CHAT_VISIBLE.
  • radar_element can now appear on the radar in every game mode, not just Rush.
  • GameRules.AddTeamMoney works with CSTeamMoneyReason.NONE and an amount.
Fixes
  • Fixed a crash in GameRules.AddTeamMoney with CSTeamMoneyReason.NONE.
  • Fixed CSTeamMoneyReason and CSWeaponAttackType enum values not matching point_script.d.ts.
  • Fixed CSRadarPoint.IsVisibleToTeam and CSObservablePoint.IsObservableForTeam returning a number instead of a boolean.
  • Logged warnings now include the JS call stack and details about bad argument values.
  • Logged warnings now count arguments from 0 instead of 1.
  • Improved auto complete of the map_workshop command.
Moved and renamed methods are still available in their original location, deprecated. A script that already calls Instance.Msg, ClientCommand, ServerCommand or RegisterCheatCommand keeps working until it is ported.

Sources
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests