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

[TF2] How to edit the convar tf_stealth_damage_reduction to only work on dead ringer?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-08-2016 , 03:51   [TF2] How to edit the convar tf_stealth_damage_reduction to only work on dead ringer?
Reply With Quote #1

^^

Last edited by Nursik; 07-15-2016 at 10:39.
Nursik is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 07-12-2016 , 06:36   Re: While Spy-Cicle is active the spy becomes fireproof for 3 seconds
Reply With Quote #2

You don't. You post the solution, that's how you properly close the thread.
__________________
Want to check my plugins ?
Arkarr is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-15-2016 , 12:38   Re: [TF2] How to edit the convar tf_stealth_damage_reduction to only work on dead rin
Reply With Quote #3

Quote:
Originally Posted by Arkarr View Post
You don't. You post the solution, that's how you properly close the thread.
now please help. Here's what i tried, but it gives errors, that i can't seem to fix.
Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2_stocks>

public Plugin myinfo = 
{ 
	name = "Pre-Gun Mettle Dead Ringer", 
	author = "Nursik", 
	description = "Makes dead ringer giga times more useful", 
	version = "1.0", 
	url = "www.teamfortress.com" 
}; 

public void OnClientPostAdminCheck(int client)
{
	SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage); 
}

public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
	if(!(1 <= attacker <= MaxClients))
		return Plugin_Continue;
	if(!(1 <= victim <= MaxClients))
		return Plugin_Continue;
	if(TF2_IsPlayerInCondition(victim, TFCond_Cloaked) && TF2_IsPlayerInCondition(victim, TFCond_DeadRingered))
	{
		SendConVarValue(victim, tf_stealth_damage_reduction, 0.1);
	}
}

Last edited by Nursik; 07-15-2016 at 12:42.
Nursik is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 07-15-2016 , 13:45   Re: [TF2] How to edit the convar tf_stealth_damage_reduction to only work on dead rin
Reply With Quote #4

You don't have to mess with the convar for that.
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2_stocks>

public Plugin myinfo 

    
name "Pre-Gun Mettle Dead Ringer"
    
author "Nursik"
    
description "Makes dead ringer giga times more useful"
    
version "1.0"
    
url "www.teamfortress.com" 
}; 

public 
void OnClientPostAdminCheck(int client)
{
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage); 
}

public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype)
{
    if(!(
<= attacker <= MaxClients))
        return 
Plugin_Continue;
    if(!(
<= victim <= MaxClients))
        return 
Plugin_Continue;
    if(
TF2_IsPlayerInCondition(victimTFCond_Cloaked) && TF2_IsPlayerInCondition(victimTFCond_DeadRingered))
    {
        
damage *= 0.1//10% of the actual damage.
        
return Plugin_Changed;
    }

        return 
Plugin_Continue;

__________________
Want to check my plugins ?

Last edited by Arkarr; 07-15-2016 at 13:46.
Arkarr is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-15-2016 , 13:47   Re: [TF2] How to edit the convar tf_stealth_damage_reduction to only work on dead rin
Reply With Quote #5

Quote:
Originally Posted by Arkarr View Post
You don't have to mess with the convar for that.
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2_stocks>

public Plugin myinfo 

    
name "Pre-Gun Mettle Dead Ringer"
    
author "Nursik"
    
description "Makes dead ringer giga times more useful"
    
version "1.0"
    
url "www.teamfortress.com" 
}; 

public 
void OnClientPostAdminCheck(int client)
{
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage); 
}

public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype)
{
    if(!(
<= attacker <= MaxClients))
        return 
Plugin_Continue;
    if(!(
<= victim <= MaxClients))
        return 
Plugin_Continue;
    if(
TF2_IsPlayerInCondition(victimTFCond_Cloaked) && TF2_IsPlayerInCondition(victimTFCond_DeadRingered))
    {
        
damage *= 0.1//10% of the actual damage.
        
return Plugin_Changed;
    }

return 
Plugin_Continue;

Yes, but this doesn't work after the "deadringered" condition wears off. I need to make it so it will resist damage even after the conditon wears off.
That's from the previous thread that you didn't read:
Quote:
Originally Posted by Nursik View Post
Please help me, i don't need help with that movement detection in this thread anymore. The question about movement detection is for soda popper.
I just looked at some ff2 forum and found this:
Quote:
Originally Posted by Starblaster64 View Post
Just want to quickly point out that, after some in-game tests Dead Ringer damage reduction doesn't scale over time, it scales depending on how full your cloak meter is, so unless you want Spies to start taking more damage after their cloak drops 50%, I'd suggest coming up with a different method of damage reduction
EDIT: Nvm, i found more convars and combining with previous ones it worked. Now could someone help me edit the tf_feign_death_speed_duration convar? It makes spy not visible if you bump into someone too, how do i remove speed boost or just change speed? Also, how do i make tf_stealth_damage reduction not apply to all cloaks, except the dead ringer? The tf_feign_death_duration cvar doesn't even work.

Last edited by Nursik; 07-15-2016 at 13:52.
Nursik is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-15-2016 , 14:25   Re: [TF2] How to edit the convar tf_stealth_damage_reduction to only work on dead rin
Reply With Quote #6

Finally i think i found the way. Solution: mess with convars:
tf_feign_death_active_damage_scale
tf_feign_death_damage_scale
tf_stealth_damage_scale
tf_feign_death_duration
tf_feign_death_speed_duration.
Nursik 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 14:53.


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