• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Metamorphosis vs abilities

Status
Not open for further replies.
native UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilityId returns boolean

^This function should make the ability permanent, and not being removed when morphing. There doesn't exist a GUI equivalent, but with help of variables you can use it easily.

  • Set Ability = Shockwave
  • Set Unit = < Your Unit >
  • Custom script: call UnitMakeAbilityPermanent(udg_unit, true, udg_Ability)
The custom script will make "Ability" permanent for "Unit", you can try to copy and paste it.
 
native UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilityId returns boolean

^This function should make the ability permanent, and not being removed when morphing. There doesn't exist a GUI equivalent, but with help of variables you can use it easily.

  • Set Ability = Shockwave
  • Set Unit = < Your Unit >
  • Custom script: call UnitMakeAbilityPermanent(udg_unit, true, udg_Ability)
The custom script will make "Ability" permanent for "Unit", you can try to copy and paste it.

Here's what I've got:
Screenshot
It doesn't help at all... Can I use a spell book ability as ability? Or when I disable it it can't become permanent?
 

Attachments

  • timon-pumbaa-oh-o.gif
    timon-pumbaa-oh-o.gif
    724.8 KB · Views: 142
Last edited:
Using @IcemanBo's method, you would also have to make the abilities in the spellbook permanent too. If I can quote myself from the following thread, How do I code this?:

The Issue with Morph Abilities
After numerous tests and some research, I have found the cause of the disappearing spellbook; the morph process itself.

Apparently when morphing, [POST=1155294]all abilities added via triggers are reset[/POST] unless they are given permanence using the Jass native
UnitMakeAbilityPermanent
. Therefore if you're adding a disabled spellbook to a unit dynamically, making it permanent will prevent this problem. The catch: the abilities inside the spellbook also have to be made permanent.

This isn't necessarily a problem; more of a nuisance. There is the possibility of avoiding this mess thanks to Ceday's post in this year-old thread: Metamorphosis and Bear Form Remove Abilities. By changing the event to Unit - A unit Finishes casting an ability and checking the unit-type of the triggering unit, you can add the disabled spellbook without worrying about permanence at all.

For those moments when there is no need to add a spellbook dynamically, adding it to the alternate unit in the object editor will also work; just make sure to disable it in the triggers! :p
 
For the information I gathered on this post you need to do this:
Store your unit into a unit variable, store the spellbook itself into a ability variable then store all abilities on the spellbook into a variable of each one, then you run the custom script code for each of them (including the spellbook itself)
  • Spellbook
    • Events
    • Conditions
    • Actions
      • Set YourUnit = (Triggering unit)
      • Set Spellbook = YourSpellbook
      • Set Spelbook_Ability1 = Acid Bomb
      • Set Spellbook_Ability2 = Devotion Aura
      • Custom script: call UnitMakeAbilityPermanent(udg_YourUnit, true, udg_Spellbook)
      • Custom script: call UnitMakeAbilityPermanent(udg_YourUnit, true, udg_Spellbook_Ability1)
      • Custom script: call UnitMakeAbilityPermanent(udg_YourUnit, true, udg_Spellbook_Ability2)
 
For the information I gathered on this post you need to do this:
Store your unit into a unit variable, store the spellbook itself into a ability variable then store all abilities on the spellbook into a variable of each one, then you run the custom script code for each of them (including the spellbook itself)
  • Spellbook
    • Events
    • Conditions
    • Actions
      • Set YourUnit = (Triggering unit)
      • Set Spellbook = YourSpellbook
      • Set Spelbook_Ability1 = Acid Bomb
      • Set Spellbook_Ability2 = Devotion Aura
      • Custom script: call UnitMakeAbilityPermanent(udg_YourUnit, true, udg_Spellbook)
      • Custom script: call UnitMakeAbilityPermanent(udg_YourUnit, true, udg_Spellbook_Ability1)
      • Custom script: call UnitMakeAbilityPermanent(udg_YourUnit, true, udg_Spellbook_Ability2)
Yeah, that's right :) I got it :) Thanks :)
 
Status
Not open for further replies.
Back
Top