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.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top