#AddAbility does not work

1 messages · Page 1 of 1 (latest)

distant plank
#

I wanted to make a random assignment of abilities and used AddAbility, but for some reason, when the ability was issued, there was no binding on it and it could not be used. What if I initially give the ability, it works fine

crisp sun
#

Show screenshot of issue and code. If you mean there are no hotkeys then its most likely because first 6 ability slots already taken by hidden abilities (valve adding them during runtime)

distant plank
crisp sun
#

Try create dummy abilities like rubick ones and fill first 6 slots with them to swap later in game

distant plank
pure oar
#

try SetAbilityByIndex?

narrow robinBOT
#

Found 14 functions for index

🇸 🇨 EntIndexToHScript(entityIndex: EntityIndex): CBaseEntity|nil
Turn an entity index integer to an HScript representing that entity's script instance.
🇸 CDOTA_BaseNPC:GetAbilityByIndex(index: int): CDOTABaseAbility|nil
Retrieve an ability by index from the unit.
🇸 CDOTABaseAbility:GetAbilityIndex(): int
🇸 🇨 CEntityInstance:GetEntityIndex(): EntityIndex
🇸 GetEntityIndexForTreeId(treeId: uint): EntityIndex
Get the enity index for a tree id specified as the entindex_target of a DOTA_UNIT_ORDER_CAST_TARGET_TREE.
and 9 more…

crisp sun
#

Post also your kv of ability because i don't see any reason why you can't level up that ability (it have levels and plus button)

distant plank
pure oar
#

if you met something quite wired, try to add a delay🤨

distant plank
crisp sun
#

SetAbilityByIndex will most likely not work because valve hidden abilities all have index = 0 in any slot. Try SwapAbilities instead (it 100% works for hotkeys and rest things)

distant plank
#

It's all cool, of course, but why the hell doesn't AddAbility work)

crisp sun
#

You might have script error that make it use default values and for max level it most likely 0

distant plank
#

This is as strange as possible, my hero has zero occupied ability slots, and if you set an ability in a txt file, it works, but as soon as you start giving it out, it starts to tremble

distant plank
crisp sun
#

Look at console for pink text and if thats the case there are will be errors like "Script not found" or something like that (i don't remember exact text)

distant plank
crisp sun
#

Try add any built it dota ability from any hero

#

If its works then its something related to your ability else something more global and special

#

Like lion stun and not something special like meepo ultimate

distant plank
#

Okay, it's not funny anymore.......

crisp sun
#

How did you removed talent tree? You hide it from panorama or just set every talent to ""

pure oar
#

is it caused by innate ability?

#

mouse hover on your hero, and type ent_hierarchy !picker in your console

#

take a screenshot

crisp sun
#

I was asking just to be sure its not new feature of dota because not long ago they changed how kv override works

pure oar
#

🤔 you add abaddons ability in kv?

distant plank
pure oar
#

oh,well, I misunderstood

distant plank
#

All my abilities work fine if they are given immediately to the hero in a txt file

#

I tried to remove the innate ability and another error was written to me

pure oar
#

so it caused by the innate ability?

#

try to keep axe's original innate ability

distant plank
#

Maybe I also did something wrong with the hero, of course

#

AHHAHAHAHAHAHAH, I ADDED THE AXE INNATE ABILITY AND NOW THERE'S ANOTHER MISTAKE ALTOGETHER

#

I caught 3 mistakes)

pure oar
#

here

#

I think this is the reason

#

if you create hero with ability slot empty

#

valve will auto add some other interaction ability (ie. twin_gate,lamp_use)

#

and those took over the ability slots with keybind

distant plank
#

So I need to make a hidden ability right now?

pure oar
#

new ability you add start with index 6, out of keybind ( QWEDFR

#

maybe

#

but simply swap could also resolve this

distant plank
#

That is, after adding it, I will need to swap the ability to the desired slot?

pure oar
#

yes

#

after swap, it got a hotkey

distant plank
#

I'll try it right now

#

thank you in advance!

distant plank
#

❤️

#

Спасибо!

#

🙂

distant plank