System Showing Damage Dealt

I

IKilledKEnny

Guest
The following system was suggested by SerraAvenger, he gave the basic idea and I made it into triggers.


Here are the triggers, I will go over each one.

Code:
Set Strings
    Events
        Map initialization
    Conditions
    Actions
        Set Global_Array_16_String[1] = |CFFFF0303
        Set Global_Array_16_String[2] = |CFF0042FF
        Set Global_Array_16_String[3] = |CFF1CB619
        Set Global_Array_16_String[4] = |CFF540081
        Set Global_Array_16_String[5] = |CFFFFFF01
        Set Global_Array_16_String[6] = |CFFFE8A0E 
        Set Global_Array_16_String[7] = |CFF20C000 
        Set Global_Array_16_String[8] = |CFFE55BB0
        Set Global_Array_16_String[9] = |CFF959697
        Set Global_Array_16_String[10] = |CFF7EBFF1
        Set Global_Array_16_String[11] = |CFF106246 
        Set Global_Array_16_String[12] = |CFF4E2A04 
        Set Global_Array_16_String[13] = |CFF000000
        Set Global_Array_16_String[14] = |CFF000000
        Set Global_Array_16_String[15] = |CFF000000
        Set Global_Array_16_String[16] = |CFF000000

Here we set the strings that will color the text. Each string is it's players color, thus Global_Array_16_String[4] will color text to purple and so on.

Code:
Init Set
    Events
        Time - Elapsed game time is 1.00 seconds
    Conditions
    Actions
        Set Global_Unit_Group = (Units in (Entire map))
        Unit Group - Pick every unit in Global_Unit_Group and do (Actions)
            Loop - Actions
                Trigger - Add to Show Damage <gen> the event (Unit - (Picked unit) Takes damage)
        Custom script:   call DestroyGroup(udg_Global_Unit_Group)

Becuase takes damage is not a generic event we need to add the event for each unit.

Code:
Ingame Set
    Events
        Unit - A unit enters (Entire map)
    Conditions
    Actions
        Trigger - Add to Show Damage <gen> the event (Unit - (Triggering unit) Takes damage)

Does the same to units which are not pre-placed.

Code:
Show Damage
    Events
    Conditions
    Actions
        Set TempLoc[1] = (Position of (Triggering unit))
        Set TempLoc[2] = (TempLoc[1] offset by 50.00 towards 315.00 degrees)
        Floating Text - Create floating text that reads ((Global_Array_16_String[(Player number of (Owner of (Damage source)))] + (String((Integer((Damage taken)))))) + !) at TempLoc[2] with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 25.00% transparency
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Change the lifespan of (Last created floating text) to 0.65 seconds
        Custom script:   call RemoveLocation(udg_TempLoc[1])
        Custom script:   call RemoveLocation(udg_TempLoc[2])

The core of the system, when a unit is hit it will show by hit the amount of damage done it and will color the text with the same color of the damaging unit.

Say you want to also show the current life of the unit as well? Sure.

Code:
Show Damage and Life
    Events
    Conditions
    Actions
        Set TempLoc[1] = (Position of (Triggering unit))
        Set TempLoc[2] = (TempLoc[1] offset by 50.00 towards 315.00 degrees)
        Floating Text - Create floating text that reads ((Global_Array_16_String[(Player number of (Owner of (Damage source)))] + (String((Integer((Damage taken)))))) + (! + (|cffffff( + ((String((Integer((Life of (Triggering unit)))))) + ))))) at TempLoc[2] with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 25.00% transparency
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Change the lifespan of (Last created floating text) to 0.65 seconds
        Custom script:   call RemoveLocation(udg_TempLoc[1])
        Custom script:   call RemoveLocation(udg_TempLoc[2])

There is a template attached, feel free to take a look and comment.
 

Attachments

  • Show Damage System.w3x
    16.2 KB · Views: 754

13lade619

is now a game developer :)
Reaction score
399
1. Certain units (usually heros) will do the same attack animation all the time, as far as I know, no way to fix that.

yes, that is true. sometimes it's becomes very wierd.

they will always play their "attack slam" animation if they have one.

this principle also works for 100% bash.

-
thehelperTripleAnimatedUB.gif
 

SerraAvenger

Cuz I can
Reaction score
234
1.:
It is called "Damage dealt", not done

2.:
It is better to make it this way

Initfordamage
Code:
Event: Map intialisation
Action: 
Pick every unit in entire map and do
Add event to trigger culater: Picked unit is dealt damage

