VScript: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Typo)
 
(73 intermediate revisions by 21 users not shown)
Line 1: Line 1:
{{lang|VScript}}
{{LanguageBar}}
__NOTOC__
__NOTOC__
'''VScript''', introduced in {{l4d2|4}}, is a virtual machine for scripting that acts as an abstract binding layer between the {{source|4}} engine and external scripts. According to the {{Game link|Alien Swarm SDK}}, the following scripting languages are supported or could be in the near future:
'''VScript''', introduced since {{l4d2|4}} and later backported to {{tf2|4}} (and [[TF2 branch|other games on its branch]]), is a virtual machine for scripting that acts as an abstract binding layer between the {{source|4}} and {{source2|4}} engine and external scripts. According to the {{astools|4.1}}, the following scripting languages are supported or could be in the near future:


* [[Squirrel]]
* [[Squirrel]]
Line 8: Line 8:
* [[Wikipedia:Python (programming language)|Python]]
* [[Wikipedia:Python (programming language)|Python]]


Script files are read from <code>/scripts/vscripts/</code> inside the game directory.
== Implementations ==
{|
|- style="vertical-align:top"
| style="padding-right:2em" |
===[[Squirrel]] {{sq}}===


To learn how VScripts are used, see [[VScript Fundamentals]].


==Implementations==
{{srcsdk13mp|4|nt=short|addtext={{nbsp}}(2025)}} ({{tf2}} {{css}} {{dods}} {{hl2dm}} {{hldms}}) / {{tf2branch|3}}
{|
:All of these games runs on same branch as {{tf2}}. Any non-game specific functionality is inherited, but no additional game-specific functionality is added.
|- style=vertical-align:top
:[[Source 2013 MP/Scripting/VScript Examples|Script Examples]]
|style=padding-right:2em|
:[[Source 2013 MP/Scripting/Game Events|Game Events]]
===[[Squirrel]] {{sq}}===
 
:{{tf2|4}}
::[[Team Fortress 2/Scripting/Script Functions|List of Script Functions]]
::[[Team Fortress 2/Scripting/VScript Examples|Script Examples]]
::[[Team Fortress 2/Scripting/Game Events|Game Events]]
 
:{{css|4}}
::[[Counter-Strike: Source/Scripting/VScript Examples|Script Examples]]
::[[Counter-Strike: Source/Scripting/Game Events|Game Events]]
 
:{{dods|4}}
::[[Day of Defeat: Source/Scripting/Game Events|Game Events]]
 
:{{hl2dm|4}}
::[[Half-Life 2: Deathmatch/Scripting/Game Events|Game Events]]
 
:{{hldms|4}}
::[[Half-Life Deathmatch: Source/Scripting/Game Events|Game Events]]
 
{{l4d2|4}}
{{l4d2|4}}
:[[L4D2 Vscripts|Scripting]]
:[[L4D2 Vscripts|Scripting]]
:[[L4D2_Director_Scripts|Director Scripts]]
:[[L4D2_Director_Scripts|Director Scripts]]
:[[L4D2 Vscript Examples|Script Examples]]
:[[L4D2 Vscript Examples|Script Examples]]
:[[List of L4D2 Script Functions|List of Script Functions]]
:[[Left 4 Dead 2/Script Functions|List of Script Functions]]


{{as|4}}
{{as|4}}
:[[Alien Swarm/Scripting/Script Functions|List of Script Functions]]


{{portal2|4}}
{{portal2|4}}
:[[List of Portal 2 Script Functions|List of Script Functions]]
:[[List of Portal 2 Script Functions|List of Script Functions]]
{{Strata|4}}
:{{p2ce|4}}
::VScript documentation is covered on its wiki: [https://wiki.stratasource.org/vscript/reference/Globals VScript API Reference]


{{sfm|4}}
{{sfm|4}}
Line 42: Line 68:
:[[List of ND Script Functions|List of Script Functions]]
:[[List of ND Script Functions|List of Script Functions]]


{{tf|4}}
{{titanfall|4}}
:[[Titanfall/Scripting/Server Script Functions|List of Server Script Functions]]
:[[Titanfall/Scripting/Client Script Functions|List of Client Script Functions]]
:[[Titanfall/Scripting/UI Script Functions|List of UI Script Functions]]
 
{{Titanfall2|4}}
:[[Titanfall 2/Scripting/Server Script Functions|List of Server Script Functions]]
 
{{apex|4}}


{{asrd|4}}
{{asrd|4}}
Line 48: Line 82:


{{mapbase|4}} (Custom implementation)
{{mapbase|4}} (Custom implementation)
:[https://github.com/mapbase-source/source-sdk-2013/wiki/VScript-in-Mapbase Scripting]
:[[Mapbase/Scripting|Scripting]]
:[https://github.com/mapbase-source/source-sdk-2013/tree/master/sp/src/vscript GitHub]
:[[Mapbase/Scripting/Script_Functions|Script Functions]]
{{jbep3|4}}
:[[List of Jabroni Brawl: Episode 3 Script Functions|List of Script Functions]]
{{ddd|4}}
:[[Dino D-Day/Scripting/Script Functions|List of Script Functions]]
{{Rl|4}}
:[[Revelations 2012/Scripting/Script Functions|List of Script Functions]]
|style=padding-right:2em|
|style=padding-right:2em|
===Lua {{lua}}===
===Lua {{lua}}===
{{portal2|4}} (Client/UI only)
<!-- GMOD uses GLua which is not the same as VScript, don't add it here. -->
 
{{dota2|4}}
{{dota2|4}}
:[[Dota_2_Workshop_Tools/Scripting|Scripting]]
:[[Dota_2_Workshop_Tools/Scripting|Scripting]]
:[[Dota_2_Workshop_Tools/Scripting/API|Scripting API]]
:[[Dota_2_Workshop_Tools/Scripting/API|Scripting API]]
{{gmod|4}}


{{svrh|4}}
{{svrh|4}}
Line 68: Line 106:
{{hla|4}}
{{hla|4}}
:[[Half-Life:_Alyx_Workshop_Tools/Lua_Scripting|Scripting]]
:[[Half-Life:_Alyx_Workshop_Tools/Lua_Scripting|Scripting]]
:[[Half-Life_Alyx_Scripting_API|Scripting API]]
:[[Half-Life:_Alyx_Workshop_Tools/Scripting_API|Scripting API]]


;General {{source2|4}}
;General {{source2|4}}
:[[Source 2 Animation System VScript API]]
:[[Source 2 Animation System VScript API]]
{{jbep3|4}}
:[[List of Jabroni Brawl: Episode 3 Script Functions|List of Script Functions]]
|
|


===Python===
===Python {{python}}===
;{{Tf2|4}}
 
;{{sfm|4}}
;{{sfm|4}}
:[[SFM/Scripting_with_Python|Scripting/Rigging]]
:[[SFM/Scripting_with_Python|Scripting/Rigging]]
|}
|}


==See Also==
==See also==
* [[VScript Fundamentals]]
*[[List of Script Libraries]]
*[[Entity Scripts]]
*[[Entity Scripts]]
*{{ent|logic_script}}
*{{ent|logic_script}} (entity)
*{{ent|script}}, {{ent|script_execute}} (console command)


[[Category:VScript]]
[[Category:Technical]]
[[Category:Technical]]
[[Category:Scripting]]
[[Category:Scripting]]

Latest revision as of 01:35, 8 August 2025

English (en)Español (es)Русский (ru)中文 (zh)Translate (Translate)

VScript, introduced since Left 4 Dead 2 Left 4 Dead 2 and later backported to Team Fortress 2 Team Fortress 2 (and other games on its branch), is a virtual machine for scripting that acts as an abstract binding layer between the Source Source and Source 2 Source 2 engine and external scripts. According to the Alien Swarm - SDK Alien Swarm - SDK, the following scripting languages are supported or could be in the near future:

Implementations

Squirrel Squirrel

Source SDK Base 2013 - Multiplayer SDK Base 2013 - MP (2025) (Team Fortress 2 Counter-Strike: Source Day of Defeat: Source Half-Life 2: Deathmatch Half-Life Deathmatch: Source) / Team Fortress 2 branch

All of these games runs on same branch as Team Fortress 2. Any non-game specific functionality is inherited, but no additional game-specific functionality is added.
Script Examples
Game Events
Team Fortress 2 Team Fortress 2
List of Script Functions
Script Examples
Game Events
Counter-Strike: Source Counter-Strike: Source
Script Examples
Game Events
Day of Defeat: Source Day of Defeat: Source
Game Events
Half-Life 2: Deathmatch Half-Life 2: Deathmatch
Game Events
Half-Life Deathmatch: Source Half-Life Deathmatch: Source
Game Events

Left 4 Dead 2 Left 4 Dead 2

Scripting
Director Scripts
Script Examples
List of Script Functions

Alien Swarm Alien Swarm

List of Script Functions

Portal 2 Portal 2

List of Script Functions

Strata Source Strata Source

Portal 2: Community Edition Portal 2: Community Edition
VScript documentation is covered on its wiki: VScript API Reference

Source Filmmaker Source Filmmaker

Team Fortress 2 Only exists on the SFM build of TF2. No TF2 or SFM-specific API. Unused.

Counter-Strike: Global Offensive Counter-Strike: Global Offensive

List of Script Functions
Listening to game events
VScript Examples

Contagion Contagion

List of Script Functions

Nuclear Dawn Nuclear Dawn

List of Script Functions

Titanfall Titanfall

List of Server Script Functions
List of Client Script Functions
List of UI Script Functions

Titanfall 2 Titanfall 2

List of Server Script Functions

Apex Legends Apex Legends

Alien Swarm: Reactive Drop Alien Swarm: Reactive Drop

List of Script Functions

Mapbase Mapbase (Custom implementation)

Scripting
Script Functions

Jabroni Brawl: Episode 3 Jabroni Brawl: Episode 3

List of Script Functions

Dino D-Day Dino D-Day

List of Script Functions

Revelations 2012 Revelations 2012

List of Script Functions

Lua Lua

Dota 2 Dota 2

Scripting
Scripting API

SteamVR Home SteamVR Home

Scripting
Scripting API
Scripted Tool Creation
Scripted Flashlight Tool Tutorial

Half-Life: Alyx Half-Life: Alyx

Scripting
Scripting API
General Source 2 Source 2
Source 2 Animation System VScript API

Jabroni Brawl: Episode 3 Jabroni Brawl: Episode 3

List of Script Functions

Python Python

Team Fortress 2 Team Fortress 2
Source Filmmaker Source Filmmaker
Scripting/Rigging

See also