Counter-Strike 2 Update Boosts Workshop Map Scripting with Save Data & New Events

Valve has rolled out a new update for Counter-Strike 2, primarily focusing on expanding workshop map scripting capabilities and making minor quality-of-life adjustments.
Map Scripting Enhancements
The most significant changes revolve around giving map creators more tools for dynamic and persistent experiences. Workshop maps can now utilize save data, allowing for more complex and evolving custom game modes:
- Added
Instance.SetSaveDataandInstance.GetSaveDatafor managing persistent data. - Workshop maps can write up to 1MB of save data, leveraging Steam Cloud for persistence across installs.
- The save data size limit can be configured with
sv_workshop_map_save_data_max_filesize_mb.
Damage modification has also seen an overhaul, providing more granular control for script authors:
- Added
Instance.OnModifyPlayerDamage, which is called after all damage properties are calculated but before armor and health are modified. This replacesInstance.OnBeforePlayerDamageand includes hitgroup in event data. - Added hitgroup to
OnPlayerDamageevent data. - Introduced
CSDamageFlags.IGNORE_ARMOR.
Player input detection has been enhanced with new functions:
- Added
CSPlayerPawn.IsInputPressed. - Added
CSPlayerPawn.WasInputJustPressed. - Added
CSPlayerPawn.WasInputJustReleased. - Added enum
CSInputs. - Fixed a bug where
CSDamageTypeswas exported under the nameCSDamageType.
Miscellaneous Fixes
Beyond scripting, a small but useful change was implemented for map guides:
- Map guides for de_ancient can now be used on de_ancient_night and vice versa.

