• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Upgraded unit lost Spell Book (Bug?)

Status
Not open for further replies.
Level 8
Joined
Sep 30, 2012
Messages
205
I encountered a bug..
I have a unit, a tower for example that can be upgraded.
Both units have the same spell book.
But the upgraded unit seems to have lost its spell book.
Anyone knows how to fix this?

I also en counter problems giving the upgraded unit the ability back via triggers..
An upgraded unit doesn't seem to be "finished with construction" nor did it "enter the game" or "finished researching".. - how can you determine the upgraded unit?

Thanks in advance!
 
Have you tried call UnitMakeAbilityPermanent(udg_YourUnit, true, udg_AbilityID) ?

To see the ID of the ability, go to Object Editor -> Abilities Tab -> Press CTRL + D
Now, you can see the ID of each ability (the Ability Name is changed to Spell ID), find the ability and enter it in the parameter using the said function.

Example;
  • Set Caster = (Triggering unit)
  • Custom script: call UnitMakeAbilityPermanent(udg_Caster, true, 'AHfs')
This will make the Caster to have the Flame Strike (AHfs) ability to permanently stays to that unit.
Usually this problem occurs when the unit faces a morphing stage, in this case, your tower is changing to a new unit via upgrade.

The ID you are looking for, is the Spell Book ability.
If only the Spell Book retains while the spell inside is lost, you have to make for the abilities' ID inside the book too.

NOTE: And yeah, it is CASE-SENSITIVE, remember to put the ' ' encloses the Ability ID.
 
A better way is just making an identical copy of the spellbook to be put on the alternate unit.
The thing is that when a unit is remade for whatever reason(morph/upgrade), then the game doesn't check for the abilities inside the spellbook.
Thus, it just looks "Alright, the new unit has this ability, so no need to add it".
The result is that the spellbook ability itself is kept, but not the ones inside it.
(My spellbook tutorial also brings out this detail)
 
Status
Not open for further replies.
Back
Top