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

ABILITY REVERTS AFTER MORPH BACK TO OLD ONE PROBLEM

Status
Not open for further replies.
Level 7
Joined
Nov 22, 2004
Messages
192
HI everyone ! I made a spell with metamophrsis from Illidan. My unit, vampire Kain as a feed ability made from the dark Ranger Life Drain, when Kain levels up to certain levels I remove the old Feed ability with a new one with better drain abilities. But when he morphs into a werewolf then back into Kain he reverts back to that old Feed ability that I had removed. I checked if the Wolf unit add the feed ability and it does not, so that is not the problem. Some how the old Kain unit feed spell is stored and I don't know how to have Kain keep that new improved Feed ability.

Help anyone?
 
Level 11
Joined
Jun 2, 2004
Messages
849
Are you adding the new feed ability via triggers? If so, be sure to use this custom script after adding it:

Code:
call UnitMakeAbilityPermanent(udg_TempUnit, true,udg_TempAbility)

Replacing TempUnit and TempAbility with your own global variables after setting them to the unit and ability, of course.
 
Level 7
Joined
Nov 22, 2004
Messages
192
Are you adding the new feed ability via triggers? If so, be sure to use this custom script after adding it:

Code:
call UnitMakeAbilityPermanent(udg_TempUnit, true,udg_TempAbility)

Replacing TempUnit and TempAbility with your own global variables after setting them to the unit and ability, of course.
OK wow thats an easy fix, only a command line. So this line should make the ability permanent, but I have to male ability variables first if I understand. I will definetly try this and will let you know how it worked.
 
Level 7
Joined
Nov 22, 2004
Messages
192
Are you adding the new feed ability via triggers? If so, be sure to use this custom script after adding it:

Code:
call UnitMakeAbilityPermanent(udg_TempUnit, true,udg_TempAbility)

Replacing TempUnit and TempAbility with your own global variables after setting them to the unit and ability, of course.
It worked but now I am stuck with the old ability and the new one when morphing back from wolf into kain. Is there a custom script I can add to permanently removed the old ability. THANKS by the wat!!!
 
Level 7
Joined
Nov 22, 2004
Messages
192
You can remove the ability using triggers. There should even be an action in GUI to remove abilities from a unit.
it won't be sufficient. I already did this. The ability stays stored in a hard coded process, this is why I need to call it with a command line (script) My unit will morph many times and this ability will come back. Kaijyuu solution worked to keep the ability permanent, the new one, but the old stays there because after being removed by trigger, it comes back because it was stored somewhere.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
it won't be sufficient. I already did this. The ability stays stored in a hard coded process, this is why I need to call it with a command line (script) My unit will morph many times and this ability will come back. Kaijyuu solution worked to keep the ability permanent, the new one, but the old stays there because after being removed by trigger, it comes back because it was stored somewhere.
GUI compiles to JASS on map save. As such "custom script" is not a magic fix it all.

Try using timers to add some delay during the morph before removing the ability. Also try disabling permanence on the ability (inverse of enabling it, using false argument instead of true) before removing it.
 
Level 7
Joined
Nov 22, 2004
Messages
192
GUI compiles to JASS on map save. As such "custom script" is not a magic fix it all.

Try using timers to add some delay during the morph before removing the ability. Also try disabling permanence on the ability (inverse of enabling it, using false argument instead of true) before removing it.
Problem solved. I used triggers to add the ability without putting it in the editor.
 
Status
Not open for further replies.
Top