Need help with playing a satanic sound on a ability

edited October 7 in Support

I'm relativity new to scripting so i have this problem is when the spell starts, it doesn't play the satanic sound, i have precached the ability and used the "FireSound" key value but it still doesn't play the sound. Just FYI this ability is for WR, any advice is appreciated :D.

The ability:

"debuff_dagger"
    {
     "BaseClass"             "ability_datadriven"
     "AbilityTextureName"    "phantom_assassin_stifling_dagger"
     "AbilityBehavior"  "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET"
     "AbilityUnitTargetTeam"  "DOTA_UNIT_TARGET_TEAM_ENEMY"
     "AbilityUnitTargetType" "DOTA_UNIT_TARGET_HERO | DOTA_UNIT_TARGET_BASIC"
     "AbilityUnitDamageType" "DAMAGE_TYPE_MAGICAL"
     "AbilityCastAnimation" "ACT_DOTA_CAST_ABILITY_1"
     "AbilityType"            "DOTA_ABILITY_TYPE_BASIC"
     "AbilityManaCost" "40"
     "AbilityCastRange" "580"
     "AbilityCooldown" "6"
     "AbilityProcsMagicStick" "1"
     "AbilityCastPoint" "0.20"
     "SpellImmunityType"                "SPELL_IMMUNITY_ENEMIES_NO"
     "Modifiers"
        {
          "Armor_debuff"
            {
              "Duration" "4" 
              "TextureName" "phantom_assassin_stifling_dagger"
              "IsDebuff"         "1"
              "OnCreated"
                {
                  "AttachEffect"
                    {
                        "Target"  "TARGET"
                        "EffectName"  "particles/units/heroes/hero_monkey_king/monkey_king_jump_armor_debuff.vpcf"
                        "EffectAttachType" "follow_overhead"
                        "EffectLifeDurationScale" "1"
                    }
                }
             "Properties"
                {
                 "MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS" "%Armor"
                }
            }
        }

     "OnSpellStart"
        {
         "TrackingProjectile"
            {
                "Target" "TARGET"
                "EffectName" "particles/units/heroes/hero_phantom_assassin/phantom_assassin_stifling_dagger.vpcf"
                "MoveSpeed"      "1450"
                "StartRadius"    "50"
                "EndRadius"      "50"
                "StartPosition"  "attach_attack1"
                "FixedDistance"  "3000"
                "TargetTeams"    "DOTA_UNIT_TARGET_TEAM_ENEMY"
                "TargetTypes"    "DOTA_UNIT_TARGET_HERO"
                "TargetFlags"    "DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES"
                "ProvidesVision" "1"
                "VisionRadius"   "450"

            }   
         "FireSound" 
            {
              "Target" "CASTER"
              "EffectName" "Hero_Windrunner.Attack"

            }        
        }
     "OnProjectileHitUnit" 
        {
         "FireSound"
            {
              "Target" "TARGET"
              "EffectName" "sounds/items/item_satanic.vsnd"
            }
         "ApplyModifier" 
            {
              "Target" "TARGET"
              "ModifierName" "Armor_debuff"
            }
         "Damage"
            {
               "Type" "DAMAGE_TYPE_MAGICAL"
               "Damage" "%damage"
               "Target" "TARGET"
            }   
        }
        "AbilitySpecial"
        {
            "01"
            {
              "var_type"  "FIELD_FLOAT"
                "Armor" "0 -1 -3 -5"
            }

            "02" 
            {
              "var_type"  "FIELD_INTEGER"
              "damage" "72 84 108 132"
            }
            "03"
            {
             "var_type"  "FIELD_INTEGER"
             "duration" "4"
            }
        }
     "precache"
        {
         "particle" "particles/units/heroes/hero_phantom_assassin/phantom_assassin_stifling_dagger.vpcf"
         "particle" "particles/units/heroes/hero_monkey_king/monkey_king_jump_armor_debuff.vpcf"
         "soundfile"  "sounds/items/item_satanic.vsnd"
        }

Comments

  • Posts: 158

    https://github.com/SteamDatabase/GameTracking-Dota2/blob/master/game/dota/pak01_dir/soundevents/game_sounds_items.vsndevts

    base item sounds should be precached automatically, so no need.

    the sound name you need to use is:

    DOTA_Item.Satanic.Activate
    
  • but what about hero sounds, do they have to be pre cached in the "npc_heros_custom" text?

    i have used the sound effect and it worked so thank you for that :D

  • edited October 10 Posts: 158

    your welcome, and yeah heroes and abilities sounds need to be precached because they arent always in every game like items are.

    edit: not sure about precaching them in the npc_heroes_custom.txt file. i do my hero precaching in addon_game_mode.lua

    function Precache( context )
      local heroes = {
        "antimage",
        "beastmaster",
        "warlock",
        "pudge",
        "lina",
        "ogre_magi",
        "medusa",
        "sven",
        "monkey_king",
        "morphling",
        "lone_druid",
        "enigma",
        "juggernaut",
        "treant_protector",
        "skeleton_king",
        "furion",
        "enchantress",
        "phoenix",
      }
      for _,heroName in pairs(heroes) do
        PrecacheUnitByNameSync("npc_dota_hero_"..heroName, context)
      end
    end