Page 1 of 2

[CSGO] Floating Damage Numbers

Posted: Wed Aug 08, 2018 11:06 pm
by VinciT
Image
This plugin adds damage numbers / combat text commonly seen in RPG games to your server. The numbers can only be seen by the player who did the damage.
Currently it only works in CS:GO, as that's the only game with the point_worldtext entity. I'm looking into using different methods (env_sprite, point_message) for creating the numbers in other games.
Image

Image ImageImage

How to install:

  1. Install Source.Python.
  2. Download the latest release of Floating Damage Numbers from the bottom of this post or GitHub.
  3. Extract the files into your game server's root folder (../csgo/).
  4. Add sp plugin load fdn to your autoexec file (../csgo/cfg/autoexec.cfg).
  5. Restart your server.
Image
If you find any bugs or have a feature request, don't hesitate to make a post here or on GitHub.


Changelog
v1.2
  • Improved the performance of the SetTransmit hook a bit.
  • Added a way to display damage done through walls.
    Set fdn_wall_bangs to 1 through the server console or the config file (..csgo/cfg/source-python/fdn/) in order to enable this feature.
  • Added a way for other plugins to change the color of the FloatingNumber to yellow.
    Use the AIRBOAT damage type within the OnTakeDamage/OnTakeDamage_Alive hook or the Entity.take_damage() function to force the color change.
Image
v1.1.2
  • Fixed a bug that caused more than one decoy to spawn when calling FloatingNumber.world_damage().
  • Fixed incorrect angles being set for FloatingNumber entities without a decoy.
Image
v1.1
  • Added a way to display damage caused by the world.
    Set fdn_world_damage to 1 through the server console or the config file (..csgo/cfg/source-python/fdn/) in order to enable this feature.
Image
v1.0
  • Initial release of the plugin.


Image
Latest release
fdn_v1.2.zip
(9.4 KiB) Downloaded 561 times

Older releases
fdn_v1.1.2.zip
(8.05 KiB) Downloaded 701 times
fdn_v1.0.zip
(6.29 KiB) Downloaded 1054 times

Re: [CSGO] Floating Damage Numbers

Posted: Thu Aug 09, 2018 12:52 am
by decompile
Awesome Plugin!

Reminds me heavily from fortnite. :)

Re: [CSGO] Floating Damage Numbers

Posted: Thu Aug 09, 2018 3:49 am
by satoon101
Really cool plugin! Very interesting way of going about it. Nice work!

Re: [CSGO] Floating Damage Numbers

Posted: Thu Aug 09, 2018 4:44 pm
by VinciT
Thanks guys!

decompile wrote:Reminds me heavily from fortnite. :)
That's basically why I started working on this. Been playing Fortnite a lot lately.

Re: [CSGO] Floating Damage Numbers

Posted: Sun Aug 12, 2018 12:13 am
by BackRaw
Nice one!

Re: [CSGO] Floating Damage Numbers

Posted: Thu Aug 16, 2018 4:04 am
by Doldol
That actually looks really neat

Re: [CSGO] Floating Damage Numbers

Posted: Tue Apr 14, 2020 7:54 am
by zloykif
Its possible, add showing damage (for all) from envirement\falling damage etc? For deathrun server

Re: [CSGO] Floating Damage Numbers

Posted: Wed Apr 15, 2020 4:51 am
by VinciT
zloykif wrote:Its possible, add showing damage (for all) from envirement\falling damage etc? For deathrun server
Sure thing. I'll try to add it in later today or tomorrow.

Re: [CSGO] Floating Damage Numbers

Posted: Thu Apr 16, 2020 8:38 pm
by zloykif
Did not work out? T_T

Re: [CSGO] Floating Damage Numbers

Posted: Fri Apr 17, 2020 4:22 am
by VinciT
Image

Added a way to create damage numbers for damage caused by the world (falling, drowning).
To enable this feature, load the latest version of the plugin on your server once to first generate the config file.
After doing that, head over to ../csgo/cfg/source-python/fdn/config.cfg and set fdn_world_damage to 1.
Reload the plugin and you should be seeing damage numbers appear when a player takes damage from the world.

zloykif wrote:Did not work out? T_T
Sorry for making you wait. Couldn't decide on how I wanted to implement this for a while.
Download the latest release and give it a shot, tell me if you encounter any bugs.

Re: [CSGO] Floating Damage Numbers

Posted: Fri Apr 17, 2020 6:20 am
by zloykif
Thank you ^_^ I will inform about bugs, first 10 min works fine

Re: [CSGO] Floating Damage Numbers

Posted: Fri Apr 17, 2020 6:37 am
by L'In20Cible
VinciT wrote:tell me if you encounter any bugs.

No bugs, since I didn't test, but here are some suggestions after hovering the code:


