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

replaced unit dies immediately

Status
Not open for further replies.
Level 12
Joined
Jan 13, 2008
Messages
559
When using an item, a hero gets replaced by another hero. There are hitpoint upgrades for the hero and when the upgraded hitpoints are twice as high as the heroes default hp, the replaced unit immediately dies when using the item.

Example:
Starter Hero, 100 HP, 0 Upgrades
then I upgrade 100 times the hitpoint upgrade so the hero has 200 HP. Now I use the item and the hero gets replaced and immediately dies. Why?
Both heroes use the hitpoint upgrade...i also tried to replace with different values (old units relative life, new units default, new units max life etc) nothing works
 
Level 21
Joined
Dec 4, 2007
Messages
1,479
Actually they can stack up, if you use a little trickery:

If you want to add x maximum health, you would need the "item life bonus" ability with 2 levels, level 1 = x health, level 2 = 0 health.

Simple add this ability to the desired unit/hero, level it up and remove it. The bonus of its level 1 value remains permanently and you can stack the same ability over and over.
 
Level 12
Joined
Jan 13, 2008
Messages
559
Actually they can stack up, if you use a little trickery:

If you want to add x maximum health, you would need the "item life bonus" ability with 2 levels, level 1 = x health, level 2 = 0 health.

Simple add this ability to the desired unit/hero, level it up and remove it. The bonus of its level 1 value remains permanently and you can stack the same ability over and over.
oh thats nice. I remember it works also with mana. thanks for the reminder
 
Level 12
Joined
Jan 13, 2008
Messages
559
thanks but I found a better and much easier way!! I found a fix to the above mentioned bug!

Give the hero a max hp of 9999999 (just make sure this value can never be crossed), then give the player a hitpoint upgrade which decreases the hitpoints by X so your hero will have the desired base hitpoints. Then you can use the upgrade which gives hp..completely normal..replacing the unit wont kill anything then.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Id still suggest using BonusMod (or SetMaxLife/Mana snippet), if your health/mana values are reaching really high numbers, you probably need slightly higher leveled ones than the default systems provide, but that should be easy.
 
Status
Not open for further replies.
Top