Dota 2 Workshop Tools/Scripting/API/Global.LinkLuaModifier: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Dota_Lebot push: Updated Page)
(Dota_Lebot push: Updated Page)
Line 6: Line 6:




''' void LinkLuaModifier(string ''string_1'', string ''string_2'', int ''int_3'') '''
''' 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'''




Line 14: Line 14:
;Example
;Example
<source lang="lua">
<source lang="lua">
function LinkLuaModifier( string_1, int_2 ) end
LinkLuaModifier( "modifier_pudge_meat_hook", LUA_MODIFIER_MOTION_HORIZONTAL )
unit:AddNewModifier(source, ability, "modifier_pudge_meat_hook", {})
</source>
</source>
== Parameters ==
== Parameters ==
Line 23: Line 24:
|-
|-
| string
| string
| string_1
| modifier_name
| No Description Set
| Name to be registered for the modifier, to be used when adding it.
|-
|-
| string
| string
| string_2
| file_path
| No Description Set
| File path of the .lua file containing the code for the modifier.
|-
|-
| int
| int
| int_3
| motion_controller_type
| No Description Set
| The type of motion controller(s) to be registered by this modifier
|}
|}

Revision as of 17:39, 30 June 2015

Note.pngNote: This page is automatically generated. Any changes may be overwritten

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'


Example
LinkLuaModifier( "modifier_pudge_meat_hook", LUA_MODIFIER_MOTION_HORIZONTAL )
unit:AddNewModifier(source, ability, "modifier_pudge_meat_hook", {})

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