The main part of the patch focuses on hostage mode. Each hostage is now a separate CSHostage object, and maps can track every step, from the first pickup attempt to a rescue or death.
If you only play matchmaking, nothing has changed for you in-game. The October 22 changelog has a single section: MAP SCRIPTING. The new features will come to Workshop maps and custom modes once their creators update the scripts.
Hostages are no longer just silent models
CSHostage now has the IsBeingPickedUp, IsBeingCarried, and IsRescued methods. Scripts can check whether a hostage is being picked up, carried, or has reached a rescue zone. GetRescuer identifies the rescuer, while GetPickUpStartTime and GetPickUpFinishTime return when the pickup started and ended. There’s also CSPlayerPawn.GetHostage, so scripts can check the connection from the player’s side.
The new methods also come with events that maps can respond to right away.
- OnHostagePickUpStart fires when a player starts picking up a hostage.
- OnHostagePickUpAbort fires when a pickup is interrupted.
- OnHostagePickUp fires when a player picks up a hostage.
- OnHostageDrop fires when a hostage is dropped.
- OnHostageRescue fires when a hostage is rescued.
- OnHostageKill fires when a hostage dies.
For example, a map maker can award points for a rescue or trigger an alarm at the Terrorist spawn when the CTs pick up a hostage.
Console and GameRules take over some of Instance’s work
Valve has added two new top-level namespaces. Console now handles everything related to console variables. Scripts can read a value in the right format with GetConvarBoolean, GetConvarNumber, GetConvarString, GetConvarVector, GetConvarQAngle, or GetConvarColor, then write one with SetConvar. SetConvar isn’t restricted by sv_cheats and runs synchronously, so the new value takes effect on the very next line of the script.
| Before | After |
|---|---|
| Instance.Msg | Console.Log |
| Instance.ClientCommand, ServerCommand, RegisterCheatCommand | The same methods in Console |
| Instance.IsWarmupPeriod, IsFreezePeriod, IsTeamIntroPeriod | The same methods in GameRules |
| Instance.GetRoundsPlayed, GetRoundRemainingTime, SetRoundRemainingTime | The same methods in GameRules |
| Instance.AddTeamMoney | GameRules.AddTeamMoney |
GameRules also gets new methods of its own. StartWarmup and EndWarmup start and stop warmup, GetTeamScore and AddTeamScore read and change a team’s score, and TerminateRound ends the round. Map scripts can now decide for themselves when a round is over.
The old names still work, but they’re marked as deprecated. The rename is straightforward, so it’s easier to update the calls now, before there are too many in the project.
Scripts can check whether every player has loaded the resources
Instance.Precache returns a CSPrecache object. IsServerLoading and IsServerLoaded show whether a resource is loading or loaded on the server; IsClientLoading and IsClientLoaded do the same for the client. IsLoadedForAll checks whether it’s ready for every player. When the resource is no longer needed, Release frees it.
HUD, radar, and fixes
The rest of the patch brings smaller tweaks and fixes. Custom HUD layouts (custom_hud_layout) now have two top-level classes, HUD_TEAMMENU_VISIBLE and HUD_CHAT_VISIBLE. A layout can use them to change when the team select menu or chat is open. The radar_element now appears on the radar in every mode, not just Rush.
- GameRules.AddTeamMoney no longer crashes the game if you pass CSTeamMoneyReason.NONE as the reason.
- The CSTeamMoneyReason and CSWeaponAttackType enum values now match the type descriptions in point_script.d.ts.
- CSRadarPoint.IsVisibleToTeam and CSObservablePoint.IsObservableForTeam now return a boolean instead of a number.
- Log warnings now include the JavaScript call stack and details about invalid arguments. Arguments are numbered from 0 instead of 1.
- Convar
- A game console variable, such as a server or client setting, that can be read and changed.
- sv_cheats
- A server setting that must be enabled to use some console commands.
- Precache
- Loading models, sounds, and other resources before they’re needed in-game.
Guides















