#Is it possible to actively add modifiers during the initialization of a game object to achieve certa

1 messages · Page 1 of 1 (latest)

timber garden
#

Is it possible to actively add modifiers during the initialization of a game object to achieve certain objectives?

I noticed that when creating a siege unit, it automatically comes with a modifier named 'modifier_creep_siege,' which I found to be a built-in modifier. I'm wondering what kind of guidance this provides for designing custom characters. Can I create a custom modifier and add it to a character upon creation without the need for any skills or equipment? Does this design pose any issues, or does it go against the game philosophy in Dota?

cedar thorn
#

ListenToGameEvent('npc_spawned', ...)

#

Look for that. Runs your function for every unit that's created (hero/creep/illusion, custom or not... check inside).

spice pier
#

skills and equipment are both abilities (abilities and items both use the CDOTABaseAbility class)
modifiers do not need to be tied to an ability, so no there is no issue in using a modifier without having be it tied to an ability, having be tied to an ability just gives it some extra functionality, as well as the KV reference

the siege creeps are actually defined with an ability, which I'm assuming is the source of the modifier you're talking about

#

tl;dr

  • Items and abilities are 90% the same class-wise (item class extends ability class)
  • Modifiers do not need to be tied to an ability, theres no real downside to not doing it outside of reference
  • Most built-in dota modifiers come from abilities, sometimes they're hidden