Raised This Month: $32 Target: $400
 8% 

[L4D1 & L4D2] Laser that never sucks (useful upgrades)


Post New Thread Reply   
 
Thread Tools Display Modes
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 11-06-2022 , 21:48   Re: [L4D1 & L4D2] Laser that never sucks (useful upgrades)
Reply With Quote #61

Quote:
Originally Posted by Dominatez View Post
This no longer works either. Crashes to desktop (L4D1)
It's somehow related to server hardware. I remember when I tested absolutely identical set of plugins and settings on 2 different Linux machines. First one always crashes client applications, Second - never. That's happened on old plugin version with non-SDK activation method.

Quote:
Originally Posted by sonic155 View Post
Please add to the notes that this plugin changes/adds binds to your game without letting you know before hand thank you -.-
It does not, if you have a licensed version of the game.
But, ok.

Updated.
Quote:
1.7.7 (07-Nov-2022)
- Removed binds.
- Fixed compilation warnings on SM 1.11.

1.7.6 (22-Nov-2021)
- Fixed ConVar error in L4D2.

1.7.5 (21-Nov-2021)
- Integration with VIP Core (by R1KO).
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Dominatez
Senior Member
Join Date: Oct 2009
Location: Birmingham, UK
Old 11-07-2022 , 18:46   Re: [L4D1 & L4D2] Laser that never sucks (useful upgrades)
Reply With Quote #62

Firstly - THANK YOU SO MUCH FOR THE AWESOME PLUGINS YOU DO and the help you give on here.

I am running the server on a ubuntu 20.04LTS server and the server doesn't crash at all, it is my client. It always crashes me to desktop when it changes map when the laser is on. Every single time. I have tried and tested it, but cannot get it working. Even on a vanilla server, it crashes me to desktop every time (Windows 10 for Gaming, Ubuntu for all other chores) and (L4D1)

I wonder why it is just the laser that is causing massive headaches for everyone. The plugin works great if i remove the code with the laser in it.

Do you have any ideas as to how to get the laser to function ?


Quote:
Originally Posted by Dragokas View Post
It's somehow related to server hardware. I remember when I tested absolutely identical set of plugins and settings on 2 different Linux machines. First one always crashes client applications, Second - never. That's happened on old plugin version with non-SDK activation method.



It does not, if you have a licensed version of the game.
But, ok.

Updated.
Dominatez is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 11-07-2022 , 20:11   Re: [L4D1 & L4D2] Laser that never sucks (useful upgrades)
Reply With Quote #63

Yeah, I know that it's client crashes, which is even more complicates things, because not much ways to fix.
Unfortunately I don't have any recommendations other than try changing the server, it's somehow help the fix client.
Maybe also try to play with different network settings (e.g. different tick and so) on server and video settings on client.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Sunyata
Senior Member
Join Date: Nov 2017
Location: Wherever I am
Old 02-07-2023 , 12:08   Re: [L4D1 & L4D2] Laser that never sucks (useful upgrades)
Reply With Quote #64

Just a quick question: is there any way to disable the perks upgrade sound?

I'm referring to the "orch_hit_Csharp_short.wav" at this folder location:

"STEAM\steamapps\common\left 4 dead\left4dead\sound\player"

This is the sound file players get to hear at the start of each new map.

I'd like to disable this sound for all the clients. Im not sure what is involved to do this. Does it involve commenting out one of the cryptic lines of code in the script? Or would it involve another script to disable the above sound file?

Sunyata

Last edited by Sunyata; 02-07-2023 at 12:11.
Sunyata is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 02-07-2023 , 12:24   Re: [L4D1 & L4D2] Laser that never sucks (useful upgrades)
Reply With Quote #65

If you know the exact sound name, you may block the sound by hook,
see: Silver's tuto, item 7. Sound Hooks

As about perk sound, as far as I can remember, it is a call located in the one of the perk activation functions, it can be disabled by NOP-ing it (patch the memory).
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 02-07-2023 , 12:25   Re: [L4D1 & L4D2] Laser that never sucks (useful upgrades)
Reply With Quote #66

