[Spell] Regenerate 0.5% health per second

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%.
 
Level 24
Joined
Aug 10, 2018
Messages
2,860
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 24
Joined
Aug 10, 2018
Messages
2,860
@Demtrod
With only one unit it shouldn't hurt performance too much. Is the healing unit like a healing fountain? If so, you can always keep the timer off until a unit comes near the healing source.
 
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
434
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.
 
Top