Raised This Month: $28 Target: $400
 7% 

Solved [L4D2] Tank Water Slowdown


Post New Thread Reply   
 
Thread Tools Display Modes
101
Senior Member
Join Date: Nov 2023
Old 07-21-2024 , 08:02   Re: [L4D2] Tank Water Slowdown
Reply With Quote #11

This may help to improve performance :
To Disable shake screen and foot steps effects while tanks in water
PHP Code:
//disable foot steps since tank is floating and not walking
public OnPluginStart()
{
    
HookUserMessage(GetUserMessageId("Shake"), MsgHooktrue);
}

public 
Action MsgHook(UserMsg msg_idBfRead msg, const int[] playersint playersNumbool reliablebool init)
{
    if (
playersNum == && (GetEntProp(players[0], Prop_Send"m_nWaterLevel")) ) // block msg if survivor is in water 
    
{
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;

But speed of swimming tanks still needs to be optimized
101 is offline
Polyano
Member
Join Date: Jun 2024
Old 07-21-2024 , 11:22   Re: [L4D2] Tank Water Slowdown
Reply With Quote #12

Quote:
Originally Posted by 101 View Post
If the problem of tanks was not solved then check the harrypotter's one .And the errors that you see were due to *.inc file that you are missing in include folder .
HTH
I copied all .inc stuffs in the SirPlease's /scripting/include folder into my folder but still, the same error message was there.

But it's ok, your third code worked wonderfully in my quick short test. Test was done in Swamp Fever (c3m2_swamp). Bye Tank, you can't catch and mega-slap me anymore in the water (if something didn't mess with my movement). It was a straight line test, I avoided going left and right (so that chance you get hit by tank get reduced, just like on a normal ground).

I'm satisfied enough with the result, some issues might happens in other test. And thank you for making a plugin that saves L4D2 community from Tank total domination lol. I hope someone with more modding experience would try to improve this and make a dedicated page for this plugin.

How do I mark this thread as solved btw?

Edit: Nevermind found the select Solved button

Last edited by Polyano; 07-21-2024 at 11:34. Reason: Tag as solved
Polyano is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 07-21-2024 , 13:20   Re: [L4D2] Tank Water Slowdown
Reply With Quote #13

Quote:
Originally Posted by 101 View Post
If the problem of tanks was not solved then check the harrypotter's one .And the errors that you see were due to *.inc file that you are missing in include folder .
HTH
I won't do it, I just provide the way to change speed when in water.

Left 4 DHooks Direct API

PHP Code:
public Action L4D_OnGetRunTopSpeed(int clientfloat &retVal)
{
    if (!
IsClientInGame(client)) { 
        return 
Plugin_Continue;
    }
    
    if (~
GetEntityFlags(client) & FL_INWATER) {
        return 
Plugin_Continue;
    }

    
//Do something here

    
retVal xxxx;
    return 
Plugin_Handled;


__________________
HarryPotter 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