regeneration rate based on currently missing HP

snmiglight

Active Member
Reaction score
3
how can i make a spell (a passive one) that regenerates a unit's missing hp... lets say: "... regenerates 1/2/3/4% of the unit's missing HP per second. i think it has.. somewhat similarity to healing ward's... am i correct? i know that it is codeable 'cause i've encountered such skill before...
 

istar

New Member
Reaction score
31
healing wards heal by a fixed % of max hp, amount healed per unit is constant unless its max hp changes
it seems that it needs to be triggered healing
in GUI
event unit cast ability
ability is 'that'
add unit to unitgroup
turn on 2nd trigger
2nd trigger-
event every 1 sec
action pick every unit in unitgroup and do
set unit current hp = ((unit maxhp-unit current's)X0.01)+current's
JASS is better
 

DiFm

New Member
Reaction score
35
you dont need 2 triggers for that just use the last one.

every 1 second of game time.


actions
set Group = unit group all unit that has (Regen) buff
pick every unit unitgroup
set units hp.....
call DestroyGroup(Udg_Group)
 

istar

New Member
Reaction score
31
1st trigger
event unit cast ability
ability is 'that'
add unit to unitgroup
turn on 2nd trigger

2nd trigger-
event every 1 sec
action pick every unit in unitgroup and do
set unit current hp = ((unit maxhp-unit current's)X0.01)+current's

this is in GUI...
but i said JASS is better as i used 2 triggers here(inelegant), where as i can create in in JASS with 1 trigger
 

snmiglight

Active Member
Reaction score
3
so i see... so how do you do it in JASS? is it okay?

EDIT: what if... per level i want it to be 1/2/3% regen (per level respectively)
how can i do that?
like this??

((unit maxhp-unit current's)X0.01)+current's
((unit maxhp-unit current's)X0.02)+current's
((unit maxhp-unit current's)X0.03)+current's


(sounds funny, sorry im such a beginner)
 

DiFm

New Member
Reaction score
35
for this spell i see No benefit from using Jass. it works just as good as with GUI since its a passive.

if it's only for 1 person You can just use the trigger i posted and change this.


set picked unit's life to (((max life) - (current life)) x ((0.01) x (level of (regen) abilty for (picked unit))) + units current life.
 

YourFace

<span style="color:#9C9C9C;"><strong>Runner Up - T
Reaction score
91
he's right jass is not required

Code:
every 1 second

     set unit group = units with regen buff
     pick every unit in unit goup and do
        lopp actions
         set real_variable= (max life of triggering unit)-((current life of picked)) x 0.01))
        set life of picked unit to life of picked unit +real variable
 

snmiglight

Active Member
Reaction score
3
hey... it doesnt seem to work... is there something wrong with these?

Resilience
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Set ResiliencedUnit = (Units owned by (Owner of (Triggering unit)) matching (((Triggering unit) has buff Resilience ) Equal to True))
Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) matching (((Triggering unit) is in ResiliencedUnit) Equal to True)) and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((((Max life of (Picked unit)) - (Life of (Picked unit))) x 0.05) + (Life of (Picked unit)))
Do nothing
 

istar

New Member
Reaction score
31
theres no TriggeringUnit in a periodic time event
use pick all units of player
 

istar

New Member
Reaction score
31
action - player
i prefer if you use a unitgroup or something to record units with that ability
then pick units matching condition around unit with ability
instead of picking the player
 

istar

New Member
Reaction score
31
generally i would ignore you
but i am nice
right-click>new action>the first drop down menu>player>second drop drop menu>pick units belonging to player

BUT, like i said
i rather you make this
event-unit learns ability
condition-ability is resilence
action-add unit to unitgroupA

event-periodically
action-pick all units in unitgroupA and do
pick units in 256 radius arund picked units and do
the regen stuff
 

snmiglight

Active Member
Reaction score
3
yes i know... now how can i fix that?? didnt i told that im am not that very familiar with this?



generally i would ignore you
but i am nice
right-click>new action>the first drop down menu>player>second drop drop menu>pick units belonging to player

BUT, like i said
i rather you make this
event-unit learns ability
condition-ability is resilence
action-add unit to unitgroupA

event-periodically
action-pick all units in unitgroupA and do
pick units in 256 radius arund picked units and do
the regen stuff
ok i'll try thanks... the above message is for the flamer
 

istar

New Member
Reaction score
31
ok i'll try thanks... the above message is for the flamer
isnt the flamer me?
anyway, please exsplore the trigger editor and familiarise yourself
we cant help you if you dont know half the thing we talking about
 

istar

New Member
Reaction score
31
ok, the message is erased apparently
just a small misunderstanding, its cleared up
have fun modding
currently making a intelligent/dynamic trade system, argh... tough
 

snmiglight

Active Member
Reaction score
3
yes.. and thank you very much, it really helped.. actually i solved the problem by this:

Resilience
Trigger:
  • Events
    • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Resilience ) Equal to True
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((((Max life of (Picked unit)) - (Life of (Picked unit))) x 0.01) + (Life of (Picked unit)))
            • Else - Actions


anyways, do you see any leaks in here? thank you again.
PS: ignore the 0.25 seconds on event... i intend it to work that way. (5% missing HP regen)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top