AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Display Damage with Sprite (https://forums.alliedmods.net/showthread.php?t=326665)

isLie 08-11-2020 01:17

Display Damage with Sprite
 
4 Attachment(s)
Sprite Damage

Greeting, It's my first post, and sorry for my bad English.

GIF : https://imgur.com/a/GK5Q7XB

[Description]
Show Damage but not using HUD anymore, and I add a crit chance into it, if you don't like it then you can turn it off by cvar.
If you know how to use it, it also can display other custom number, I've made a native for it.

[Cvars]
Code:

sprdmg_velo "8.0"                        Spr eject speed
sprdmg_rander "160.0"                        Transparency for spr
sprdmg_gravity "0.04"                        Gravity for spr
sprdmg_expire "15.0"                        How fast will spr disappear
sprdmg_RGB "255 255 255"                Non-crit color
sprdmg_critRGB "255 122 0"                Crit color
sprdmg_critchance "25"                        Crit chance
sprdmg_multiplier "1.5"                        Crit Damage Multiplier
sprdmg_randomRGB "1/0"                        Random Color Switch

[Files]
Code:

sprite_damage.sma
Digit_01 ~ Digit_05.spr
CritDigit_01 ~ CritDigit_05.spr

These sprites is most important thing in this plugin, I made it by AfterEffects,
each digit use a spr, it all inside sprite_damage.rar.

[Edit]
Added HamBot Support. (It may causes double damage display if you are using SyPB or other bots that isn't ZBOT.
Added Random Color Cvar

Download and enjoy.

OciXCrom 08-11-2020 05:59

Re: Display Damage with Sprite
 
Uploading compiled plugins is not allowed. You should remove the .amxx file from the archive.

MayroN 08-11-2020 06:38

Re: Display Damage with Sprite
 
isLie

For myself, I took this option Damaga, because I wanted someone to implement it for a long time - raising the numbers up,moving for the victim,the convenience of settings.

Here is only that specifically not liked,so this Full pack...
But it can be cut out.
It is unclear why the render was registered there...

And sprites were thrown in a heap,and you could do everything in one

You should also add support for bots, so you can at least test them when there is no online service.And so be it..

PHP Code:

new bool:bHamBot false;
public 
client_putinserver(id)    
{
    if(!
bHamBot && is_user_bot(id))    
        {
        
bHamBot true
        set_task
(0.1"Register_HamBot"id)
    }
}

public 
Register_HamBot(id
{
    
RegisterHamFromEntity(Ham_TakeDamageid"fw_TakeDamage")


Thanks !

isLie 08-11-2020 10:53

Re: Display Damage with Sprite
 
Quote:

Originally Posted by OciXCrom (Post 2713831)
Uploading compiled plugins is not allowed. You should remove the .amxx file from the archive.

Thanks for remind me, already remove it.

isLie 08-11-2020 11:17

Re: Display Damage with Sprite
 
Quote:

Originally Posted by MayroN (Post 2713832)
isLie

For myself, I took this option Damaga, because I wanted someone to implement it for a long time - raising the numbers up,moving for the victim,the convenience of settings.

Here is only that specifically not liked,so this Full pack...
But it can be cut out.
It is unclear why the render was registered there...

And sprites were thrown in a heap,and you could do everything in one

You should also add support for bots, so you can at least test them when there is no online service.And so be it..

PHP Code:

new bool:bHamBot false;
public 
client_putinserver(id)    
{
    if(!
bHamBot && is_user_bot(id))    
        {
        
bHamBot true
        set_task
(0.1"Register_HamBot"id)
    }
}

public 
Register_HamBot(id
{
    
RegisterHamFromEntity(Ham_TakeDamageid"fw_TakeDamage")


Thanks !

Sorry that I tested it with SyPB, so I didn't notice that I need to register it for zbot,
I'm not sure what do you mean about merge sprites in one, could you show some example for me please?
Also, what about
Quote:

It is unclear why the render was registered there...
could you explain more about this?
Thanks.

MayroN 08-11-2020 15:18

Re: Display Damage with Sprite
 
isLie
I will write you a personal message in Russian, for you, as I understand your language, Russian.

You won't understand me in English by translator)

Expect)

Midnight Kid 08-19-2020 04:41

Re: Display Damage with Sprite
 
Super. I'll take it.

DJEarthQuake 12-23-2020 04:27

Re: Display Damage with Sprite
 
2 Attachment(s)
One look at video. Amazing!

The packaging and omission of install instructions need attention.
Quote:

FATAL ERROR (shutting down): Mod_NumForName: sprites/P_Reality/Digit_01.spr not found
.
├── addons
│** └── amxmodx
│** └── scripting
│** └── sprite_damage.sma
└── sprites
├── CritDigit_01.spr
├── CritDigit_02.spr
├── CritDigit_03.spr
├── CritDigit_04.spr
├── CritDigit_05.spr
├── Digit_01.spr
├── Digit_02.spr
├── Digit_03.spr
├── Digit_04.spr
└── Digit_05.spr

4 directories, 11 files


Testers shouldn't have to know code to figure out where the sprites go. Quick glance I thought you were renaming them. Script and package with directory and files that crash servers MUST match.

This can be easily maintained to get rid of double images and de-shackle the cstrike-only modification. Why add support for one bot to ruin it for the majority? Please place a CVAR or something so it senses and adjusts. For future references I suggest at 'minimal' undo stuff that makes matters worse.

Code:
/************  *CHANGE LOG*  ************  * 2020-12-23  spinx  * 1.0 to 1.1 - All mod support, fix double image, stop crash, reorganize package. */ #include <amxmodx> #include <amxmisc> . . .     half_life         = get_cvar_pointer("mp_teamplay"); } public plugin_precache() {     for (new i = 0;i < MAX_DIGIT;i++)     {         formatex(damage_spr[i][0], charsmax(damage_spr[][]), "sprites/sprite_damage/Digit_0%d.spr", i + 1)         if( !file_exists(damage_spr[i][0]))         {             server_print("Check the sprite...%s...halting to prevent crash.",damage_spr[i][0]);             pause( "a" );         }         else         precache_model(damage_spr[i][0])         formatex(damage_spr[i][1], charsmax(damage_spr[][]), "sprites/sprite_damage/CritDigit_0%d.spr", i + 1)         if( !file_exists(damage_spr[i][1]))         {             server_print("Check the sprite...%s...halting to prevent crash.",damage_spr[i][1]);             pause( "d" );         }         else         precache_model(damage_spr[i][1])     } } public plugin_natives()     register_native("make_damage_spr", "native_make_damage_spr", 1) public client_putinserver(id) if (cstrike_running() && !bHamBot && is_user_bot(id))     {         bHamBot = true         set_task(0.1, "Register_HamBot", id)     } public Register_HamBot(id)     RegisterHamFromEntity(Ham_TakeDamage, id, "fw_TakeDamage") . . . public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damagebits) . . .     if(cstrike_running() || !cstrike_running() && get_pcvar_num(half_life))     if (get_user_team(attacker) == get_user_team(victim))         return HAM_IGNORED; . . .

Code:
Check the sprite...sprites/sprite_damage/Digit_01.spr...halting to prevent crash. Check the sprite...sprites/sprite_damage/CritDigit_01.spr...halting to prevent crash. Check the sprite...sprites/sprite_damage/Digit_02.spr...halting to prevent crash. Check the sprite...sprites/sprite_damage/CritDigit_02.spr...halting to prevent crash. Check the sprite...sprites/sprite_damage/Digit_03.spr...halting to prevent crash. Check the sprite...sprites/sprite_damage/CritDigit_03.spr...halting to prevent crash. Check the sprite...sprites/sprite_damage/Digit_04.spr...halting to prevent crash. Check the sprite...sprites/sprite_damage/CritDigit_04.spr...halting to prevent crash. Check the sprite...sprites/sprite_damage/Digit_05.spr...halting to prevent crash. Check the sprite...sprites/sprite_damage/CritDigit_05.spr...halting to prevent crash.

Avoid posting multiple versions when 1 with CVAR for random color option will due and make post less convoluted.

If you did the bulk of this like I suspect you have then you should be working in a gaming factory some place.
Quote:

Originally Posted by isLie (Post 2713814)
Sprite Damage
[Edit]
Added HamBot Support. (It may causes double damage display if you are using SyPB or other bots that isn't ZBOT.
Added Random Color Cvar

Looking at what we know you did and stated was adding some bot code that ruins a bunch of stuff that was already working? Once corrected and working regularly, I've never seen anything like it.

Add to OP something like this.

INSTRUCTIONS: Extract sprites to sprites/sprite_damage.

.
├── sprite_damage
│** ├── CritDigit_01.spr
│** ├── CritDigit_02.spr
│** ├── CritDigit_03.spr
│** ├── CritDigit_04.spr
│** ├── CritDigit_05.spr
│** ├── Digit_01.spr
│** ├── Digit_02.spr
│** ├── Digit_03.spr
│** ├── Digit_04.spr
│** └── Digit_05.spr
└── sprite_damage.tar

Hands down best DAMAGE plugin. Thank you.

heliumdream 11-11-2021 16:54

Re: Display Damage with Sprite
 
This is awesome! I would like to extend its functionality.

1) Currently it only shows weapon damage done by yourself; it would be nice if it also displayed weapon damage done by others.

Checking the code out myself, I could use some insight into how that could be accomplished.

2) I'd also like to integrate this into the superhero package, so it can also display damage done by powers. I've already done this using normal display damage methods, but this new Sprite-based method would be even better. Ref: [SH] Superhero Show Damage

Celena Luna 11-11-2021 22:30

Re: Display Damage with Sprite
 
@heliumdream: I don't think it is not impossible but the problem is it might overflow on player when a lot of player shooting 1 player.


All times are GMT -4. The time now is 10:41.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.