Raised This Month: $ Target: $400
 0% 

[L4D & L4D2] Reverse Friendly-Fire [v2.8.5 (07-Oct-2023)]


Post New Thread Reply   
 
Thread Tools Display Modes
TrueDarkness
Junior Member
Join Date: May 2021
Old 05-30-2021 , 12:52   Re: [L4D & L4D2] Reverse Friendly-Fire [v2.7 (27-May-2021)]
Reply With Quote #111

Quote:
Originally Posted by Mystik Spiral View Post
Apparently I forgot to upload the 2.7 source code. Sorry about that, uploaded now.
Bro, found 1 bug, I set the damage multiplier to 0.01. When the damage is below 1, it will become 0, it would be better to make it to be at least 1 hp.

So I edited the script on the part to starting reflect damage to make it works @_@. Please Mystik Spiral make the script so that the damage would at least do 1 damage to self when the total damage is below 1 after the multiplier. Thank you. Love ya, bro.

Code:
					//inflict (non-chainsaw) damage to attacker
					//add 1HP to victim then damage them for 1HP so the displayed message and vocalization order are correct,
					//then damage attacker as self-inflicted for actual damage so there is no vocalization, just pain grunt.
					SetEntityHealth(victim, GetClientHealth(victim) + 1);
					SDKHooks_TakeDamage(victim, inflictor, attacker, 1.0, 0, weapon, g_fDmgFrc, g_fDmgPos);
					if (damage < 1) {
						SDKHooks_TakeDamage(attacker, inflictor, attacker, 1.0, damagetype, weapon, damageForce, damagePosition);
					} else {
						SDKHooks_TakeDamage(attacker, inflictor, attacker, damage, damagetype, weapon, damageForce, damagePosition);
					}
Code:
				//inflict damage to attacker
				if (damage < 1) {
					SDKHooks_TakeDamage(attacker, inflictor, attacker, 1.0, damagetype, weapon, damageForce, damagePosition);
				} else {
					SDKHooks_TakeDamage(attacker, inflictor, victim, damage, damagetype, weapon, damageForce, damagePosition);
				}
				//PrintToServer("%N %T %N", attacker, "Attacked", LANG_SERVER, victim);
				CPrintToChat(attacker, "{orange}[ReverseFF]{lightgreen} %t {olive}%N{lightgreen}, %t.", "YouAttacked", victim, "InfectedFF");
Code:
	//pan0s | end chainsaw fix part 2
	
	//inflict (chainsaw) damage to attacker
	//add 1HP to victim then damage them for 1HP so the displayed message and vocalization order are correct,
	//then damage attacker as self damage so there is no vocalization, just pain grunt.
	SetEntityHealth(victim, GetClientHealth(victim) + 1);
	SDKHooks_TakeDamage(victim, inflictor, attacker, 1.0, 0, weapon, g_fDmgFrc, g_fDmgPos);
	if (damage < 1) {
		SDKHooks_TakeDamage(attacker, inflictor, attacker, 1.0, damagetype, weapon, damageForce, damagePosition);
	} else {
		SDKHooks_TakeDamage(attacker, inflictor, attacker, damage, damagetype, weapon, damageForce, damagePosition);
	}
TrueDarkness is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 05-30-2021 , 21:46   Re: [L4D & L4D2] Reverse Friendly-Fire [v2.7 (27-May-2021)]
Reply With Quote #112

Quote:
Originally Posted by TrueDarkness View Post
Bro, found 1 bug, I set the damage multiplier to 0.01. When the damage is below 1, it will become 0, it would be better to make it to be at least 1 hp.

So I edited the script on the part to starting reflect damage to make it works @_@. Please Mystik Spiral make the script so that the damage would at least do 1 damage to self when the total damage is below 1 after the multiplier. Thank you. Love ya, bro.
@TrueDarkness
I modified this and implemented it quite differently...

Code:
//apply reverseff_dmgmodifer damage modifier
damage *= g_fCvarDamageModifier;
if (g_fCvarDamageModifier > 0.0 && g_fCvarDamageModifier != 1.0 && 0.0 < damage < 1.0)
{
	damage = 1.0;
}
Modified damage value before accumulation (and before inflicting damage to attacker).
Added reverseff_dmgmodinfected, so values can be different for infected and survivors.
Also ensure modifier is min 0 (no reverse damage) and max 2 (double reverse damage).

