Zwiebelchen
Hosted Project GR
- Joined
- Sep 17, 2009
- Messages
- 7,234
So, as you guys know; the order in which abilities get placed inside a spellbook is determined by the order in which the abilities are first initialized in ANY spellbook.
So if I put three abilities inside spellbook A: let's call them "P", "Q" and "R" at the beginning of the game, then create a second unit and attempt to add the spellbooks B, C and D to the unit (all spellbooks share the same order id), which all hold only one of these three spells, then the order in which they got added in spellbook A will be restored, no matter in what order I add the spellbooks B, C and D.
So far so good.
I used this trick to give dynamically learned abilities inside a spellbook fixed positions based on their hotkey layout.
Now here's the twist: this all works fine and perfect as long as the level of these abilities won't change. Suddenly, as soon as I level one of these abilities via
This is ... bad ... I don't even have the slightest clue on how to workaround that issue. Even preloading the different levels via
So if I put three abilities inside spellbook A: let's call them "P", "Q" and "R" at the beginning of the game, then create a second unit and attempt to add the spellbooks B, C and D to the unit (all spellbooks share the same order id), which all hold only one of these three spells, then the order in which they got added in spellbook A will be restored, no matter in what order I add the spellbooks B, C and D.
So far so good.
I used this trick to give dynamically learned abilities inside a spellbook fixed positions based on their hotkey layout.
Now here's the twist: this all works fine and perfect as long as the level of these abilities won't change. Suddenly, as soon as I level one of these abilities via
SetUnitAbilityLevel
beyond level 1, the abilities will be thrown out of order again and (in most cases) get pushed to the last free slot or even get pushed out of the command card if there isn't any more free slot.This is ... bad ... I don't even have the slightest clue on how to workaround that issue. Even preloading the different levels via
IncUnitAbilityLevel()
in the same way I preloaded the abilities into the correct order doesn't seem to help.