• 🏆 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!

[Spell] Metamorphosis & Engineering Upgrade

Status
Not open for further replies.
Level 5
Joined
Jul 31, 2019
Messages
102
I had been attempting to make a spell which allows a hero unit to have his spells upgraded for a set time, the mechanism I intended to use was based on metamorphosis: the hero would use the spell to "transform" into an identical hero, but this one having the Engineering upgrade ability which upgraded 3 of his other spells. But I noticed that every time the time runs out the spells that have been learned before the metamorphosis spell had been activated all disappear leaving blank spaces. Does this usually occur or did I do something wrong? If this is typical is there another method of achieving the same result of having an ultimate spell that upgrades all of the other spells for a set period of time?
 
Level 39
Joined
Feb 27, 2007
Messages
4,992
You need to use UnitMakeAbilityPermanent on the abilities added to the unit when they are added. Without using that they will disappear when morphing.
  • Set UnitVar = (The unit)
  • Set AbilVar = Holy Light (or whatever ability)
  • Custom script: call UnitMakeAbilityPermanent(udg_UnitVar, true, udg_AbilVar)
 
Level 5
Joined
Jul 31, 2019
Messages
102
I think you misunderstood.

I created 2 identical heroes with identical abilities except the 2nd hero has a renamed and reworked engineering upgrade that effects the other 3 spells. So the only ability that is "added" is the engineering upgrade but it is removed when the unit "morphs" back and along with it the abilities that are effected by it are removed...this is the problem.
 
Level 5
Joined
Jul 31, 2019
Messages
102
That works, thank you.

Still it would've looked better with an expiration timer, but this is satisfactory for the time being.
 
Level 5
Joined
Aug 8, 2019
Messages
113
If the ability makes the regular hero abilities dissappear once it's expired you might just wanna use a trigger instead to add the engineering upgrade then set it to wait for 60.0 or however second you want the ability to last then take away the engineering upgrade.

If you want to still have an expiration timer make a copy of something like avatar adjust it properly then have the trigger take away engineering upgrade right before the expiration timer for avatar expires, those are just my thoughts and I have limited experince with the matter so take them with a grain of salt...
 
Last edited:
Status
Not open for further replies.
Top