- Joined
- Feb 13, 2014
- Messages
- 26
I have been practicing the use of spellbooks. At the moment im trying to fix a bug that happens when a hero morphs that makes the spells in the spellbook disapear.
The explanation of the bug and its fix is here
http://www.thehelper.net/threads/how-to-make-spellbooks.27637/
/////WHY DO MY SPELLS DISAPPEAR FROM THE SPELLBOOK AFTER TRANSFORMATION/METAMORPHISM ETC.
This is because the abilities inside the spellbook are not permanent; they are gained via a spellbook.
To fix this issue, you must make the ability permanent. The only way is to use a piece of custom script because the action is not accessible via GUI:
Jass:
call UnitMakeAbilityPermanent(whichUnit, true, abilCode)
Replace whichUnit with the unit who has the ability and abilCode with the raw code of the ability.
------
This assumes that the game re-adds abilities each time that a unit morphs. This is not true, because a specific unit's abilities are tied to the unit instance, which does not change upon morphing.
So, the MakeAbilityPermanent function is actually fighting the consequences, not the cause. What you really should do is making a copy of the spellbook for the morphed unit.
------///
I’m learning the gui and well I can’t seem to get the ....
I’m using as unit
And as Spell
Which I’m not sure if i should use A003 or A003:AHfs
The final code looks like.
Can anyone walk me through this error?
Ill also Attach the map file if its any help.
The explanation of the bug and its fix is here
http://www.thehelper.net/threads/how-to-make-spellbooks.27637/
/////WHY DO MY SPELLS DISAPPEAR FROM THE SPELLBOOK AFTER TRANSFORMATION/METAMORPHISM ETC.
This is because the abilities inside the spellbook are not permanent; they are gained via a spellbook.
To fix this issue, you must make the ability permanent. The only way is to use a piece of custom script because the action is not accessible via GUI:
Jass:
call UnitMakeAbilityPermanent(whichUnit, true, abilCode)
Replace whichUnit with the unit who has the ability and abilCode with the raw code of the ability.
------
This assumes that the game re-adds abilities each time that a unit morphs. This is not true, because a specific unit's abilities are tied to the unit instance, which does not change upon morphing.
So, the MakeAbilityPermanent function is actually fighting the consequences, not the cause. What you really should do is making a copy of the spellbook for the morphed unit.
------///
I’m learning the gui and well I can’t seem to get the ....
- Custom script: call UnitMakeAbilityPermanent(whichUnit, true, abilCode)
I’m using as unit
And as Spell
Which I’m not sure if i should use A003 or A003:AHfs
The final code looks like.
- Custom script: call UnitMakeAbilityPermanent(gg_unit_Hmkg_0010, true,A003:AHfs)
Can anyone walk me through this error?
Ill also Attach the map file if its any help.
Attachments
Last edited by a moderator: