Hello
I'm trying to make a custom spell system and need help with a specific part of it.
Goal: I want to be able to create custom spells while touching the object editor as little as possible. I want to be to fill in as many as possible of the fields - the most important are cooldown, mana cost, range, area, duration and cast time - directly in my scripts, so I can create an entire spell without having to change things in the object editor. This is mostly cause maintaining code and updates is a lot easier then. If you have other ideas than my current approach below I would be grateful as well.
Current approach:
What's in the title
I want to write a function that can change an ability field for ALL instances of an ability, hopefully there are natives. Even if there aren't any natives for setting those fields just solving problems 1. or 2. below is enough for me:
I'm aware of the native functions in the screenshot, they are exactly what I'm looking for but they can't access all I need.
PS: I don't use the forum usually. Please tell me if this is in teh wrong spot or have the wrong tags.
Goal: I want to be able to create custom spells while touching the object editor as little as possible. I want to be to fill in as many as possible of the fields - the most important are cooldown, mana cost, range, area, duration and cast time - directly in my scripts, so I can create an entire spell without having to change things in the object editor. This is mostly cause maintaining code and updates is a lot easier then. If you have other ideas than my current approach below I would be grateful as well.
Current approach:
What's in the title
Lua:
-- Assume ability and stringlevelfield are set previously
BlzSetAbilityStringLevelField(ability, abilitystringfield, 0, "New tooltip" ) --[[ The SetAbilityFields natives are problematic cause:
1. Low performance, this only sets the tooltip for one level AND one archmage at a time. Meaning dozens of calls might be needed per ability.
I could work around 1 by updating all abilities at start where performance is irrelevant. But...
2. Doesn't work before the ability is learned.
I can work around 2. by only updating the fields when the ability is learned for heroes, but this has to be done in real time (see 1. D:) and doesn't work for non-hero units.
]]
BlzSetAbilityExtendedTooltip( 'AHbz', "New tooltip", 0 ) -- exactly what I want for other fields :)
I'm aware of the native functions in the screenshot, they are exactly what I'm looking for but they can't access all I need.
Last edited: