Map Scripting
Power trajectory
Up = buffed, down = nerfedPatch history
- ≈✨NewAPI Functions—→Added
Added numerous new scripting functions for player controllers, pawns, and weapon states (e.g., money management, helmet status, scoped state).
new
- ≈🔁ReworkOnPlayerUseactivator/caller
Changed the activator to always be the player and the caller to always be the used entity for OnPlayerUse.
rework
- ▲✨NewOnBulletImpacthitEntity—→Added
Added hitEntity to OnBulletImpact event data, allowing scripts to identify what was hit.
API expansion
- ▲✨NewCSWeaponBaseAmmo Methods—→Added
Added Get/Set methods for Clip and Reserve ammo, providing better weapon state control for modders.
API expansion
- ≈🐛Bug fixCSPlayerPawnDucking StateMissing→Fixed
Fixed missing IsDucking() and IsDucked() methods for player pawns.
Bugfix
- ▲🔁Reworkcs_script enums—→TypeScript compatible
Updated cs_script enums to be importable and behave like TypeScript enums, improving developer workflow.
Enums now behave like TypeScript enums.
- ▲✨NewScripting Enums—→Added
Added several new enums including CSRoundEndReason and CSHitGroup to expand map scripting capabilities.
Added CSRoundEndReason, CSHitGroup, etc.
- ▲🔁ReworkInstance.OnBeforePlayerDamage—→Modified
Enhanced OnBeforePlayerDamage to allow scripts to receive and modify damage types and flags.
Now receives and can modify damageType and damageFlags.
- ≈📊Numerictsconfig target—→es2022
Updated tsconfig.json to target es2022, improving type analysis for script developers.
Updated target for more accurate type analysis.
- ▲🎯Behaviorpoint_scriptspawn behaviorremove self→inactive state
point_script entities now remain inactive instead of being removed upon failed script loads, allowing for live updates in tools mode.
Prevents entity deletion on failed script load in tools mode.
- ≈🐛Bug fixpoint_scriptstability
Fixed a crash that could occur when point_script failed to reload an invalid script in tools mode.
Fixed crash on unsuccessful reload.
- ≈✂️RemovedInstance.OnGameEventavailabilityAvailable→Removed
Removed Instance.OnGameEvent in favor of specific event registration methods to improve API stability.
Replaced by per-event registration methods.
- ▲✨NewInstancedebug tools—→Added
Added DebugLine and DebugBox to the Instance API to assist mapmakers with visual debugging.
Added DebugLine and DebugBox.
- ▲✨NewInstanceevent hooks—→Added
Added a wide array of new event hooks including RoundStart, RoundEnd, BombPlant, BombDefuse, and PlayerKill for more complex map scripting.
Added various game event hooks (RoundStart, BombPlant, etc).
- ▲✨NewCSPlayerPawnstate queries—→Added
Added new methods to check if a player is crouching or noclipping, allowing for more reactive script triggers.
Added IsCrouching, IsCrouched, and IsNoclipping.
- ≈✨Newscripting system—→cs_script
Added cs_script, a JavaScript-based scripting system allowing map creators to implement more complex logic.
JS integration
- ≈✨Newdemo map—→script_zoo.vmap
Added script_zoo.vmap to demonstrate the functionality and usage of the new cs_script system.
Example map