Raised This Month: $51 Target: $400
 12% 

Damage displayer 2.0 - working on new version


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Statistical       
Lulu the hero
Senior Member
Join Date: Oct 2009
Location: Budapest, Hungary
Old 08-01-2010 , 17:43   Damage displayer 2.0 - working on new version
Reply With Quote #1

Damage Displayer 2.0

A detailed damage displayer, which displays done and recieved damage around the cursor.

Colors are being displayed around the cursor accordingly:
yellow - friendly fire
red - damage taken - even if source is not aviable
blue - inflicted harm
green - self harm
white - objects, that caused damage( eg. bomb explosion or fire )
purple - unknown damage source
cyan - breakable objects( when attacked )
pink - hostage( when attacked )

Cvars:
- dd_teamdisplay <0|1> - toggle team checking. In all mods it is set to 1 as default, except
sven coop, where it is set to 0. Applied immediately when you change it.

Needed modules:
- AMXModX
- FakeMeta
- HamSandwich

Version history:
2.0 - added display of dealt damage - damage is displayed to breakable objects, hostages etc.
2.0b - combined the damage event with player prethink event, so damage is displayed,
even when not inflicted by damage event( eg. monstermod ),
removed need of cstrike module, and added a cvar "dd_teamdisplay" to toggle team checking
2.0a - restarted project with a new approach
hooked player prethink to check hp in every frame
1.4 - fixed team indication in cstrike
1.3 - removed team coloring to make plugin applyable to mods other then cs
turned back to switches to increase sourcecode's readability
1.22 - removed some variables to reduce resource usage
1.21 - added team specific colors( T = red, CT = blue, OTHER = magenta ) in both harm and damage
1.2 - turned switches into ?: statements and clearing out a few variables this way
1.11 - more optimalization and extracting datas, restructuring if cases, turning them to switches
1.1 - optimazed code, added friendly fire coloring in damage, plus damage HARM non players
1.0 - started project: indicating friendly fire(yellow), normal fire(blue) and damage(red)

Known bugs:
- In mods, where team is changed even while alive(eg. Zombie plague), then the team indication is
buggy(shows friendly fire on an enemy, who was your teammate on roundstart)
temporary fix : set dd_teamdisplay to 0

Future plans:
- Add cvars for positions, colors, and switches to toggle what to display
- Maybe a downfalling animation for the displayed numbers


Tested mods:
Counter strike 1.6
Sven Coop 4.07( metamod-p )
Attached Files
File Type: sma Get Plugin or Get Source (damage_displayer.sma - 1946 views - 9.5 KB)

Last edited by Lulu the hero; 07-20-2016 at 05:57. Reason: removed email address
Lulu the hero is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 08-01-2010 , 21:36   Re: Damage displayer
Reply With Quote #2

There's a certain point where using the conditional operator is going too far, and this is it:

Code:
color = victim_team == attacker_team ? COLOR_ATTACK_TEAMMATE : victim_team == 1 ? COLOR_ATTACK_T : victim_team == 2 ? COLOR_ATTACK_CT : COLOR_ATTACK_OTHER;
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Lulu the hero
Senior Member
Join Date: Oct 2009
Location: Budapest, Hungary
Old 08-01-2010 , 21:42   Re: Damage displayer
Reply With Quote #3

But it's fast, isn't it?

Edit:
Shall I go back to switches?

Last edited by Lulu the hero; 08-01-2010 at 22:21.
Lulu the hero is offline
Old 08-01-2010, 21:58
fysiks
This message has been deleted by fysiks. Reason: nvm, didn't notice all the other things in there.
Lulu the hero
Senior Member
Join Date: Oct 2009
Location: Budapest, Hungary
Old 08-08-2010 , 06:33   Re: Damage displayer
Reply With Quote #4

Ok people. Any ideas on how to display damage recieved from mods, like monster mod? I've tried HamSandwich:
PHP Code:
RegisterHam(Ham_TakeDamage,"player","ham_damage",0);

...

public 
ham_damage(victiminflictorattackerFloat:damagedamage_type){
    
client_print(0,print_chat,"HamDamage | victim: %d, inflictor: %d, attacker: %d, damage: %f",victim,inflictor,attacker,damage);
    return 
HAM_IGNORED;

But this did not show anything new.

I even tried getting the Damage message and hooking that without any success:
PHP Code:
msgid get_user_msgid("Damage");

register_message(msgid,"damage_event"); 
Shall I hook PlayerPreThink to check hp in every frame?( But this way, I still cannot get the inflictor )

Plus I shall hook special entities' damage taking, such as: hostage_entity...
Lulu the hero is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 08-08-2010 , 06:47   Re: Damage displayer
Reply With Quote #5

MonsterMod creates the monsters using 'func_wall' as classname. So just change 'player' to 'func_wall'.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
Lulu the hero
Senior Member
Join Date: Oct 2009
Location: Budapest, Hungary
Old 08-19-2010 , 01:29   Re: Damage displayer
Reply With Quote #6

But if I hook func_wall, then how will I know it is a monster mod monster and not an actual wall? Shall I filter it out by model name( eg. houndeye.mdl ) ?

And again, it will still not help me getting the damage received from non player objects( such as a houndeye from mm. ).

But thanks for the info, it gave me some ideas.

We will end in a display damage on a crate( breakable object ) ^^
Lulu the hero is offline
glhf3000
Member
Join Date: Aug 2010
Location: middle-universe
Old 08-27-2010 , 15:11   Re: Damage displayer
Reply With Quote #7

Have searched for similar plugin for two days! Thanks!
glhf3000 is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 08-27-2010 , 15:19   Re: Damage displayer
Reply With Quote #8

Quote:
Originally Posted by Lulu the hero View Post
But if I hook func_wall, then how will I know it is a monster mod monster and not an actual wall? Shall I filter it out by model name( eg. houndeye.mdl ) ?

And again, it will still not help me getting the damage received from non player objects( such as a houndeye from mm. ).

But thanks for the info, it gave me some ideas.

We will end in a display damage on a crate( breakable object ) ^^
I think you should check pev_takedamage , but im not sure
lazarev is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 08-27-2010 , 15:32   Re: Damage displayer
Reply With Quote #9

Quote:
Originally Posted by Lulu the hero View Post
But if I hook func_wall, then how will I know it is a monster mod monster and not an actual wall? Shall I filter it out by model name( eg. houndeye.mdl ) ?
Check wether MonsterMod sets the FL_MONSTER (hlsdk_const.inc) flag on it's entities. That would be a good way to distinguish walls from monsters. They might also have a certain movetype set.
__________________
In Flames we trust!

Last edited by Nextra; 08-27-2010 at 15:34.
Nextra is offline
Lulu the hero
Senior Member
Join Date: Oct 2009
Location: Budapest, Hungary
Old 08-27-2010 , 23:33   Re: Damage displayer 1.4
Reply With Quote #10

Fixed the team displaying thing in cstrike, so now when you play zombie plague, the teams will be displayed correctly. ( comment a line out in the source if used in different mods )
Lulu the hero is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:58.


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