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

How to make health regeneration types?

Status
Not open for further replies.
Level 6
Joined
Apr 1, 2009
Messages
220
Just asking how to make different types of health regenerations.

If you don't get what i mean, i;m referring to "Only regenerates in Blight or only regenerates in Night stuff. Specifically, how to make a "Only regenerates in water"?
 
Level 13
Joined
Sep 13, 2010
Messages
550
You can trigger it. Set the regeneration type None and create trigger like:
  • Untitled Trigger 001
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to (==) Footman)) and do (Actions)
        • Loop - Actions
          • Set Point = (Position of (Picked unit))
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Terrain pathing at Point of type Floatability is off) Equal to (==) False
              • Then - Actions
                • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + ((Max life of (Picked unit)) x (0.01 x 0.03)))
              • Else - Actions
          • Custom script: call RemoveLocation( udg_Point )
Leakless simple function. Quick and realistic. Floatability is the water. 0.01*0.03 is that every second units regains their 1% of their hit points and 0.03 is that fps thingy. It could be 0.01/33.33 and also I recommend that too because you will able to set unit hitpoint easier. Like 0.5% per sec is 0.01/66.66 etc. Also change footman. :D
Of course working with hundreds of units slows game at this frame rate so you should increase periodic sleep time. Creating other things like this are not harder than this one.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
Only regenerate on blight and at night are hard coded in the game engine and only 1 can be choosen for a unit object. They affect base regeneration only (not regeneration from strength). You can not make custom regeneration types.

You can however design a trigger system to emulate custom regeneration types but I would avoid applying it to too many units otherwise performance could be a problem.
 
Status
Not open for further replies.
Top