Inconsistencies with linear projectile

I have finally started to do some modding and after I read the tutorials on this site and some copy-pasting of already made skills i tried to "make my own" (looked at the SpellLibrary but with a twist). A channeled data-driven ability who shoots out 3 LinearProjectiles. The POINT based skill applies a modifier on the caster which on each OnThinkInterval creates a LinearProjectile. But as you can see, it is super inconsistent (even switching mid channel) and as far as I can tell there is no pattern but there might be something I overlooked as I am not super confident.

The script references are only for "print()".

"three_fire_bolt_ability"
  {
    //General
    "BaseClass"                "ability_datadriven"
    "AbilityBehavior"          "DOTA_ABILITY_BEHAVIOR_POINT | DOTA_ABILITY_BEHAVIOR_CHANNELLED"
    "AbilityUnitTargetTeam"    "DOTA_UNIT_TARGET_TEAM_ENEMY"
    "AbilityUnitTargetType"    "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
    "AbilityUnitDamageType"    "DAMAGE_TYPE_MAGICAL"
    "SpellImmunityType"        "SPELL_IMMUNITY_ENEMIES_NO"
    "AbilityTextureName"       "lina_dragon_slave"

    //Prechache
    "precache"
-- (Removed irrelevant parts to save space)
    //Casting
    "AbilityCastRange"        "800"
    "AbilityCastPoint"        "0.1"
    "AbilityChannelTime"      "2.1"
-- (Removed irrelevant parts to save space)
    //Special
    "AbilitySpecial"
    {
      "01"
      {
        "var_type"            "FIELD_INTEGER"
        "projectile_speed"    "900"
      }
      "02"
      {
        "var_type"            "FIELD_INTEGER"
        "projectile_width"    "100"
      }
      "03"
      {
        "var_type"            "FIELD_INTEGER"
        "projectile_distance" "1000"
      }
      "04"
      {
        "var_type"            "FIELD_INTEGER"
        "duration"            "2"
      }
      "05"
      {
        //did not get this to work
        "var_type"            "FIELD_INTEGER"
        "tick_interval"       "0.5"
      }
    }

    //Starts here
    "OnSpellStart"
    {
      "ApplyModifier"
      {
            "ModifierName"  "modifier_three_fire_bolt_datadriven"
            "Target"        "CASTER"
      }
    }

    "OnChannelInterrupted"
    {
      "RemoveModifier"
      {
        "ModifierName"  "modifier_three_fire_bolt_datadriven"
        "Target"        "CASTER"
      }
    }

    "OnChannelFinish"
    {
      "RemoveModifier"
      {
        "ModifierName"  "modifier_three_fire_bolt_datadriven"
        "Target"        "CASTER"
      }
    }

    "OnProjectileHitUnit"
    {
      //see if code reaches
      "RunScript"
      {
        "ScriptFile"  "heroes/abilities.lua"
        "Function"    "HasHitted"
      }
      //hard to see if it works
      "DeleteOnHit"  "1"
      "Damage"
      {
        "Target"    "TARGET"
        "Type"      "DAMAGE_TYPE_MAGICAL"
        "Damage"    "%AbilityDamage"
      }
    }

    "Modifiers"
    {
      "modifier_three_fire_bolt_datadriven"
      {
        "Passive"      "0"
        "IsHidden"     "0"
        "IsBuff"       "1"

        "OnCreated"
        {

        }

        //should not be hardcoded but will be fixed
        "ThinkInterval"  "0.6"
        "OnIntervalThink"
        {
          //check to see if code reaches
          "RunScript"
          {
            "ScriptFile"  "heroes/abilities.lua"
            "Function"    "IsWorking"
          }
          "LinearProjectile"
          {
              "Target"         "POINT"
            "EffectName"   "particles/units/heroes/hero_lina/lina_spell_dragon_slave.vpcf"
            "MoveSpeed"     "%projectile_speed"
            "StartRadius"   "%projectile_width"
            "StartPosition"  "attach_origin"
            "EndRadius"      "%projectile_width"
            "HasFrontalCone" "1" //Tested with both
            "FixedDistance"  "%projectile_distance"
            "TargetTeams"   "DOTA_UNIT_TARGET_TEAM_ENEMY"
            "TargetTypes"   "DOTA_UNIT_TARGET_BASIC | DOTA_UNIT_TARGET_HERO"
            "TargetFlags"   "DOTA_UNIT_TARGET_FLAG_NONE"            
              "ProvidesVision" "0"
          }
          "FireSound"
          {
            "EffectName"  "Hero_Lina.DragonSlave"
            "Target"      "CASTER"    
          }
        }
      }
    }
  }

This might not even be the right way of doing it but it is working (applying damage), kinda. And if i wanted to move the hero while channeling it would probably have to be made in Lua, maybe by rotating the hero with the mouse.

Comments

  • edited July 2015 Posts: 1,670

    Problem is POINT is a bitch of a key, the modifier might lose scope of it, I would do this in lua passing the POINT to a RunScript and use dummy casting, check out some channeling abilities that run through a dummy with Rain of Fire (KV and Lua files)

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • Posts: 3

    Thanks for the answer, I have looked through a lot of skills on github and on other sites and dummy casting seems to be the way to go. Your second link should probably be the vscript part of the spell right (Lua part) right?