FYI...your code would have caused a regression when reverseff_dmgmodifier was set to 0 (disable reverse damage) or 1 (do not modify reverse damage).

I'm calling this minor revision 2.7.1. Please test and verify proper behavior. Don't forget to delete the cfg file and let the plugin create a new one.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_reverse_ff.sp - 72 views - 30.5 KB)
__________________

Last edited by Mystik Spiral; 05-31-2021 at 00:28.
Mystik Spiral is offline
pan0s
Senior Member
Join Date: Nov 2017
Old 05-31-2021 , 01:28   Re: [L4D & L4D2] Reverse Friendly-Fire [v2.7 (27-May-2021)]
Reply With Quote #113

Thank for sharing the good plugin.
I'm here to share the
[L4D & L4D2] Reverse Friendly-Fire [v2.7 (27-May-2021)] fork by pan0s
- Added minimum reverse damage.
- Added chances for no reversing damage.
- Added a timer to auto reset chances.
- Added molotov damage message.
- Added chi and zho translations.
- Added counting total damage for reducing announcement message in the chat
- Changed text color for my server style.
Attached Files
File Type: txt l4d2_reverse_ff.phrases.txt (3.3 KB, 46 views)
File Type: sp Get Plugin or Get Source (l4d2_reverse_ff.sp - 86 views - 43.2 KB)

Last edited by pan0s; 05-31-2021 at 03:38.
pan0s is offline
TrueDarkness
Junior Member
Join Date: May 2021
Old 05-31-2021 , 05:01   Re: [L4D & L4D2] Reverse Friendly-Fire [v2.7 (27-May-2021)]
Reply With Quote #114

Quote:
Originally Posted by Mystik Spiral View Post
@TrueDarkness
I modified this and implemented it quite differently...

Code:
//apply reverseff_dmgmodifer damage modifier
damage *= g_fCvarDamageModifier;
if (g_fCvarDamageModifier > 0.0 && g_fCvarDamageModifier != 1.0 && 0.0 < damage < 1.0)
{
	damage = 1.0;
}
Modified damage value before accumulation (and before inflicting damage to attacker).
Added reverseff_dmgmodinfected, so values can be different for infected and survivors.
Also ensure modifier is min 0 (no reverse damage) and max 2 (double reverse damage).

FYI...your code would have caused a regression when reverseff_dmgmodifier was set to 0 (disable reverse damage) or 1 (do not modify reverse damage).

I'm calling this minor revision 2.7.1. Please test and verify proper behavior. Don't forget to delete the cfg file and let the plugin create a new one.
No problem, bro. I am not at coding. Better use your version ofc =)
TrueDarkness is offline
TrueDarkness
Junior Member
Join Date: May 2021
Old 06-01-2021 , 23:15   Re: [L4D & L4D2] Reverse Friendly-Fire [v2.7 (27-May-2021)]
Reply With Quote #115

Quote:
Originally Posted by Mystik Spiral View Post
@TrueDarkness
I modified this and implemented it quite differently...

Code:
//apply reverseff_dmgmodifer damage modifier
damage *= g_fCvarDamageModifier;
if (g_fCvarDamageModifier > 0.0 && g_fCvarDamageModifier != 1.0 && 0.0 < damage < 1.0)
{
	damage = 1.0;
}
Modified damage value before accumulation (and before inflicting damage to attacker).
Added reverseff_dmgmodinfected, so values can be different for infected and survivors.
Also ensure modifier is min 0 (no reverse damage) and max 2 (double reverse damage).

FYI...your code would have caused a regression when reverseff_dmgmodifier was set to 0 (disable reverse damage) or 1 (do not modify reverse damage).

I'm calling this minor revision 2.7.1. Please test and verify proper behavior. Don't forget to delete the cfg file and let the plugin create a new one.
Bro... I don't know what happened to the code. But whatever my setting in the cfg is....