Nextstep
Code:
Event: Unit enters Entire map
Action:
Add event to trigger culater: Entering unit is dealt damage

culater
Code:
Event:
Action: Create Flaoting text above Triggering Unit: I2S( R2I( Damage dealt) ) + "!"
Set Speed of Last created floting text to 64 towards 90 degrees
// Any actions you want the floating text to perfrom, including being removed and fading away


Note: not the trigger code, but a short manual
 
I

IKilledKEnny

Guest
... That hurt SerraAvenger. :p

Nice, with a little twiching that would work great... So much for my system, heh.
 
I

IKilledKEnny

Guest
> sry wasn't meant as an offense

You weren't. I'm going to completely rewrite this using your system (with credits of course).
 

elmstfreddie

The Finglonger
Reaction score
203
Nothing wrong with using Crit, except your stuck with all the settings for crit, for instance the red text n stuff. It's best you make it using floating text and damage dealt detection, because then you can do the same thing for others. Like if someone casts a spell, display the name of the spell in say, blue, instead of red. Or if you're healed for hp, +(hp healed) in green.
... Actually, add those to the system. That would make it better, because I thought everyone knew how to do the crit thing :nuts:
 

Chocobo

White-Flower
Reaction score
409
You should show also how to hide the critical text from Wind Walk ability. (Dummy unit with Invisibility)

But it's more a System, so it should be in Submission (but it shouldn't because it is overcrowded by the zomgage).



Who reads the thread - to show damage dealt from whatever (only damages), use this :


Code:
Register PrePlaced Units
  Events
    Game - Time Elasped 0.00 seconds of game-time
  Conditions
  Actions
    Custom Script : set bj_wantDestroyGroup = true
    Unit Group - Pick every units 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)

Code:
Show Damages
    Events
    Conditions
    Actions
        Set loc = (Position of (Triggering unit))
        Floating Text - Create floating text that reads ((String((Integer((Damage taken))))) + !) at loc with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
 
I

IKilledKEnny

Guest
Ok, completely rewrote this works 100% for spells, melee attacks, range attacks etc.
 
I

IKilledKEnny

Guest
That's odd, I uploaded again see if same thing happens.
 

SerraAvenger

Cuz I can
Reaction score
234
you have to change the speed of the floting text to 64* towards north( = 90 degrees).



* use what you want here.

You can change the color of a text by adding these tags:
|caaRRbbGG [yourtext] |r

with
|c = change color
aa= alpha value, set this to max value.
RR=red value. the higher -> the more red is the text
bb=blue value. the higher -> the more blue is the text
GG = green value. the higher -> the more green is the text
|r = reset format. used to change the text to normal font size, color, and so on....

Note that all these values are entered in HEXA-decimal!

Wich means:
axyz = a*16³ + x*16² + y* 16 + z*1
so 1244 = 1*16³ + 2* 16² + 4*16 + 4*1= 4676

Hexa-decimal (short hex) uses additionally a b c d e and f.

a=10
b=11
c=12
d=13
e=14
and f=15
so ff = 15* 16 + 15 =255

ff is the highest number you can enter with two letters, 00 is the smallest.



I think this is all you should know about Hex....

hf with your coloring, Serra ;)
 
I

IKilledKEnny

Guest
> you have to change the speed of the floting text to 64* towards north( = 90 degrees).

Not really, I thought angle of 45 looks better, you can change that if you want to 90.

> Rest of the post

I did color my text using Blizzard's yellow

|cffffcc00I showed the damage here|r
 

Hatebreeder

So many apples
Reaction score
381
> you have to change the speed of the floting text to 64* towards north( = 90 degrees).

Not really, I thought angle of 45 looks better, you can change that if you want to 90.

> Rest of the post

I did color my text using Blizzard's yellow

|cffffcc00I showed the damage here|r

Hey Kenny,
I have a Question about your System.
Is it possible to restrict the Damage Detection whenever you cast a Spell? And if so, could you show me how to do that? I tried 'Starts the Effect of an Abilty' But that doesn't seem to work...
 

cleeezzz

The Undead Ranger.
Reaction score
268
can someone add support for adding damage dealt if they occur within .4 seconds or something?

unit 1 and unit 2 attack unit 3 at the same time. unit 1 and 2 both have 25 damage. Instead of showing 2, 25 floating texts on top of each other, it shows 50.
 
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