• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spells in Spellbook Disappear After Adding Chaos Morph

Status
Not open for further replies.
Level 11
Joined
Aug 6, 2009
Messages
697
I created a spellbook because I needed more slots for abilities, but I have a custom transformation on the hero with spellbook.
At first I have all the spells in the spellbook, but after transforming, all the spells in the spellbook disappear.
Is there a fix to this? If not, is there a different way to make room for more abilities?
 
I don't know if there is a way in GUI, but if you want an ability to persist through morphing, then you have to set it to be permanent.

In JASS, it would look like this:
JASS:
call UnitMakeAbilityPermanent(<unit>, true, <ability ID>)

So you have to do it on a unit-by-unit basis, and for each ability they have. To find out the ability ID, open the object editor, press CTRL+D and look at the four letter code next to the ability in question. Most custom abilities will start off at 'A000' by default, and keep going up from there ('A001', 'A002', etc.).

So if you were doing it in GUI and wanted to make the ability with the rawcode 'A004' persist through morphing, it would look like this:
  • Set TempUnit = (Triggering unit)
  • Custom script: call UnitMakeAbilityPermanent(udg_TempUnit, true, 'A004')
All you need to do is replace (Triggering unit) with whichever unit you want, and replace 'A004' with the appropriate rawcode.
 
Status
Not open for further replies.
Top