PDA

View Full Version : [TF2] How to edit the convar tf_stealth_damage_reduction to only work on dead ringer?


Nursik
07-08-2016, 03:51
^^

Arkarr
07-12-2016, 06:36
You don't. You post the solution, that's how you properly close the thread.

Nursik
07-15-2016, 12:38
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.
#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);
}
}

Arkarr
07-15-2016, 13:45
You don't have to mess with the convar for that.

#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(int victim, int &attacker, int &inflictor, float &damage, int &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))
{
damage *= 0.1; //10% of the actual damage.
return Plugin_Changed;
}

return Plugin_Continue;
}

Nursik
07-15-2016, 13:47
You don't have to mess with the convar for that.

#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(int victim, int &attacker, int &inflictor, float &damage, int &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))
{
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:
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:
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.

Nursik
07-15-2016, 14:25
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.