data driven spell that works like leap or pounce

Hello, i am trying to create a custom dota ability. I am very new to modding / scripting but i feel like i am very close

i want my spell to work similarly to leap or pounce, in that, your hero will move some number of units in the direction your facing (i haven't been able to figure out how the targeting would work since it's not a point target) dealing damage to any unit passed through. I am currently trying to do this with the "OnSpellStart" event but the next step seems to be targeting and have been unable to find any information that can help me with this specific problem.

my code so far (when i remove the Event it works, so far as, the icon shows up, i can cast the ability, it goes on cooldown but nothing happens)

//============================================================================================================== // Ability: Jolt //============================================================================================================== "juggernaut_jolt" { //General //---------------------------------------------------------------------------------------------------------- "BaseClass" "ability_datadriven" "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE | DOTA_ABILITY_BEHAVIOR_ATTACK | DOTA_ABILITY_IGNORE_BACKSWING" "AbilityUnitDamageType" "DAMAGE_TYPE_PURE" "AbilityTextureName" "axe_battle_hunger" "AbilityCastPoint" "0" "AbilityCastRange" "600" "AbilityCooldown" "14 11 8 5" "AbilityDamage" "100 172 275 375" "AbilityManaCost" "75 85 95 100"

//Special
//----------------------------------------------------------------------------------------------------------
"AbilitySpecial"
{
        "01"
        {
                "var_type"      "FIELD_INTEGER"
                "speed"         "3000"
        }
        "02"
        {
                "var_type"      "FIELD_INTEGER"
                "range"         "600"
        }
        "03"
        {
                "var_type"      "FIELD_INTEGER"
                "radius"        "300"
        }
}

//Data Driven
//-------------------------------------------------------------------------------------------------------------
"OnSpellStart"
{
        "Damage"

}

}

thanks for your time!

