[CSGO] Floating Damage Numbers

Release your plugins here!
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

[CSGO] Floating Damage Numbers

Postby VinciT » Wed Aug 08, 2018 11:06 pm

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 562 times

Older releases
fdn_v1.1.2.zip
(8.05 KiB) Downloaded 703 times
fdn_v1.0.zip
(6.29 KiB) Downloaded 1055 times
Last edited by VinciT on Mon Mar 01, 2021 8:36 am, edited 3 times in total.
ImageImageImageImageImage
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: [CSGO] Floating Damage Numbers

Postby decompile » Thu Aug 09, 2018 12:52 am

Awesome Plugin!

Reminds me heavily from fortnite. :)
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: [CSGO] Floating Damage Numbers

Postby satoon101 » Thu Aug 09, 2018 3:49 am

Really cool plugin! Very interesting way of going about it. Nice work!
Image
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [CSGO] Floating Damage Numbers

Postby VinciT » Thu Aug 09, 2018 4:44 pm

Thanks guys!

decompile wrote:Reminds me heavily from fortnite. :)
That's basically why I started working on this. Been playing Fortnite a lot lately.
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Re: [CSGO] Floating Damage Numbers

Postby BackRaw » Sun Aug 12, 2018 12:13 am

Nice one!
User avatar
Doldol
Senior Member
Posts: 200
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Re: [CSGO] Floating Damage Numbers

Postby Doldol » Thu Aug 16, 2018 4:04 am

That actually looks really neat
User avatar
zloykif
Junior Member
Posts: 3
Joined: Tue Aug 14, 2012 5:09 am

Re: [CSGO] Floating Damage Numbers

Postby zloykif » Tue Apr 14, 2020 7:54 am

Its possible, add showing damage (for all) from envirement\falling damage etc? For deathrun server
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [CSGO] Floating Damage Numbers

Postby VinciT » Wed Apr 15, 2020 4:51 am

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.
ImageImageImageImageImage
User avatar
zloykif
Junior Member
Posts: 3
Joined: Tue Aug 14, 2012 5:09 am

Re: [CSGO] Floating Damage Numbers

Postby zloykif » Thu Apr 16, 2020 8:38 pm

Did not work out? T_T
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [CSGO] Floating Damage Numbers

Postby VinciT » Fri Apr 17, 2020 4:22 am

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.
ImageImageImageImageImage
User avatar
zloykif
Junior Member
Posts: 3
Joined: Tue Aug 14, 2012 5:09 am

Re: [CSGO] Floating Damage Numbers

Postby zloykif » Fri Apr 17, 2020 6:20 am

Thank you ^_^ I will inform about bugs, first 10 min works fine
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [CSGO] Floating Damage Numbers

Postby L'In20Cible » Fri Apr 17, 2020 6:37 am

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
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [CSGO] Floating Damage Numbers

Postby VinciT » Fri Apr 17, 2020 5:23 pm

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.
ImageImageImageImageImage
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [CSGO] Floating Damage Numbers

Postby VinciT » Wed Apr 22, 2020 4:51 am

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.
ImageImageImageImageImage
cs_mcfly
Junior Member
Posts: 5
Joined: Fri Feb 12, 2021 6:57 am

Re: [CSGO] Floating Damage Numbers

Postby cs_mcfly » Thu Feb 18, 2021 3:26 am

Awesome plugin! Would love to see it hook in to D&D 5e if that would be possible :)
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [CSGO] Floating Damage Numbers

Postby VinciT » Sat Feb 20, 2021 10:17 pm

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?
ImageImageImageImageImage
User avatar
PEACE
Member
Posts: 50
Joined: Mon Oct 12, 2020 1:13 pm

Re: [CSGO] Floating Damage Numbers

Postby PEACE » Mon Feb 22, 2021 4:59 am

Hey VinciT ,

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

/Peace
cs_mcfly
Junior Member
Posts: 5
Joined: Fri Feb 12, 2021 6:57 am

Re: [CSGO] Floating Damage Numbers

Postby cs_mcfly » Wed Feb 24, 2021 9:50 pm

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 :)
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [CSGO] Floating Damage Numbers

Postby VinciT » Mon Mar 01, 2021 8:37 am

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).
ImageImageImageImageImage
cs_mcfly
Junior Member
Posts: 5
Joined: Fri Feb 12, 2021 6:57 am

Re: [CSGO] Floating Damage Numbers

Postby cs_mcfly » Thu Mar 11, 2021 6:35 am

Awesome new update! Thanks a lot :)

Return to “Plugin Releases”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 20 guests