[help] Remove Insta-heal and have normal promotions heal

kaspergm

Deity
Joined
Aug 19, 2012
Messages
5,570
So, I know this is done in some of the mod-packs, but I would like to have it as a separate mod. I tried to do it but ran into a problem.

What I did was:
1) Delete Insta-heal promotion (worked fine)
2) Apply Insta-heal tag on all other promotions (worked fine BUT with a problem)
3) Change Insta-heal rate from 50 to 20 (worked fine)

PROBLEM: This makes all other promotions one-shot. I.e. when I pick for instance "Drill I" for my Pikeman, he heals 20 points but does not actually get the Drill I promotion. On next level-up, I can pick "Drill I" again, which will have the same result.

QUESTION: My question is this:
1) Is this an inherent feature of the Insta-Heal tag, or am I doing something wrong?
2) Can this be done solely through normal modding, or do you have to go into DDL to do this?
 
1) Is this an inherent feature of the Insta-Heal tag
Any promotion with InstaHeal=true is never earnt, furthermore, the promotion is only valid if the unit is damaged
2) Can this be done solely through normal modding
Yes (if 'normal' includes Lua).

Hook the UnitPromoted(iPlayer, iUnit, iPromotion) GameEvent and heal the unit at the same time (note that this event is NOT called when using pUnit:SetHasPromotion() directly ... this is by design!)
 
Thanx for the answer! I'm incapable of doing LUA, but at least now I know.
 
whoward69 said:
Spoiler :
Quote:
Originally Posted by kaspergm View Post
1) Is this an inherent feature of the Insta-Heal tag
Any promotion with InstaHeal=true is never earnt, furthermore, the promotion is only valid if the unit is damaged
Quote:
Originally Posted by kaspergm View Post
2) Can this be done solely through normal modding
Yes (if 'normal' includes Lua).

Hook the UnitPromoted(iPlayer, iUnit, iPromotion) GameEvent and heal the unit at the same time (note that this event is NOT called when using pUnit:SetHasPromotion() directly ... this is by design!)

After deleting InstaHeal, couldn't you just create a LUA function that healed a unit by however many health points and then just insert that function into all promotions you wanted?
 
Top Bottom