Dota 2 Workshop Tools/Scripting: Difference between revisions
Jump to navigation
Jump to search
m (→Examples) |
(→Common Techniques: added a link to tutorial on listening to game events) |
||
Line 18: | Line 18: | ||
* [[Dota 2 Workshop Tools/Scripting/Console Commands|Console Commands]] | * [[Dota 2 Workshop Tools/Scripting/Console Commands|Console Commands]] | ||
* [[Dota 2 Workshop Tools/Scripting/Dedicated VConsole Log Viewer|Dedicated VConsole Log Viewer]] | * [[Dota 2 Workshop Tools/Scripting/Dedicated VConsole Log Viewer|Dedicated VConsole Log Viewer]] | ||
* [[Dota_2_Workshop_Tools/Scripting/Listening_to_game_events|Listening to Game Events]] | |||
== Reference == | == Reference == |
Revision as of 06:34, 6 September 2014
Template:Otherlang2 Scripting in Dota 2 is handled by the VScript virtual machine using the Lua programming language. Lua will be launched at run time when Dota 2 loads your add-on and can manipulate most facets of the game. Scripts can control the events that happen in game modes, game rules, abilities, hero interactions, neutrals , AI, and many more.
Getting Started
The documentation presented here assumes basic knowledge of Lua. If you're new to programming and Lua it's worth spending some time at the official Lua website learning some of the basic concepts. Additional resources are available at the bottom of the page for new users.
Scripting Abilities
Common Techniques
Reference
- Scripting API
- Scripting Constants
- Built-In Engine Events (warning: many broken)
- Built-In Ability Names
- Built-In Modifier Names
- Heroes Internal Names
- Built-In Unit Names
Examples
- Simple trigger that calls Lua
- Data driven item that drops upon death
- Motion Controller Example
- Creating a Tower Example
- Applying Data Driven Modifiers from script
- Detecting If Player Clicked Inside A Given Area When Using Items or Spells
Lua Resources
- Official Lua Website
- Programming in Lua - Good resource for learning Lua. If you're new to Lua or programming this is a good reference point to start from.
- Programming In Lua - Online - First edition of the above book is available online for free.
- Sublime Text 2/3 Snippets for all functions