It doesn't reverse or do any damage to self or the victim voice-reacting to the teamkiller. Please check it for me
TrueDarkness is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 06-01-2021 , 23:41   Re: [L4D & L4D2] Reverse Friendly-Fire [v2.7 (27-May-2021)]
Reply With Quote #116

Quote:
Originally Posted by TrueDarkness View Post
Bro... I don't know what happened to the code. But whatever my setting in the cfg is....

It doesn't reverse or do any damage to self or the victim voice-reacting to the teamkiller. Please check it for me
I've been running the 2.7.1 version on my server for a couple of days now and it is working fine for me. If you deleted the l4d_reverse_ff.cfg file then restarted your server, it should have created a new cfg file. If you play as an admin, please check the setting for reverseff_admin... if set to 0 it will not reverse friendly-fire when attacker is an admin (setting to 1 will reverse friendly-fire when attacker is admin). Also, if you are testing against bots, check the setting for reverseff_bot... if set to 0 it will not reverse friendly-fire when victim is a bot (setting to 1 will reverse friendly-fire when victim is a bot).
__________________
Mystik Spiral is offline
TrueDarkness
Junior Member
Join Date: May 2021
Old 06-02-2021 , 03:06   Re: [L4D & L4D2] Reverse Friendly-Fire [v2.7 (27-May-2021)]
Reply With Quote #117

Quote:
Originally Posted by Mystik Spiral View Post
I've been running the 2.7.1 version on my server for a couple of days now and it is working fine for me. If you deleted the l4d_reverse_ff.cfg file then restarted your server, it should have created a new cfg file. If you play as an admin, please check the setting for reverseff_admin... if set to 0 it will not reverse friendly-fire when attacker is an admin (setting to 1 will reverse friendly-fire when attacker is admin). Also, if you are testing against bots, check the setting for reverseff_bot... if set to 0 it will not reverse friendly-fire when victim is a bot (setting to 1 will reverse friendly-fire when victim is a bot).
No problem. I will do more testing tonight =)
TrueDarkness is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 06-05-2021 , 15:39   Re: [L4D & L4D2] Reverse Friendly-Fire [v2.7.1 (05-Jun-2021)]
Reply With Quote #118

New version 2.7.1 released, see original post for download.

05-Jun-2021 v2.7.1
- Add damage modifier ConVar for infected (reverseff_dmgmodinfected) to decrease/increase reversed damage by a percentage.
-- Allows damage modifier to be set separately for infected and survivors.
- Ensure reverseff_dmgmod* ConVars have minimum value of 0 (no damage reverse) and maximum value of 2 (double damage reverse).
- When reverseff_dmgmod* is not 0 (no damage reverse) or 1 (unmodified damage reverse), ensure minimum inflicted damage is 1.
- Add Spanish (es) and Russian (ru) to existing English (en) and French (fr) translations.
__________________

Last edited by Mystik Spiral; 06-05-2021 at 15:41.
Mystik Spiral is offline
Shao
Senior Member
Join Date: Jan 2015
Old 06-23-2021 , 10:10   Re: [L4D & L4D2] Reverse Friendly-Fire [v2.7.1 (05-Jun-2021)]
Reply With Quote #119

Have you been able to find a way around friendly fire caused by hitboxes coming together? (IE Survivors running inside each other or staying within each other.) I really love how far this plugin has come and honestly this feels like the final feature for it as a lot of the time accidents done by players are due to conflicting hitboxes, often out of view.

Last edited by Shao; 06-23-2021 at 10:11.
Shao is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 06-23-2021 , 18:19   Re: [L4D & L4D2] Reverse Friendly-Fire [v2.7.1 (05-Jun-2021)]
Reply With Quote #120

Quote:
Originally Posted by Shao View Post
Have you been able to find a way around friendly fire caused by hitboxes coming together? (IE Survivors running inside each other or staying within each other.) I really love how far this plugin has come and honestly this feels like the final feature for it as a lot of the time accidents done by players are due to conflicting hitboxes, often out of view.
It is on my to-do list, but IRL I've had much less time for coding than before. I will add that feature as soon as time permits.
__________________
Mystik Spiral 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 12:41.


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