Another Question...

J3LADE

New Member
Reaction score
7
I have made a very simple trigger to display the damage a unit takes when it is attacked...

Code:
Event: Unit - A unit is attacked
Actions: Floating Text - Create Floating Text that reads (String(Damage Taken)) (above attacked unit) with blah blah blah
Floating Text - Set Velocity of (Last created Floating text to 64.0 towards 90'
Floating Text - Change the fading age of (Last Created Floating Text) to 1.00 sec

I dont understand why this comes up with 0.000 above the unit instead of a number greater than that when the unit IS actually being damaged...

Also i would like some ideas on how to make a trigger to display when a unit is healed excluding normal regeneration...
 
P

Peanuthead

Guest
Damage Taken doesn't respond to that event. It responds to (unit) takes damage, which is not generic.

Code:
Events
A Unit is Attacked

Actions
Set RealVariable1 = (Life of (Triggering Unit))
For Each Integer A from 1 - 100
If - Conditions
(Life of (Triggering Unit)) less than RealVariable1
Then - Actions
   Create Floating text with String((Real Variable) - (Life of (Triggering Unit))
   Custom Script: exitwhen true
Else - Actions
    Wait Game Time 0.01 seconds.
Can't guarantee this will work as I just made it up on the spot. But when a unit is attacked, the unit hasn't actually been attacked yet so you have to wait until it is and then check. Heals and other triggers may mess with this...

And for this to work completly, it will have to be in jass, with locals used for RealVariable1, since if this runs again before it is done, the same RealVariable1 will be used.

For healing, make something similar to this, except it responds to Starts The Effect of a Ability, and wait until the health is greater, then display the current - old. Remember, Jassify it.
 
P

Peanuthead

Guest
For the Jassify part...

Convert trigger to custom text. Under Main Edit Tab when trigger is selected.

Now for some text editing... Find the Set Variable part, and replace the "Set RealVariable1" with "local real RealVariable1". Then go through the trigger and remove every "udg_". Not sure, but you might have to also add "set RealVariable1 = null" to the end on a new line.(before the seperator)
 

J3LADE

New Member
Reaction score
7
k ive got it so far... but i need to know howw to make the numbers round off. Cause right now they appear like 26.607 or some $#!^ like that.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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