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: 759

13lade619

is now a game developer :)
Reaction score
398
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 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
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top