Here it is:
Code:
char *__cdecl CTerrorPlayer::AddUpgrade(CBaseEntity *a1, int a2)
{
...
      UTIL_SayTextAll(CTerrorPlayer::AddUpgrade(SurvivorUpgradeType)::msg, 0, 0);
      CCSPlayer::EmitPrivateSound(a1, "Player.AwardUpgrade");
      v9 = (KeyValues *)KeyValues::operator new((KeyValues *)&dword_24);
...
}
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 02-07-2023 , 14:23   Re: [L4D1 & L4D2] Laser that never sucks (useful upgrades)
Reply With Quote #67

Ahh, I already patched that call.

The fact is Left 4 Dead 2 emit 3 sounds for upgrade:
1) The short loud low one (which I already patched above).
2) The continuous quiet high (which I don't know where is located, maybe in gameeventmanager).
3) sometimes 3rd sound related to game hint instructor (together with on screen hint).

Unless, somebody know where the call is located exactly here, I don't have time for that kind of experiments, sorry.

disassembly
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 02-07-2023 at 14:23.
Dragokas is offline
Sunyata
Senior Member
Join Date: Nov 2017
Location: Wherever I am
Old 02-08-2023 , 04:51   Re: [L4D1 & L4D2] Laser that never sucks (useful upgrades)
Reply With Quote #68

Hi Dragokas,

Thanks for the quick replies. Your pointers were extremely helpful, although the part about the signatures is way over my head.

Thanks for your link to Silvers' thread on the sound hooks. That works perfectly at omitting the sound file for the game.

Here's my script for the sound file location:

Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "1.3"

public Plugin myinfo = 
{
	name = "Remove l4d1 upgrade sound effect",
	author = "Silvers + edit by sunyata",
	description = "Remove l4d1 upgrade sound effect on map start",
	version = PLUGIN_VERSION,
	url = "https://forums.alliedmods.net/showpost.php?p=2798977&postcount=65"
};

public void OnPluginStart()
{
    AddNormalSoundHook(SoundHook);
    AddAmbientSoundHook(AmbientHook);
}

public void OnPluginEnd()
{
    RemoveNormalSoundHook(SoundHook);
    RemoveAmbientSoundHook(AmbientHook);
}

Action SoundHook(int clients[MAXPLAYERS], int &numClients, char sample[PLATFORM_MAX_PATH], int &entity, int &channel, float &volume, int &level, int &pitch, int &flags, char soundEntry[PLATFORM_MAX_PATH], int &seed)
{
    if( strcmp(sample, "player/orch_hit_Csharp_short.wav") == 0 )
    {
        return Plugin_Handled;
    }

    return Plugin_Continue;
}

Action AmbientHook(char sample[PLATFORM_MAX_PATH], int &entity, float &volume, int &level, int &pitch, float pos[3], int &flags, float &delay)
{
    if( strcmp(sample, "player/orch_hit_Csharp_short.wav") == 0 )
    {
        return Plugin_Handled;
    }

    return Plugin_Continue;
}
I'm grateful for your input Dragokas, and also to Silvers for making the generic sound hook script.

Cheers,

Sunyata
Attached Files
File Type: sp Get Plugin or Get Source (DisableUpgradeSound.sp - 93 views - 1.3 KB)

Last edited by Sunyata; 02-10-2023 at 04:29. Reason: attached also plugin script
Sunyata is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 02-08-2023 , 07:09   Re: [L4D1 & L4D2] Laser that never sucks (useful upgrades)
Reply With Quote #69

Sunyata, isn't my plugin blocking this sound as it (it should), or you're using other plugin?
I don't have this sound played using the patch integrated in plugin.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Sunyata
Senior Member
Join Date: Nov 2017
Location: Wherever I am
Old 02-08-2023 , 07:31   Re: [L4D1 & L4D2] Laser that never sucks (useful upgrades)
Reply With Quote #70

I used to have the old version of your plugin, where I was using two perks: the night vision and faster weapon reload speed. However, recently I was trying to find another simple plugin to add a larger 50% weapon mag/clip upgrade to my server. After some enquiries, another coder asked me what perks plugin I was already using. I told him it was yours. He then took a copy of your current script and made a minor amendment to it by adding one line of code to include the larger mag-clip size.

Since this small change got added to the script the upgrade sound effect got re-enabled on my server.


PS: btw, it was the latest version of your plugin being used on my server and not the old version.

Last edited by Sunyata; 02-10-2023 at 05:57. Reason: Code snippet redacted and PS added
Sunyata 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 00:24.


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