This article relates to the game "Counter-Strike 2". Click here for more information.
This article relates to the software/tool "Counter-Strike 2 Workshop Tools". Click here for more information.
This article's documentation is for Source 2. Click here for more information.

Counter-Strike 2 Workshop Tools/Scripting: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Update page with some extra info that will have to be refactored later with new info)
m (Update point_script link)
 
(21 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Source 2]]
{{cs2 tools topicons}}


In Counter-Strike 2, unlike the previous {{Source 2|2}} titles {{hla|4}}, {{dota2|4}}, and {{VRHome|4}} which all used [[VScript]] to provide the ability to use Lua scripts natively when building custom levels using the Hammer editor. In {{cs2|4}} two new scripting systems called [[VScript2]] which uses Typescript and [[Pulse]] a visual scripting solution. Vscript2 scripts can be ran by providing a .vts file to a {{cs2}}[[point_script]] and [[Pulse]] can be ran by providing a .vpulse file to a {{cs2}}[[point_pulse]]. Both solutions can be used for a variety of things including creating new game modes, weapons and other types of complicated logic.
{{LanguageBar|title=Scripting}}
{{ModernNote |As of ''Limited Test Build v. 2000121/13936'', [[VScript]] is not working, and Pulse is unavailable for end users to create, but inspection of CS2's internal files confirms that Lua scripts previously used for configuration of the Wingman gamemode, as well as managing behavior of various interactive elements on {{CsgoMap|de_vertigo}}.}}


{{Todo | Figure out the specifics of pulse.}}
{{Update}}
 
{{cs2|1}} features the cs_script scripting system, using {{w|JavaScript}}. This is in contrast to previous {{Source 2|1}} titles like {{hla|1}}, {{dota2|1}}, and {{VRHome|1}}, which all used Lua-based [[VScript]]. In addition to cs_script, there is another scripting system called [[Pulse]], which is a visual scripting solution. However, Pulse is currently unavailable to end users. cs_script can be used for a variety of things including creating new game modes, modifying existing weapon logic, among other stuff.
 
Valve has provided a map called script_zoo, which showcases various ways to use cs_script to create unique gameplay, model changes and even chess in Counter-Strike! The .vmap file can be found in content/csgo/maps/editor/zoo. It can also be accessed in-game, by typing "map editor/zoo/script_zoo" into the game console.
 
{{Todo|Figure out more about pulse.}}
{{Todo|Info about JavaScript.}}
{{Confirm|Does TypeScript (.vts) still work using {{ent|point_script|engine=2}}?}}
 
== Tutorials ==
* '''[[Counter-Strike_2_Workshop_Tools/Scripting/Hello_Gordon|Hello, Gordon: Getting Started with JavaScript for Counter-Strike 2]]'''
* [[Counter-Strike_2_Workshop_Tools/Scripting/Glowing_Chair|Creating a Glowing Chair with JavaScript in Counter-Strike 2]]
 
== See also ==
* [[Counter-Strike 2 Workshop Tools/Scripting API|Scripting API]]

Latest revision as of 05:26, 26 October 2025

English (en)中文 (zh)Translate (Translate)
Broom icon.png
This article or section needs to be updated to include current information regarding the subject.
Remember to check for any notes left by the tagger at this article's talk page.

Counter-Strike 2 features the cs_script scripting system, using Wikipedia icon JavaScript. This is in contrast to previous Source 2 titles like Half-Life: Alyx, Dota 2, and SteamVR Home, which all used Lua-based VScript. In addition to cs_script, there is another scripting system called Pulse, which is a visual scripting solution. However, Pulse is currently unavailable to end users. cs_script can be used for a variety of things including creating new game modes, modifying existing weapon logic, among other stuff.

Valve has provided a map called script_zoo, which showcases various ways to use cs_script to create unique gameplay, model changes and even chess in Counter-Strike! The .vmap file can be found in content/csgo/maps/editor/zoo. It can also be accessed in-game, by typing "map editor/zoo/script_zoo" into the game console.

Todo: Figure out more about pulse.
Todo: Info about JavaScript.
Confirm:Does TypeScript (.vts) still work using point_script?

Tutorials

See also