Ability that spawns a unit

I am trying to make an ability that spawns a unit. Ive tried using the SpawnUnit action without success. Im new to making abilities and still having trouble understanding how they work.

Comments

  • Posts: 15
    "nevermore_unit_spawn"
        {
            // General
            //--------------------------------------------------------------------------
            "BaseClass" "ability_datadriven" 
            "AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET"
            "AbilityTextureName"    "fireball_icon"
    
                    "OnSpellStart"
            {
                "SpawnUnit"
                {
                    "UnitName"      "test_unit"
                    "UnitCount"     "1"
                    "UnitLimit"     "2"
                    "SpawnRadius"           "10"
                    "Duration"      "0"
                    "Target"        "CASTER"
                    "GrantsGold"            "1"
                    "GrantsXP"      "1"
                }
            }
    
    
        }
    

    This is what I have so far and I just tested it again and it works. Anyway I can improve it?

  • edited July 2015 Posts: 1,670

    You'll want to add a 1 frame modifier_phased to prevent units getting stuck.

    "SpawnUnit"
    {
        "UnitName"      "npc_name"
        "Target"        "CASTER"
        "Duration"      "%duration"
        "UnitCount"     "1"
        "UnitLimit"     "0"
        "GrantsGold"    "1"
        "GrantsXP"      "1"
        "SpawnRadius"   "10"
        "OnSpawn"
        {
            "ApplyModifier"
            {
                "ModifierName"  "modifier_phased"
                "Target"        "TARGET"
                "Duration"      "0.03"
            }
    
            [ACTIONS]
        }
    }
    

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

  • Posts: 15

    Ah thanks forgot about that