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
612
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.

      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