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

[TF2] Healing a scout changes speed.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-21-2016 , 01:10   [TF2] Healing a scout changes speed.
Reply With Quote #1

How is this possible?
Nursik is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 07-21-2016 , 02:52   Re: [TF2] Healing a scout changes speed.
Reply With Quote #2

look at how vsh/ff2 does it.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-21-2016 , 17:44   Re: [TF2] Healing a scout changes speed.
Reply With Quote #3

Quote:
Originally Posted by Nursik View Post
How is this possible?
Quote:
Originally Posted by friagram View Post
look at how vsh/ff2 does it.
...if you mean the speed of the Medic, the Meet Your Match update made that standard for all Mediguns.

...so now the hard part is turning it off.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-21-2016 at 17:45.
Powerlord is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-21-2016 , 23:00   Re: [TF2] Healing a scout changes speed.
Reply With Quote #4

Quote:
Originally Posted by Powerlord View Post
...if you mean the speed of the Medic, the Meet Your Match update made that standard for all Mediguns.

...so now the hard part is turning it off.
That's very hard for me, since i only know some functions and i found a VSH line with adding speed boost, but i changed everything in that code and it's not working. If you could take some time and write a little code, i'll appreciate it.
Nursik is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 07-22-2016 , 09:09   Re: [TF2] Healing a scout changes speed.
Reply With Quote #5

Quote:
Originally Posted by Powerlord View Post
...if you mean the speed of the Medic, the Meet Your Match update made that standard for all Mediguns.

...so now the hard part is turning it off.
they should just add attributes so we can edit, but nope.
same shit with the stupid scout shove on the shortstop... I mean, wtf were they thinking?
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-22-2016 , 16:04   Re: [TF2] Healing a scout changes speed.
Reply With Quote #6

This is why i'm using these scripts, because they either don't have the attributes or the attributes were changed.
Nursik is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 07-23-2016 , 03:30   Re: [TF2] Healing a scout changes speed.
Reply With Quote #7

Had to disable the speed boost for stop that tank. Here's what I know for those interested.

The relevant part of code is in: TeamFortress_CalculateMaxSpeed. It checks to see if you're a medic and that your active weapon is a medigun. Then it validates m_hHealingTarget on the medigun and then calls itself to get the target's speed.

If you want to disable it for everyone, a simple memory patch will suffice. The healing speed boost is not client predicted so the client won't notice a thing. If you want to disable it for certain players, I think you have to detour the function. Shimming the player's speed with attributes won't work because the above function will choose the greater speed of the heal target. See the github for an example. Unfortunately, I don't see a better way. An attribute to toggle this functionality as suggested would be ideal but I fear the TF team is too busy putting out fires.

An easy but messy way: You could manually override m_flMaxspeed on the medic while healing. You'd have write your own speed calculation code that takes into account the movement attributes and other game conditions . I'm not sure how well this will look as the game will be continuously changing m_flMaxspeed while the player is healing (set in PostThink?). I haven't gone down that road.
__________________

Last edited by pheadxdll; 07-23-2016 at 03:49.
pheadxdll is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 07-23-2016 , 05:04   Re: [TF2] Healing a scout changes speed.
Reply With Quote #8

Quote:
Originally Posted by pheadxdll View Post
Had to disable the speed boost for stop that tank. Here's what I know for those interested.

The relevant part of code is in: TeamFortress_CalculateMaxSpeed. It checks to see if you're a medic and that your active weapon is a medigun. Then it validates m_hHealingTarget on the medigun and then calls itself to get the target's speed.

If you want to disable it for everyone, a simple memory patch will suffice. The healing speed boost is not client predicted so the client won't notice a thing. If you want to disable it for certain players, I think you have to detour the function. Shimming the player's speed with attributes won't work because the above function will choose the greater speed of the heal target. See the github for an example. Unfortunately, I don't see a better way. An attribute to toggle this functionality as suggested would be ideal but I fear the TF team is too busy putting out fires.

