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

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
380
> 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.
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air

      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