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

[Solved] Adding Ability

Status
Not open for further replies.
Level 8
Joined
Jul 10, 2018
Messages
383
Hi i'm trying to add an ability to a hero when he Reach a certain health it all works and fine but when he Activate the ability it doesn't transform him to the right Unit

The ability Metamorphosis

It does Transform him but not exactly the same it's like something is wrong and his much weaker than before and to top it off the Next transformation has Chaos attack but doesn't show he got it
only hero attack which what he had.
 
Level 8
Joined
Jul 10, 2018
Messages
383
when you add an ability to an unit by a trigger action, it will be lost as soon the unit morphs. One can make an ability permanent with an native which is not ported to gui. UnitMakeAbilityPermanent takes unit whichUnit, boolean permanent, integer abilityId returns boolean
Nonono you got the wrong idea when the Hero Morphs it doesn't morph into the correct unit
the morph last for 60 minutes so it won't be for that long.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
It’s definitely morphing into the correct unit; all of the morph spells change the unit into the one you specify in the ability editor. The problem is you are doing SOMEthing to that unit before it morphs that is not carrying over. Are you modifying the unit’s stats, health, damage, etc? Are any systems in the map doing so?

Also wtf do you need a 60 minute morph for? Just replace the unit with a trigger, dude.
 
Level 8
Joined
Jul 10, 2018
Messages
383
It’s definitely morphing into the correct unit; all of the morph spells change the unit into the one you specify in the ability editor. The problem is you are doing SOMEthing to that unit before it morphs that is not carrying over. Are you modifying the unit’s stats, health, damage, etc? Are any systems in the map doing so?

Also wtf do you need a 60 minute morph for? Just replace the unit with a trigger, dude.
60 minute for the Second stage meaning it won't change back to normal

I have few systems Like :Unit indexer: Item Remover Tome:
so the boss when he reach certain health he Refuels it to the full by triggers and adds the Second stage ability and makes him use it when he reach certain Health.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
But if you don’t want it to change back then why not just replace the unit instead of using a morph ability?

Nothing you described in your previous post would cause non-permanent changes to the unit before morphing. Can you please specifically quantify how the unit is not correct after the morph? What does “weaker” mean? Normal metamorph can change attack type to chaos so that should also work. Does the unit it’s morphed into also have the morph ability?
Morph spells can bugg if the morphed unit does not have the morphing ability.
 
Level 8
Joined
Jul 10, 2018
Messages
383
But if you don’t want it to change back then why not just replace the unit instead of using a morph ability?

Nothing you described in your previous post would cause non-permanent changes to the unit before morphing. Can you please specifically quantify how the unit is not correct after the morph? What does “weaker” mean? Normal metamorph can change attack type to chaos so that should also work. Does the unit it’s morphed into also have the morph ability?
========
My new unit has chaos attack has better stats changed Unit and changed name and none of them are changed.
 
Level 8
Joined
Jul 10, 2018
Messages
383
Morph abilities don't change the stats of the original unit. Only attack and armor types and unit abilities can be changed. Just replace the unit in whole - why do you need to morph it?
Enough with the stupid question "why do you need to morph it?" If you know how to fix it tell me if you don't I will make this thread unsolved and move on.
 
Level 9
Joined
Jul 30, 2018
Messages
445
Enough with the stupid question "why do you need to morph it?"

Why is it stupid? I was just wondering what the reason is, because - depending on your reason - it just might be a lot easier to just replace the unit via a trigger. So far what you have told, I don't really see why it should necessarily be done with a morph ability.

You are of course free to do whatever you want to do, but my point is exactly that I don't know how to make the morph ability change the stats, therefore I am thinking about alternatives for you to do the thing you want to achieve. If you are determined to do it the hard way, then you you can do that, but then I'm afraid you are going to have to figure it out yourself. If you run into another problem on the way, feel free to ask further questions, but at this point I don't think there is much more help we can give you.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
The replace unit action literally replaces the unit by removing the existing one, creating a brand new different unit and copying some (not all) of the values across. For this reason it is bad, very bad. For example all groups and unit variables referencing the unit will not automatically reference the resulting unit after using the replace unit action, one must explicitly set them to reference the new unit.

Rather use the inverse bear form trick to permanently change a units type. By using triggers to add and remove bear form, the specified unit will permanently transform into the bear form ability specified base unit type. This effectively allows one to change unit types at will at the cost of a bear form ability per desired unit type.

If you are having problems with stats after changing unit types you will need to post an example map and explain where the problem is. Such as what you desire the unit has after the type change compared with before.
 
Status
Not open for further replies.
Top