An easy but messy way: You could manually override m_flMaxspeed on the medic while healing. You'd have write your own speed calculation code that takes into account the movement attributes and other game conditions . I'm not sure how well this will look as the game will be continuously changing m_flMaxspeed while the player is healing (set in PostThink?). I haven't gone down that road.
Too busy porting community content for the next shameless moneygrab patch.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-24-2016 , 14:01   Re: [TF2] Healing a scout changes speed.
Reply With Quote #9

Quote:
Originally Posted by friagram View Post
Too busy porting community content for the next shameless moneygrab patch.
Ok, i'll try.

Last edited by Nursik; 07-24-2016 at 14:02.
Nursik is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-28-2016 , 14:36   Re: [TF2] Healing a scout changes speed.
Reply With Quote #10

Quote:
Originally Posted by pheadxdll View Post
Had to disable the speed boost for stop that tank. Here's what I know for those interested.

The relevant part of code is in: TeamFortress_CalculateMaxSpeed. It checks to see if you're a medic and that your active weapon is a medigun. Then it validates m_hHealingTarget on the medigun and then calls itself to get the target's speed.

If you want to disable it for everyone, a simple memory patch will suffice. The healing speed boost is not client predicted so the client won't notice a thing. If you want to disable it for certain players, I think you have to detour the function. Shimming the player's speed with attributes won't work because the above function will choose the greater speed of the heal target. See the github for an example. Unfortunately, I don't see a better way. An attribute to toggle this functionality as suggested would be ideal but I fear the TF team is too busy putting out fires.

An easy but messy way: You could manually override m_flMaxspeed on the medic while healing. You'd have write your own speed calculation code that takes into account the movement attributes and other game conditions . I'm not sure how well this will look as the game will be continuously changing m_flMaxspeed while the player is healing (set in PostThink?). I haven't gone down that road.
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <tf2attributes>
#include <tf2_stocks>

public Plugin myinfo =
{
    
name "Pre-Meet Your Match Mediguns"
    
author "Nursik"
    
description "Reverts every medigun, but quickfix change"
    
version "1.0"
    
url "http://www.teamfortress.com" 
};

public 
Action:ClientTimer(Handle:hTimer)
{
    new 
client 1;
    new 
index GetIndexOfWeaponSlot(clientTFWeaponSlot_Secondary);
    if (
index == 29)
    {
        new 
healtarget GetHealingTarget(client);
        if (
IsValidClient(healtarget) && TF2_GetPlayerClass(healtarget) == TFClass_Scout)
        {
            
TF2Attrib_SetByName(client"move speed bonus"0.8);
        }
    }
    return 
Plugin_Continue;
}

stock GetHealingTarget(client)
{
    new 
String:s[64];
    new 
medigun GetPlayerWeaponSlot(clientTFWeaponSlot_Secondary);
    if (
medigun <= MaxClients || !IsValidEdict(medigun))
        return -
1;
    
GetEdictClassname(medigunssizeof(s));
    if (
strcmp(s"tf_weapon_medigun"false) == 0)
    {
        if (
GetEntProp(medigunProp_Send"m_bHealing"))
        return 
GetEntPropEnt(medigunProp_Send"m_hHealingTarget");
    }
    return -
1;
}

stock bool:IsValidClient(clientbool:replaycheck true)
{
    if (
client <= || client MaxClients) return false;
    if (!
IsClientInGame(client)) return false;
    if (
GetEntProp(clientProp_Send"m_bIsCoaching")) return false;
    if (
replaycheck)
    {
        if (
IsClientSourceTV(client) || IsClientReplay(client)) return false;
    }
    return 
true;
}

stock bool:IsValidClient(clientbool:replaycheck true)
{
    if (
client <= || client MaxClients) return false;
    if (!
IsClientInGame(client)) return false;
    if (
GetEntProp(clientProp_Send"m_bIsCoaching")) return false;
    if (
replaycheck)
    {
        if (
IsClientSourceTV(client) || IsClientReplay(client)) return false;
    }
    return 
true;

I got some code from VSH and made what you told me, but it doesn't work. :/

Last edited by Nursik; 07-28-2016 at 14:39.
Nursik is offline
Reply


Thread Tools
Display Modes

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:25.


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