Skip to main content

What are VScripts?

Dota 2 custom games use a server-side Lua scripting system called VScripts. When a custom game loads, the Dota 2 engine executes a root entry point (addon_game_mode.lua) which bootstraps every other module using Lua’s require function or Valve’s LinkLuaModifier helper for modifier classes. All scripts live under:
Modifiers (passive buff/debuff classes) must be registered before use:
Regular modules are loaded with require:

Script file reference

Directory structure

How scripts are loaded

pregame.lua is the main bootstrap file. It requires every other core module and calls LinkLuaModifier for every Lua-based modifier that the game needs:
After all requires, pregame.lua loads the game’s KV (key-value) data into GameRules.KVs: