Custom Animation Scripts

From Valve Developer Community
< Dota 2 Workshop Tools
Revision as of 04:09, 16 June 2019 by Soer4769 (talk | contribs) (Added category to the page, added shortpagetitle template)
Jump to: navigation, search

This API allows custom games to use the Valve-authored Dota models while still adding additional custom sequences.

Before a model is loaded (ie. at the beginning of addon_game_mode.lua) you must register a custom animation script:

RegisterCustomAnimationScriptForModel( "models/heroes/medusa/medusa.vmdl", "animation/heroes/medusa/medusa_custom.lua" )

Important Note:The custom script should only be additions you want to make to the original Valve model (ie. don’t include the contents of old Valve .lua animation scripts, only your new sequences.)

An example of such a script is:

-- animation/heroes/medusa/medusa_custom.lua - Add a custom ATTACK2 sequence for Medusa's model
              name = "attack_q",
              sequences = {
                     { "abil1" }
              activities = {
                     { name = "ACT_DOTA_ATTACK2", weight = 1 }