VinciT wrote:

Syntax: Select all

OFFSET_DUCK = Vector(0, 0, 54)
OFFSET_STAND = Vector(0, 0, 70)

I would recommend something more dynamic, perhaps:

Syntax: Select all

pl.maxs.z + (10 * pl.model_scale)



VinciT wrote:

Syntax: Select all

if angle:

I generally think this is bad practice and should be explicitly tested against is not None: instead because it can cause unexpected results and remove flexibility (take for example, the builtin logging module that suffers from this).


VinciT wrote:

Syntax: Select all

if 'BOT' in player_a.steamid or player_a.is_fake_client():

Player.is_bot()


VinciT wrote:

Syntax: Select all

# Offset for CBaseCombatCharacter::IsInFieldOfView(const Vector &pos).
IS_IN_FIELD_OF_VIEW_OFFSET = 273 if PLATFORM == 'windows' else 274

Why not make a PR? You could then remove your PlayerFDN class entirely, and updating would be automated by pushing the new offset to SP's repo (assuming the servers that use your plugin have auto_data_update set to True). :smile:


VinciT wrote:

Syntax: Select all

class PlayerFDN(Player):
def __init__(self, index, caching=True):
super().__init__(index, caching)

Could simply be:

Syntax: Select all

class PlayerFDN(Player):
caching = True

Re: [CSGO] Floating Damage Numbers

Posted: Fri Apr 17, 2020 5:23 pm
by VinciT
zloykif wrote:Thank you ^_^ I will inform about bugs, first 10 min works fine
Good! :grin:

L'In20Cible, my man.. I love it when you give me suggestions! I'll update the code later tonight.
L'In20Cible wrote:Why not make a PR? You could then remove your PlayerFDN class entirely, and updating would be automated by pushing the new offset to SP's repo (assuming the servers that use your plugin have auto_data_update set to True). :smile:
Usually I try to do this, but I was trying to add in zloykif's request as soon as possible. Guess I'll go make that pull request now.

Re: [CSGO] Floating Damage Numbers

Posted: Wed Apr 22, 2020 4:51 am
by VinciT
Image

If you're running the plugin with fdn_world_damage set to 1, I suggest you update as soon as possible. There is a small typo in the 1.1 release which might've caused some performance issues (depending on how many players were on the server). And of course as soon as you fix one bug, another one pops up, which led to the fixing of incorrect angles being set for damage numbers created by world damage.

Additionally, most of the suggestions made by L'In20Cible have been implemented, so there's that as well.

Re: [CSGO] Floating Damage Numbers

Posted: Thu Feb 18, 2021 3:26 am
by cs_mcfly
Awesome plugin! Would love to see it hook in to D&D 5e if that would be possible :)

Re: [CSGO] Floating Damage Numbers

Posted: Sat Feb 20, 2021 10:17 pm
by VinciT
cs_mcfly wrote:Awesome plugin! Would love to see it hook in to D&D 5e if that would be possible :)
I'm glad you're enjoying the plugin! What kind of interaction(s) with the D&D 5e plugin are you looking for?

Re: [CSGO] Floating Damage Numbers

Posted: Mon Feb 22, 2021 4:59 am
by PEACE
Hey VinciT ,

Would this or could this work in HL2 by some chance ?

/Peace

Re: [CSGO] Floating Damage Numbers

Posted: Wed Feb 24, 2021 9:50 pm
by cs_mcfly
VinciT wrote:I'm glad you're enjoying the plugin! What kind of interaction(s) with the D&D 5e plugin are you looking for?

I want to see crits and spell damage from D&D in my FDNs :)

Re: [CSGO] Floating Damage Numbers

Posted: Mon Mar 01, 2021 8:37 am
by VinciT
Image
Dying to know if you hit the CT crossing mid? Well, you don't have to anymore. You can enable damage numbers for wall-bangs with the 1.2 update!
Simply set fdn_wall_bangs to 1 through the server console or the config file (..csgo/cfg/source-python/fdn/) and you're good to go.

Image Image

cs_mcfly wrote:I want to see crits and spell damage from D&D in my FDNs :)
I've added a way for other plugins to change the color of damage numbers, although at the moment only a single color is available (yellow) because I'm still unsure if this is the best way to let other plugins change their color.

Due to the way spell damage is handled in D&D 5e, the integration of the plugins has to be done within D&D 5e itself. I'll make a pull request and we'll go from there. :smile:

PEACE wrote:Hey VinciT ,

Would this or could this work in HL2 by some chance ?

/Peace
It should be doable with sprites, but it might be a bit clunky. I'll try it out after I get back from my trip (Saturday).

Re: [CSGO] Floating Damage Numbers

Posted: Thu Mar 11, 2021 6:35 am
by cs_mcfly
Awesome new update! Thanks a lot :)