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

[Spell] Regenerate 0.5% health per second

Status
Not open for further replies.
Level 2
Joined
Nov 9, 2019
Messages
13
How can I set the Life Regeneration Aura ability, to only regenerate 0.5% health per second. As far as I can see, I can only set it to regenerate to a minimum of 1%.
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,455
Doesn't look like you can go below 1%. Might have to trigger it.
  • Life Regen Aura
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint = (Position of YourHealingUnit)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 500.00 of TempPoint) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is Mechanical) Equal to False
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) + 0.50)%
            • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
 
Last edited:
Level 2
Joined
Nov 9, 2019
Messages
13
Not sure if you can. Might have to trigger it.
  • Life Regen Aura
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint = (Position of YourHealingUnit)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 500.00 of TempPoint) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is Mechanical) Equal to False
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) + 0.50)%
            • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
Thanks - thought I might have to do something like that. As long as it's only a single unit, this wont cause performance issues if I did it every 0.5 second?
Do Shift Enter on the field to change the value to whatever you want
Right now it's set to 0.01 which is 1%. I wan't it to be set to 0.005, which is not possible as the lowest value it will accept (even with shift held) is 0.01 (can't add more digits).
 
Level 2
Joined
Nov 9, 2019
Messages
13
I know I have to set it to a specific unit with conditions - I just wanted to know if it would cause notable lag if I ran it every 0.5 sec to make the regen seem more fluid.

Thanks for the suggestions though :)
 
Level 9
Joined
Jul 30, 2018
Messages
445
I just wanted to know if it would cause notable lag if I ran it every 0.5 sec

Not likely. It's really not the event, but how much you do in it. Just picking some units and setting their health is not very demanding if you don't overdo it. An alternative would be to make a static unit group and then use different events and triggers to add and remove units to and from the group and the periodic trigger would only pick the units from the static group. I think that might be a little less demanding. But generally, if the trigger is leak-free and you don't notice any lag now, I don't see why it would cause lag later in the game, unless things really pile up.
 
Status
Not open for further replies.
Top