Dota 2 Workshop Tools/Scripting/API/Global.LinkLuaModifier: Difference between revisions
< Dota 2 Workshop Tools | Scripting | API
Jump to navigation
Jump to search
RoyAwesome (talk | contribs) (Dota_Lebot push: Updated Page) |
(Undo revision 192018 by RoyAwesome (talk)) |
||
Line 6: | Line 6: | ||
''' void LinkLuaModifier(string '' | ''' void LinkLuaModifier(string ''modifier_name'', string ''file_path'', int ''motion_controller_type'') ''' | ||
''Link a lua-defined modifier with the associated class. | ''Link a lua-defined modifier with the associated class. If the modifier is located within the root vscript folder, then the second argument (file_path) may be omitted' | ||
; | ;Examples | ||
Note: ''modifier_pudge_meat_hook.lua located in \vscripts\'' | |||
<source lang="lua"> | <source lang="lua"> | ||
LinkLuaModifier( "modifier_pudge_meat_hook", LUA_MODIFIER_MOTION_HORIZONTAL ) | |||
unit:AddNewModifier(source, ability, "modifier_pudge_meat_hook", {}) | |||
</source> | </source> | ||
Note: ''modifier_filepath_test.lua located in \vscripts\test\'' | |||
<source lang="lua"> | |||
LinkLuaModifier( "modifier_filepath_test", "test/modifier_filepath_test", LUA_MODIFIER_MOTION_NONE ) | |||
unit:AddNewModifier(source, ability, "modifier_filepath_test", {}) | |||
</source> | |||
== Parameters == | == Parameters == | ||
{| class="standard-table" style="width: 50%;" | {| class="standard-table" style="width: 50%;" | ||
Line 23: | Line 33: | ||
|- | |- | ||
| string | | string | ||
| | | modifier_name | ||
| | | Name to be registered for the modifier, to be used when adding it. | ||
|- | |- | ||
| string | | string | ||
| | | file_path | ||
| | | File path of the .lua file containing the code for the modifier. | ||
|- | |- | ||
| int | | int | ||
| | | motion_controller_type | ||
| | | The type of motion controller(s) to be registered by this modifier | ||
* LUA_MODIFIER_MOTION_NONE | |||
* LUA_MODIFIER_MOTION_HORIZONTAL | |||
* LUA_MODIFIER_MOTION_VERTICAL | |||
* LUA_MODIFIER_MOTION_BOTH | |||
* LUA_MODIFIER_INVALID | |||
|} | |} |
Revision as of 15:54, 29 June 2015

Function Description
void LinkLuaModifier(string modifier_name, string file_path, int motion_controller_type)
Link a lua-defined modifier with the associated class. If the modifier is located within the root vscript folder, then the second argument (file_path) may be omitted'
- Examples
Note: modifier_pudge_meat_hook.lua located in \vscripts\
LinkLuaModifier( "modifier_pudge_meat_hook", LUA_MODIFIER_MOTION_HORIZONTAL )
unit:AddNewModifier(source, ability, "modifier_pudge_meat_hook", {})
Note: modifier_filepath_test.lua located in \vscripts\test\
LinkLuaModifier( "modifier_filepath_test", "test/modifier_filepath_test", LUA_MODIFIER_MOTION_NONE )
unit:AddNewModifier(source, ability, "modifier_filepath_test", {})
Parameters
Type | Name | Description |
---|---|---|
string | modifier_name | Name to be registered for the modifier, to be used when adding it. |
string | file_path | File path of the .lua file containing the code for the modifier. |
int | motion_controller_type | The type of motion controller(s) to be registered by this modifier
|