How does Heat Seeking Missile determine targets? / Make it target basic units as well.

KV File
Lua File

I am wanting to edit Heat Seeking Missile to target normal targets as well, but I don't understand how it is determining targets. Can anyone explain this to me or point me to a place where I can learn about it?

Comments

  • Posts: 109

    In the KV File of your ability add or change:

    "AbilityUnitTargetType" "DOTA_UNIT_TARGET_CREEP"

    Available types:

    DOTA_UNIT_TARGET_ALL
    DOTA_UNIT_TARGET_BASIC
    DOTA_UNIT_TARGET_BUILDING
    DOTA_UNIT_TARGET_COURIER
    DOTA_UNIT_TARGET_CREEP
    DOTA_UNIT_TARGET_CUSTOM
    DOTA_UNIT_TARGET_HERO
    DOTA_UNIT_TARGET_MECHANICAL
    DOTA_UNIT_TARGET_NONE
    DOTA_UNIT_TARGET_OTHER
    DOTA_UNIT_TARGET_TREE
    

    You can combine them like this:

    "AbilityUnitTargetType" "DOTA_UNIT_TARGET_CREEP | DOTA_UNIT_TARGET_HERO"

    The ability determines all possible targets in this line: https://github.com/Pizzalol/SpellLibrary/blob/master/game/scripts/vscripts/heroes/hero_tinker/heat_seeking_missile.lua#L28 It will select x of the closest enemies. (FIND_CLOSEST set in finunitsinradius and for loop)

    with the parameters from the lines above targetTeam, targetTime, targetFlags...

    By changing AbilityUnitTargetType in KV you will change the return value of ability:GetAbilityTargetType() in lua.

    Github: Profile Steam: Profile

  • I was just curious because it currently doesn't have "DOTA_UNIT_TARGET_HERO" so I was wondering how it was acquiring targets.