Show amount healed.

Grags_1977

Ultra Cool Member
Reaction score
32
I've searched high and low on the forums for a decent system that shows amount healed. But had no success.

This is a very old one I made for my Enigma map. But it's just rubbish.

Trigger:
  • Life
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Integer((Life of Unit_Hero))) - Integer_OldLife) Greater than 2
        • Then - Actions
          • Set TempPoint[12] = (Position of Unit_Hero)
          • Floating Text - Create floating text that reads (String(((Integer((Life of Unit_Hero))) - Integer_OldLife))) at TempPoint[12] with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 60.00 towards (Random real number between 0.00 and 360.00) degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
          • Custom script: call RemoveLocation( udg_TempPoint[12] )
        • Else - Actions
      • Set Integer_OldLife = (Integer((Life of Unit_Hero)))


^ Garbage.

Anyone know of a decent one? Preferably one that doesn't run on a periodic trigger and most importantly, must be GUI.

EDIT: I'm not too picky about it running on a periodic trigger. I just want it to be intelligent enough to know when to show the amount healed.

EDIT2: MUI would be a major plus.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you would need to trigger it with your spells, i could make a jass system for it if you would like

EDIT: here is that jass, you can just create a trigger, click edit, convert to custom text, delete whats inside and copy this in, then use:
Trigger:
  • Custom Script: call Heal(Unit, Real Ammount)

to heal the unit you choose for the ammount you choose and create text displaying it

JASS:
library Heal
    globals
        real LastHealed
        constant real speed = 30.0 //this is the speed of the text tag
        constant real height = 30.0 //this is the starting height of the text
        constant real lifespan = 5.0//this is the max lifespan
        constant real fadepoint = 3.0//this is the time during the lifespan it will begin to fade
    endglobals
    
    function HealText takes texttag t, location l returns nothing//this function does the settings of the text
        call SetTextTagColor(t,0,255,0,0)
        call SetTextTagLifespan(t, lifespan)
        call SetTextTagFadepoint(t, fadepoint)
        call SetTextTagVelocity(t, speed, 0.0)
        call SetTextTagText(t, I2S(R2I(LastHealed)), height)
    endfunction
    
    function Heal takes unit u, real h returns nothing//this heals the unit, sets the LastHealed Variable, and creates the text
        call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + h)
        set udg_LastHealed = h
        local texttag t = CreateTextTag()
        local location l = GetUnitLoc(u)
        call HealText(t,l)
        set t = null
        set l = null
    endfunction
endlibrary
 

Grags_1977

Ultra Cool Member
Reaction score
32
"and most importantly, must be GUI"

:p

Thanks anyway :)

Also... If I knew the ammount, I wouldn't be aksing the question in the first place. Showing the ammount healed is not the question.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
I wonder if negative damage fires the Takes Damage trigger. If so, you could try that.
 

Grags_1977

Ultra Cool Member
Reaction score
32
1, Rejuvination.
2, Life steal on weapons.
3, And a couple of allied units have heal.
4, Pots.
 

merlinds

Member
Reaction score
15
mmm that complicates things....
jajajaa. Because for skills like "Holy Light" for example you can detect when the skill is casted and check the current life (previos the cast of the skill) and after that check the ammount of life.
Using the 3 events for this "begins casting an ability" "starts the effect of an ability" and "finish casting an ability".
For the life steal (you could trigger it) and use a damage detection system. IT can be global and work for all units but the amount of life healed can deppend on a variable setted for the unit. For example.

you have 2 swords, one have 15% of life steal and the other 30%. Every time a unit adquieres one of this items, you store in a hash table (using the key handle of the hero manipulating item) to store a real value (0.15 and 0.3).
Then in your global life steal detection, you make the units to regen life depending on the value of his unit handle of the hash table.

For pots, i think it must be manually setted by you, i mind when a unit uses a item, check if the unit has the classification of "Consumable" for example and then deppending on the item type you set the amount healed.

For rejuvenation, you make a trigger that detects the units that have the specific buff, and then run every second showing a fixed amount that you, again, manually set.

I really think it would be a lot of work :p
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
"and most importantly, must be GUI"

:p

Thanks anyway :)

lol a gui version would be like 3 triggers long, ill do one on my lunch but with this you dont even have to immitate it, all you do is when a unit is supposed to be healed do the custom script i posted, using (your unit, the ammount healed) in the parenthesis. I never realized how much easier it was to code in jass or how much more efficient it was, this runs twice as fast as the GUI version

EDIT:
Trigger:
  • Heal
    • Events
    • Conditions
    • Actions
      • Unit - Set life of Healed_Unit(set the unit healed tot his variable before you run this trigger) to (Life of Healed_Unit + Healed_Ammount(set the ammount you want to heal to this before running the trigger))
      • Set Heal_List[List_Order (integer with default value of 1)] = Healed_Ammount
      • If Then Else
        • If
          • List_Order is equal to 20
        • Then
          • Set List_Order = 1
        • Else
          • Set List_Order = List_Order + 1
      • Set Temp_Point = Position of Healed_Unit
      • Floating Text - Create Floating text at Temp_Point that reads String(Integer(Healed_Ammount) using 0, 255, 0 off set by 20 in the z direction
      • Floating Text - Set lifespan of last created floating text to 5.0 seconds
      • Floating Text - Set last created floating text to begin fading at 3.5 seconds
      • Floating Text - Set velocity of last created floating text to 30 towards 90*
      • Floating Text - Show last created floating text for all players
      • Custom Script: call RemoveLocationg(udg_Temp_Point)


Nvm it wasnt 3 triggers, but basically you trigger your healing around this, just set the ammount healed to Healed_Ammount obviously and set the target to Healed_Unit then run this trigger
This should also save the last 20 heals
 

Grags_1977

Ultra Cool Member
Reaction score
32
No offense GFreak, but displaying the amount healed is no problem and would take as little as 5 minutes to configure. My problem is getting the value "Amount_healed" I have no idea where to start. Once I have that value, from there it's a piece of cake.

I did hint at this in 2 posts ago.

Thanks anyway.


I'm starting to think forget the healing system lol.

EDIT: Merlinds some nice ideas there. Though (no offense) I'm not THAT BAD at world editor I wouldn't of thought about the long way round before posting ;)

I just wanted to know if there was a system somewhere that someone had written in GUI (GFreak!) and was easy to use etc.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you trigger that :/

any heals you want to be displayed through text i believe need to be triggered

EDIT: actually cant you do this as your event?

Trigger:
  • Events
    • Life of Unit_Hero becomes greater than Life of Unit_Hero + 1
 

Grags_1977

Ultra Cool Member
Reaction score
32
Shmeh, it doesn't matter. Thanks a lot for the replys. :)

Unfortuantily, I still can't rep you both :(
 

merlinds

Member
Reaction score
15
mmmm, what if you do it the same way yo did it with the first trigger, BUT, you do it with 2 triggers, One that runs every X amount of time, and set to variables PrevLife, and CurrentLife.
And another trigger that have all the actions you created up there, but the even will be "Game - CurrentLife becomes equal to (PrevLife + X)
You will have a trigger runing every 0.1 sec (for example) but with a very few actions and the other trigger (that has most of the actions) will run only when needed.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • 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

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top