Damage Taken Condition?

Knatten

New Member
Reaction score
7
Hi, is there an Damage Taken Condition?
Like, ''Damage taken equal to or more then 1''.

The reason is i have a damage show floating text, and it sometimes shows ''0!'' which is annoying.

Edit: Nevermind i did it this way

Code:
Show Damages
    Events
    Conditions
        (Unit-type of (Triggering unit)) Not equal to Wisp
    Actions
        Set MyLocation = (Position of (Triggering unit))
        Set Damagetaken = (Integer((Damage taken)))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Damagetaken Equal to 0
            Then - Actions
                Do nothing
            Else - Actions
                Floating Text - Create floating text that reads ((String((Integer((Damage taken))))) + !) at MyLocation with Z offset 0.00, using font size 8.00, color (100.00%, 15.00%, 10.00%), and 30.00% transparency
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
                Floating Text - Set the velocity of (Last created floating text) to 70.00 towards 180.00 degrees
                Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                Custom script: call RemoveLocation(udg_MyLocation)

Just last question, does that leak ?
 

Knatten

New Member
Reaction score
7
Oh ok, i lied about the last question :p.

I tryed and search for ''Real leak'' but that shows every thread with ''leak'' in it :S (working as intended). So my next question is how do i remove leaks from real values :) ?
 
O

Onikage

Guest
Here's what I use for scrolling damage... Can't tell ya if it leaks or not =/

Code:
Damage Taken
    Events
    Conditions
    Actions
        Floating Text - Create floating text that reads (String((Integer((Damage taken))))) above (Triggering unit) with Z offset 0.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
        Floating Text - Set the velocity of (Last created floating text) to 160.00 towards 90.00 degrees

Then every time I make a unit I simply do:
Code:
Trigger - Add to Damage Taken <gen> the event (Unit - [I]unit[/I] Takes damage)

Never had a problem with scrolling 0's.
 

Knatten

New Member
Reaction score
7
Yea i already do that on start

Code:
Register PrePlaced Units
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Trigger - Add to Show Damages <gen> the event (Unit - (Picked unit) Takes damage)

Code:
Detect Unit
    Events
        Unit - A unit enters (Playable map area)
    Conditions
    Actions
        Trigger - Add to Show Damages <gen> the event (Unit - (Triggering unit) Takes damage)

but that's not my problem, and i still get scrolling 0s.
 

ZiggyMcjoney

Data editor?! AAAHHHHH!
Reaction score
95
If you don't want scrolling 0's, add a condition checking that the damage taken isn't equal to 0.
 
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