Comments

  • Posts: 9

    okay so if i could delete this post i would, i realize now that i am nowhere close and have tons more to read XD

  • Posts: 9

    //Ability: Jolt //============================================================================================================== "juggernaut_jolt" { //General //---------------------------------------------------------------------------------------------------------- "BaseClass" "ability_datadriven" "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_IGNORE_BACKSWING" "AbilityUnitDamageType" "DAMAGE_TYPE_PURE" "AbilityTextureName" "axe_battle_hunger" "AbilityCastPoint" "0" "AbilityCooldown" "14 11 8 5" "AbilityDamage" "100 172 275 375" "AbilityManaCost" "75 85 95 100"

    //Special
    //----------------------------------------------------------------------------------------------------------
    "AbilitySpecial"
    {
            "01"
            {
                "var_type"              "FIELD_INTEGER"
                "leap_distance"         "550"
            }
            "02"
            {
                "var_type"              "FIELD_FLOAT"
                "leap_speed"            "1300.0"
            }
            "03"
            {
                "var_type"              "FIELD_FLOAT"
                "leap_acceleration"     "6000.0"
            }
    }
    
    "OnSpellStart"
    {
            "MoveUnit"
            {
                        "Caster"
                        {
                                "Distance" "%leap_distance"
                        }
            }
    
    }
    

    }

  • Posts: 9

    okay so, i may be just talking to myself but i have started trying to involve LUA because i couldnt find any keys that worked for a data driven version of pounce / leap. i know for sure im doing this the wrong way but if anyone can tell me how to link a LUA ability to in my "custom abilities" text file that would be great! or do i need to go into the custom heros and override his first abiliity to use my LUA ability instead? any help is appreciated

  • Posts: 9

    started over from scratch trying to follow noyas guide exactly, heres where i'm at

    //Dota Heroes File "DOTAAbilities" { "Version" "1"

    //========================================
    //Juggernaut: Jolt
    //========================================
    "juggernaut_jolt"
        {
        //General
        //------------------------------------
        "BaseClass"                 "ability_datadriven"
        "AbilityBehavior"           "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_DIRECTIONAL"
        "AbilityTextureName"        "axe_battle_hunger"
    
        //Targeting
        //------------------------------------
        "AbilityUnitTargetTeam"     "DOTA_UNIT_TARGET_TEAM_ENEMY"
        "AbilityUnitTargetType"     "DOTA_UNIT_TARGET_ALL"
        "AbilityUnitTargetFlags"    "DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES"
        "LinearProjectile"
            {
                "Target" "POINT"
                "EffectName"     "particles/units/heroes/hero_mirana/mirana_spell_arrow.vpcf"
                "MoveSpeed"      "857"
                "StartRadius"    "115"
                "EndRadius"      "115"
                "StartPosition"  "attach_attack1"
                "FixedDistance"  "3000"
                "TargetTeams"    "DOTA_UNIT_TARGET_TEAM_ENEMY"
                "TargetTypes"    "DOTA_UNIT_TARGET_HERO"
                "TargetFlags"    "DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES"
                "HasFrontalCone" "0"
                "ProvidesVision" "1"
                "VisionRadius"   "650"
            }
        }
    

    }

    the spell icon shows up, the cast animation plays, but no projectile comes out. i feel like im not understanding something about the formatting with some of the flags? going to continue researching.

  • You are Missing The OnSpellStart Command So like... "OnSpellStart" { "LinearProjectile" { "Target" "POINT" "EffectName" "particles/units/heroes/hero_mirana/mirana_spell_arrow.vpcf" "MoveSpeed" "600" "StartRadius" "125" "StartPosition" "attach_attack1" "EndRadius" "125" "FixedDistance" "500" "TargetTeams" "DOTA_UNIT_TARGET_TEAM_ENEMY" "TargetTypes" "DOTA_UNIT_TARGET_BASIC | DOTA_UNIT_TARGET_HERO" "TargetFlags" "DOTA_UNIT_TARGET_FLAG_NONE" "HasFrontalCone" "0" "ProvidesVision" "1" "VisionRadius" "300" } }

  • Posts: 9

    update: cast animation, cooldown, point target, mana cost all work, but no projectile launches (at this point im thinking im going to have to make this by shooting a projectile then swapping my heros position with the projectiles or something? no sure taking it one step at a time) i tried to link it to a projectile that was in the addon folder already but it doesn't seem to be working

    //Dota Heroes File "DOTAAbilities" { "Version" "1"

    //========================================
    //Juggernaut: Jolt
    //========================================
    "juggernaut_jolt"
        {
        //General
        //------------------------------------
        "BaseClass"                 "ability_datadriven"
        "AbilityBehavior"           "DOTA_ABILITY_BEHAVIOR_DIRECTIONAL | DOTA_ABILITY_BEHAVIOR_POINT"
        "AbilityTextureName"        "storm_spirit_ball_lightning"
    
        //Stats
        //------------------------------------
        "AbilityDamage"             "75 175 275 375"
        "AbilityCooldown"           "14 11 8 5"
        "AbilityManacost"           "50 60 70 80"
        "AbilityRange"              "600"
    
    "LinearProjectile"
            {
                "Target" "POINT"
                "EffectName"     "dota_3/particles/basic_projectiles/basic_projectile.vpcf_c"
                "MoveSpeed"      "857"
                "StartRadius"    "115"
                "EndRadius"      "115"
                "StartPosition"  "attach_attack1"
                "FixedDistance"  "3000"
                "TargetTeams"    "DOTA_UNIT_TARGET_TEAM_ENEMY"
                "TargetTypes"    "DOTA_UNIT_TARGET_HERO"
                "TargetFlags"    "DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES"
                "HasFrontalCone" "0"
                "ProvidesVision" "1"
                "VisionRadius"   "650"
            }
        }
    

    }

  • Posts: 9

    flaming crossbow, just saw your post! going to try it now thanks!

  • Posts: 9

    OKAY! good news! i learned alot today lol, my character will now cast a spell with burrowstrike animations but for some reason the modifier thats supposed to hide the caster doesn't seem to be working. the key is "IsHidden" and it says boolean value so i put 1 for true as the value but my character remains visible ( i also tried putting 0) here is my code, after i figure out making him hidden i still have to tackle this teleport / movement whatever to emulate burrowstrike

    //Dota Heroes File "DOTAAbilities" { "Version" "1"

    //========================================
    //Juggernaut: Jolt
    //========================================
    "juggernaut_jolt"
    {
        //General
        //------------------------------------
        "BaseClass"                 "ability_datadriven"
        "AbilityBehavior"           "DOTA_ABILITY_BEHAVIOR_POINT"
        "AbilityTextureName"        "storm_spirit_ball_lightning"
    
        //Stats
        //------------------------------------
        "AbilityDamage"             "75 175 275 375"
        "AbilityCooldown"           "14 11 8 5"
        "AbilityManacost"           "50 60 70 80"
        "AbilityCastRange"              "600"
    
    // Special
    //------------------------------------------------------------------------------------------------------------
        "AbilitySpecial"
        {
            "01"
            {
                "var_type"          "FIELD_INTEGER"
                "jolt_width"        "150"
            }
            "02"
            {
                "var_type"          "FIELD_FLOAT"
                "jolt_duration" "2.17"
            }
            "03"
            {
                "var_type"          "FIELD_INTEGER"
                "jolt_speed"        "2000"
            }
            "04"
            {
                "var_type"          "FIELD_FLOAT"
                "jolt_anim_time"    "0.22"
            }
            "05"
            {
                "var_type"          "FIELD_INTEGER"
                "tooltip_range"     "%AbilityCastRange"
            }
            "06"
            {
                "var_type"          "FIELD_INTEGER"
                "cast_range_scepter"        "700 900 1100 1300"
            }
            "07"
            {
                "var_type"          "FIELD_INTEGER"
                "jolt_speed_scepter"        "3000"
            }
        }
    
        // Data driven
        //-------------------------------------------------------------------------------------------------------------
        "precache"
        {
            "soundfile"             "soundevents/game_sounds_heroes/game_sounds_sandking.vsndevts"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_cracks.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_cracks_center.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_cracks_background.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_dust.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_debris.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_eruption.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_eruption_ripple_b.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_eruption_ripple.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_eruption_rocks.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_eruption_dust.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_eruption_dirt.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_eruption_ripple_dust.vpcf"
            "particle"              "particles/units/heroes/hero_sandking/sandking_burrowstrike_ground.vpcf"
            // Missing one particle somewhere...
            "particle"              "particles/generic_gameplay/generic_stunned.vpcf"
        }
    
        "OnSpellStart"
        {
            "LinearProjectile"
            {
                "MoveSpeed"                 "%jolt_speed"
                "StartRadius"               "%jolt_width"
                "EndRadius"                 "%jolt_width"
                "TargetTeams"               "DOTA_UNIT_TARGET_TEAM_ENEMY"
                "TargetTypes"               "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
                "HasFrontalCone"            "0"
            }
    
            "ApplyModifier"
            {
                "ModifierName"              "modifier_jolt_caster_datadriven"
                "Target"                    "CASTER"
            }
    
            "FireEffect"
            {
                "EffectName"                "particles/units/heroes/hero_sandking/sandking_burrowstrike.vpcf"
                "EffectAttachType"          "start_at_customorigin"
                "Target"                    "CASTER"
                "ControlPoints"
                {
                    "01"                    "POINT"
                }
            }
    
            "FireSound"
            {
                "EffectName"                "Ability.SandKing_BurrowStrike"
                "Target"                    "CASTER"
            }
        }
    
        "OnProjectileHitUnit"
        {
            "DeleteOnHit"                   "true"
    
            "ApplyModifier"
            {
                "ModifierName"              "modifier_jolt_stun_datadriven"
                "Target"                    "TARGET"
            }
    
            "Knockback"
            {
                "Target"            "TARGET"
                "Duration"          "%jolt_anim_time"
                "Distance"          "-10"
                "Height"            "0"
            }
    
            "DelayedAction"
            {
                "Delay"                     "%jolt_anim_time"
                "Action"
                {
                    "Damage"
                    {
                        "Type"              "DAMAGE_TYPE_PURE"
                        "Damage"            "%AbilityDamage"
                        "Target"            "TARGET"
                    }
                }
            }
        }
    
        "OnProjectileFinish"
        {
            "RemoveModifier"
            {
                "ModifierName"      "modifier_jolt_caster_datadriven"
                "Target"            "CASTER"
            }
        }
    
        "Modifiers"
        {
            "modifier_jolt_caster_datadriven"
            {
                "IsHidden"                  "1"
                "States"
                {
                    "MODIFIER_STATE_STUNNED"    "MODIFIER_STATE_VALUE_ENABLED"
                }
            }
    
            "modifier_jolt_stun_datadriven"
            {
                "IsDebuff"                  "1"
                "Duration"                  "%jolt_duration"
                "EffectName"                "particles/generic_gameplay/generic_stunned.vpcf"
                "EffectAttachType"          "follow_overhead"
                "States"
                {
                    "MODIFIER_STATE_MUTED"  "MODIFIER_STATE_VALUE_ENABLED"
                }
            }
        }
    }
    

    }

  • Posts: 29

    "IsHidden" only affects whether you will see the modifier indicator above your HP bar. You need to apply a new modifier to the caster. It will be something like "modifier_invisible." I've had no luck finding a list of these built-in modifier names, but you can go to https://developer.valvesoftware.com/wiki/Dota_2_Workshop_Tools/Scripting/API for hep finding some of other values.