Difference between revisions of "VScript"

From Team Fortress Wiki
Jump to: navigation, search
m
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{OtherWikis
 
{{OtherWikis
 
| {{vdc|VScript}}
 
| {{vdc|VScript}}
| {{vdc|TF2 VScript Examples|Examples of VScripts for Team Fortress 2}}
+
| {{vdc|TF2 VScript Examples|Examples of VScripts for Team Fortress 2|link=no}}
| {{vdc|Team Fortress 2/Scripting/Script Functions|List of VScripts functions in Team Fortress 2}}
+
| {{vdc|Team Fortress 2/Scripting/Script Functions|List of VScripts functions in Team Fortress 2|link=no}}
 
}}
 
}}
{{Quotation|'''The Engineer''' installing a new server heavily utilizing VScript|Heavy load comin' through!|sound=Engineer_sentrymoving01.wav}}
 
  
'''VScript''' is a [[w:virtual machine|virtual machine]] for scripting used in some [[Source Engine]] games, that allows developers and mapmakers to write and embed custom scripts that interface with the game world and its [[vdc:Entity|entities]]. VScript was implemented into ''Team Fortress 2'' in the {{Patch name|12|1|2022}} and has been used in [[:Category:Maps with VScript|several maps]] since.
+
'''VScript''' is a [[w:virtual machine|virtual machine]] for scripting used in some [[Source Engine]] games, including ''Team Fortress 2'', that allows community creators to write and embed custom scripts into maps which then interact with the game and its [[vdc:Entity|entities]]. VScript was implemented into ''Team Fortress 2'' in the {{Patch name|12|1|2022}} and has been used in several [[List of maps|maps]] and [[List of game modes|game modes]] since.
 +
 
 +
== Update history ==
 +
{{Update history | '''{{Patch name|12|1|2022}}'''
 +
* Implemented VScript
 +
** VScript allows mappers to embed script code ([[w:Squirrel (programming language)|Squirrel3]]) into maps. This system is already being used for [[Left 4 Dead 2|L4D2]] and [[Counter-Strike: Global Offensive|CS:GO]] maps.
 +
*** Interface with entities and the world like regular [[Valve Hammer Editor|Hammer]] logic
 +
*** Simplify things that were previously incredibly complicated/tedious in Hammer logic
 +
*** Interact with and control [[bots]], [[boss]]es, player attributes, entities, and game state closely, allowing for enhanced, modified or entirely custom game modes
 +
*** React to game events and change the outcome of certain things, such as damage calculations
 +
** More technical info about VScript for Team Fortress 2 is available on the [[vdc:Main Page|Valve Developer Community]]
 +
*** [[vdc:VScript|<nowiki>https://developer.valvesoftware.com/wiki/VScript</nowiki>]]
 +
*** [[vdc:List of TF2 Script Functions|<nowiki>https://developer.valvesoftware.com/wiki/List_of_TF2_Script_Functions</nowiki>]]
 +
 
 +
'''{{Patch name|12|7|2022}}'''
 +
* Updated VScript
 +
** Updated [https://help.steampowered.com/en/faqs/view/558D-FD60-531D-98BC HLTV] placeholder player to not be a valid script entity. This fixes some scripts failing on dedicated servers because the HLTV placeholder player isn't accounted for.
 +
 
 +
'''{{Patch name|1|5|2023}}'''
 +
* Expanded VScript support
 +
** Fixed {{code|.nut}} files being valid files for download/upload
 +
** Fixed clients being able to run certain {{code|script_*}} debug commands on the server
 +
** Added {{code|EmitSoundEx}}
 +
** Fixed crashes related to null strings being passed to functions
 +
** Exposed a {{code|MaxClients}} function to get the current value of {{code|maxplayers}}
 +
** Fixed clearing script hooks on level transition
 +
 
 +
'''{{Patch name|10|27|2023}}'''
 +
* Added an extra {{cvar|HIDEHUD}} flag for vscript{{sic}} maps ({{cvar|HIDEHUD_TARGET_ID}})
 +
 
 +
'''{{Patch name|7|18|2024}}''' ({{update link|Summer 2024}})
 +
* Expanded VScript support
 +
** Added {{code|mp_tournament_redteamname}}, {{code|mp_tournament_blueteamname}}, and {{code|tf_mvm_max_connected_players}} to the list of whitelisted ConVars
 +
** Fixed {{code|vscript_convar_allowlist.cfg}} being overriden by being packed into a map
 +
** BaseEntity: {{code|AcceptInput}}, {{code|IsAlive}}
 +
** EconEntity: {{code|GetAttribute}}
 +
** TFPlayer: {{code|GetCustomAttribute}}, {{code|StunPlayer}}
 +
** TFBot: {{code|GetAllBotTags}}, {{code|SetMission}}, {{code|SetPrevMission}}, {{code|GetMission}}, {{code|GetPrevMission}}, {{code|HasMission}}, {{code|IsOnAnyMission}}, {{code|SetMissionTarget}}, {{code|GetMissionTarget}}, {{code|SetBehaviorFlag}}, {{code|ClearBehaviorFlag}}, {{code|IsBehaviorFlagSet}}, {{code|SetActionPoint}}, {{code|GetActionPoint}}
 +
 
 +
'''{{Patch name|10|10|2024}}''' ({{Update link|Scream Fortress 2024}})
 +
* Exposed {{code|CTFBaseBoss::SetResolvePlayerCollisions()}} for VScript users}}
 +
 
 +
== See also ==
 +
* [[:Category:Maps with VScript]]
  
 
{{Mapping Nav}}
 
{{Mapping Nav}}
  
 
[[Category:Mapping]]
 
[[Category:Mapping]]

Latest revision as of 15:57, 9 December 2024

VScript is a virtual machine for scripting used in some Source Engine games, including Team Fortress 2, that allows community creators to write and embed custom scripts into maps which then interact with the game and its entities. VScript was implemented into Team Fortress 2 in the December 1, 2022 Patch and has been used in several maps and game modes since.

Update history

December 1, 2022 Patch

December 7, 2022 Patch

  • Updated VScript
    • Updated HLTV placeholder player to not be a valid script entity. This fixes some scripts failing on dedicated servers because the HLTV placeholder player isn't accounted for.

January 5, 2023 Patch

  • Expanded VScript support
    • Fixed .nut files being valid files for download/upload
    • Fixed clients being able to run certain script_* debug commands on the server
    • Added EmitSoundEx
    • Fixed crashes related to null strings being passed to functions
    • Exposed a MaxClients function to get the current value of maxplayers
    • Fixed clearing script hooks on level transition

October 27, 2023 Patch

  • Added an extra HIDEHUD flag for vscript(sic) maps (HIDEHUD_TARGET_ID)

July 18, 2024 Patch (Summer 2024 Update)

  • Expanded VScript support
    • Added mp_tournament_redteamname, mp_tournament_blueteamname, and tf_mvm_max_connected_players to the list of whitelisted ConVars
    • Fixed vscript_convar_allowlist.cfg being overriden by being packed into a map
    • BaseEntity: AcceptInput, IsAlive
    • EconEntity: GetAttribute
    • TFPlayer: GetCustomAttribute, StunPlayer
    • TFBot: GetAllBotTags, SetMission, SetPrevMission, GetMission, GetPrevMission, HasMission, IsOnAnyMission, SetMissionTarget, GetMissionTarget, SetBehaviorFlag, ClearBehaviorFlag, IsBehaviorFlagSet, SetActionPoint, GetActionPoint

October 10, 2024 Patch (Scream Fortress XVI)

  • Exposed CTFBaseBoss::SetResolvePlayerCollisions() for VScript users

See also