1. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  2. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  6. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Spell] Metamorphosis & Engineering Upgrade

Discussion in 'World Editor Help Zone' started by Spear, Aug 3, 2019.

  1. Spear

    Spear

    Joined:
    Jul 31, 2019
    Messages:
    103
    Resources:
    0
    Resources:
    0
    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?
     
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,788
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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)
     
  3. Spear

    Spear

    Joined:
    Jul 31, 2019
    Messages:
    103
    Resources:
    0
    Resources:
    0
    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.
     
  4. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,788
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Try adding and removing the EU with triggers when the spell is cast/ends, then. EU can be removed and the spells should go back to their un-upgraded state.
     
  5. Spear

    Spear

    Joined:
    Jul 31, 2019
    Messages:
    103
    Resources:
    0
    Resources:
    0
    That works, thank you.

    Still it would've looked better with an expiration timer, but this is satisfactory for the time being.
     
  6. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,788
    Resources:
    1
    Spells:
    1
    Resources:
    1
    You can add the expiration timer yourself with a trigger. You should be able to use a morph ability too, just don’t give the morphed form the EU ability.
     
  7. Prince Aerrus

    Prince Aerrus

    Joined:
    Aug 8, 2019
    Messages:
    137
    Resources:
    0
    Resources:
    0
    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: Aug 9, 2019