Dota 2 Workshop Tools/Scripting: Difference between revisions
Jump to navigation
Jump to search
(I made a separate page for readers from China. Please ensure you use the Chinese page for Chinese content.) |
|||
Line 1: | Line 1: | ||
{{otherlang2 | {{otherlang2 | ||
| | |ru= Dota 2 Workshop Tools:ru/Scripting:ru | ||
}} | }} | ||
Scripting in Dota 2 is handled by the [http://www.lua.org 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. | Scripting in Dota 2 is handled by the [http://www.lua.org 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) == | == 从这里开始(Getting Started) == | ||
* [[Dota 2 Workshop Tools/Scripting/Getting Started|从这里开始]] | * [[Dota 2 Workshop Tools/Scripting/Getting Started|从这里开始(Getting Started)]] | ||
== 技能脚本 == | == 技能脚本(Scripting Abilities) == | ||
* [[Dota 2 Workshop Tools/Scripting/Abilities Data Driven|技能数据编写]] | * [[Dota 2 Workshop Tools/Scripting/Abilities Data Driven|技能数据编写(Data Driven Abilities)]] | ||
* [[Dota 2 Workshop Tools/Scripting/Abilities Scripted|技能脚本]] | * [[Dota 2 Workshop Tools/Scripting/Abilities Scripted|技能脚本(Scripting Abilities)]] | ||
== 常用技术 == | == 常用技术(Common Techniques) == | ||
* [[Dota 2 Workshop Tools/Scripting/ThinkerFunctions|理解函数]] | * [[Dota 2 Workshop Tools/Scripting/ThinkerFunctions|理解函数(Thinker Functions)]] | ||
* [[Dota 2 Workshop Tools/Scripting/Console Commands|控制台命令]] | * [[Dota 2 Workshop Tools/Scripting/Console Commands|控制台命令(Console Commands)]] | ||
* [[Dota 2 Workshop Tools/Scripting/Dedicated VConsole Log Viewer|控制台日志查看]] | * [[Dota 2 Workshop Tools/Scripting/Dedicated VConsole Log Viewer|控制台日志查看(Dedicated VConsole Log Viewer)]] | ||
== 参考数据 == | == 参考数据(Reference) == | ||
* [[Dota 2 Workshop Tools/Scripting/API|脚本API]] | * [[Dota 2 Workshop Tools/Scripting/API|脚本API(Scripting API)]] | ||
* [[Dota 2 Workshop Tools/Scripting/Constants|脚本常数]] | * [[Dota 2 Workshop Tools/Scripting/Constants|脚本常数(Scripting Constants)]] | ||
* [[Dota 2 Workshop Tools/Scripting/Built-In Engine Events|内置引擎事件((警告:有些没用了)]] | * [[Dota 2 Workshop Tools/Scripting/Built-In Engine Events|内置引擎事件((警告:有些没用了)Built-In Engine Events (warning: many broken))]] | ||
* [[Dota 2 Workshop Tools/Scripting/Built-In Ability Names|内置技能名称]] | * [[Dota 2 Workshop Tools/Scripting/Built-In Ability Names|内置技能名称(Built-In Ability Names)]] | ||
* [[Dota 2 Workshop Tools/Scripting/Built-In Modifier Names| | * [[Dota 2 Workshop Tools/Scripting/Built-In Modifier Names|内置修改器名称Built-In Modifier Names]] | ||
* [[Dota 2 Workshop Tools/Scripting/Heroes_internal_names|内置英雄名称]] | * [[Dota 2 Workshop Tools/Scripting/Heroes_internal_names|内置英雄名称(Heroes Internal Names)]] | ||
* [[Dota 2 Workshop Tools/Scripting/Built-In Unit Names|内置物品名称]] | * [[Dota 2 Workshop Tools/Scripting/Built-In Unit Names|内置物品名称(Built-In Unit Names)]] | ||
== 脚本举例 == | == 脚本举例 == | ||
* [[Dota 2 Workshop Tools/Scripting/Simple Trigger that calls Lua| | * [[Dota 2 Workshop Tools/Scripting/Simple Trigger that calls Lua| 简单的触发器调用Lua(Simple trigger that calls Lua)]] | ||
* [[Dota 2 Workshop Tools/Scripting/Abilities Scripted Example| Data driven item that drops upon death]] | * [[Dota 2 Workshop Tools/Scripting/Abilities Scripted Example| Data driven item that drops upon death]] | ||
* [[Dota 2 Workshop Tools/Scripting/Data Driven Motion Controller Example | 运动控制例子]] | * [[Dota 2 Workshop Tools/Scripting/Data Driven Motion Controller Example | 运动控制例子(Motion Controller Example)]] | ||
* [[Dota 2 Workshop Tools/Scripting/Creating a Tower Example | 建一个防御塔例子]] | * [[Dota 2 Workshop Tools/Scripting/Creating a Tower Example | 建一个防御塔例子(Creating a Tower Example)]] | ||
== Lua 学习资料 == | == Lua 学习资料 == |
Revision as of 18:04, 15 August 2014
Template:Otherlang2 Scripting in Dota 2 is handled by 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)
技能脚本(Scripting Abilities)
常用技术(Common Techniques)
参考数据(Reference)
- 脚本API(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)
脚本举例
- 简单的触发器调用Lua(Simple trigger that calls Lua)
- Data driven item that drops upon death
- 运动控制例子(Motion Controller Example)
- 建一个防御塔例子(Creating a Tower Example)
Lua 学习资料
- Official Lua Website |官网
- Sublime Text 2/3 Snippets for all functions |这个编辑器不错,可以上网找下汉化包
- [我还是写一下打开上面那个链接后,怎么把这个插件装到Sublime里面吧。从Sublime下载,2或者3版都行。安装完后,打开安装目录,新建一个文件夹Data]
- [再运行Sublime,你就可以看到会在Data目录下自动生成了好多文件。如果不加这个Data文件夹,转为会生成到用户文件夹下,看各人喜好。 ]
- [回到上面。在Sublime里面的Package文件夹下,新建 “Lua Dota”文件夹,再把从上面网站下载的文件全部复制过去就行了。]
- [Sublime3建议下破解版,官方的不好破解。Sublime2的话,不用,因为可以无限试用。]
- [Sublime没有完美汉化包,都只是大部分汉化。2和3的汉化文件基本通用]
* [我只是看到脚本这块一直没人翻译,就谷歌了一下,错误应该是有的。大家好好改吧。希望国内有大大能汉化与完善这脚本模块。毕竟这里的脚本说明还是简单]