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

[L4D2] Dynamic Soundtrack Sets


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Plugin ID:
7168
Plugin Version:
1.5.4 - Legacy
Plugin Category:
Fun Stuff
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    1 
    Plugin Description:
    Alters soundtrack music like the 'incapacitation' tune to suit the player's survivor set.
    Old 06-20-2020 , 05:22   [L4D2] Dynamic Soundtrack Sets
    Reply With Quote #1

    This was originally made by DeathChaos25

    I do not completely own the plugin, but I have edited it to a better state.


    -= Original video from DeathChaos25 =-




    -= How this plugin works =-

    - When loaded, it hooks onto the appropriate events where music is bound to happen, and a few others to stop the music.
    - With the use of the gamedata's Music::Play and Music::StopPlaying signatures, it cancels the original music and plays the survivor-set-appropriate music.



    -= Bugs =-

    - The random inconsistencies of client-server communication and the unconventional method of this plugin can mean replacing the music may not always be 100%.


    -= Credits: =-

    BRU7US - Revitalizing the idea of playing music after a frame.
    Edison1318 - Finding out how to use the first int variable for PlayMusic, which is used for determining which client the music should play from.
    cravenge - Better DHooks version.


    -= Releases (Legacy Version by Shadowysn) =-
    Code:
    Version 1.5.4
    - Music now instantly stops instead of fading away when a survivor dies, which would've allowed the default music 1 second to play.
    Version 1.5.3
    - Fixed issue where Hit music was being played at 0 0 0 instead of on the affected client. Thanks to Edison for notifying in steam chat.
    Version 1.5.1
    - Most instances where music is stopped now fades them out like in the base game.
    Version 1.5.0
    - Fixed issue where music of both sets were being played on L4D1 survivors, caused by accidental misuse of switch statements.
    - Certain music (saferoom, finale, etc.) are now played after a frame to ensure they work.
    Version 1.3.5
    - Used EventHookMode_Post event hooks instead of Pre hooks.
    Version 1.3.4
    - Further bug-fixes.
    Version 1.3.2
    - Attempt to fix map transition and mission lost music.
    Version 1.3.0
    - Used signatures instead of music_dynamic_play and music_dynamic_stop_playing commands which don't work for Dedicated Servers.
    Version 1.2.5 (Dynamic_Soundtrack_Local)
    - Initial release.
    There is a version by Cravenge available using DHooks that is more functional.
    If you have SM 1.11, I HIGHLY RECOMMEND you to download this version.

    Click here for Cravenge's plugin

    -= How to Install cravenge's version =-

    - (REQUIRED) DHooks Detour (which already comes with SM 1.11) and, if possible, Left 4 DHooks.
    - (OPTIONAL) Move the .txt file to your gamedata folder inside the Sourcemod directory. The plugin, by itself, will auto-generate the gamedata needed if it doesn't find one, hence this being optional.
    - Download the compiled .smx file (don't click Get Plugin!) to your plugins folder inside the Sourcemod directory.
    IF YOU HAVE AN OLDER GAMEDATA .txt FILE, YOU MUST EITHER DELETE AND LET THE NEW PLUGIN AUTO-GENERATE OR REPLACE IT WITH A NEW ONE!


    If you face problems with installing DHooks or cravenge's version, you can download the lightweight, no-extension plugin instead.

    -= How to Install =-

    - (OPTIONAL) Move the .txt file to your gamedata folder inside the Sourcemod directory. The plugin, by itself, will auto-generate the gamedata needed if it doesn't find one, hence this being optional.
    - Click on Get Plugin and move the compiled .smx file to your plugins folder inside the Sourcemod directory.
    IF YOU HAVE AN OLDER GAMEDATA .txt FILE, YOU MUST EITHER DELETE AND LET THE NEW PLUGIN AUTO-GENERATE OR REPLACE IT WITH A NEW ONE!
    Attached Files
    File Type: sp Get Plugin or Get Source (Dynamic_Soundtrack.sp - 280 views - 22.4 KB)
    File Type: txt dynamic_soundtrack.txt (629 Bytes, 175 views)
    __________________
    ragdoll spam, that is all

    Steam profile, where I game, obviously.
    Youtube channel, where I do Stick Death Maze animations and some other stuff.
    no plugin requests, sorry


    My Plugins:
    -search list-
    Modified Plugins:
    1 | 2 | 3 | 4

    Last edited by Shadowysn; 10-13-2022 at 00:31. Reason: Set version to 1.5.4 Legacy. Updated half of gamedata for less chance of breaking on game updates.
    Shadowysn is offline
    Sev
    Veteran Member
    Join Date: May 2010
    Old 06-20-2020 , 05:42   Re: [L4D2] Dynamic Soundtrack Sets
    Reply With Quote #2

    Looks neat. Something like this is always a real quality of life change.

    Failed to compile.

    Also this on a 1.10 compile.

    Code:
    plugin.sp(59) : error 017: undefined symbol "version_cvar"
    plugin.sp(60) : error 017: undefined symbol "version_cvar"
    plugin.sp(60) : error 148: cannot assign null to a non-nullable type
    plugin.sp(61) : error 017: undefined symbol "version_cvar"
    
    4 Errors.

    Last edited by Sev; 06-20-2020 at 05:45.
    Sev is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 06-20-2020 , 05:53   Re: [L4D2] Dynamic Soundtrack Sets
    Reply With Quote #3

    Nice besure to mention it only works on local servers for the host.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    Shadowysn
    Senior Member
    Join Date: Sep 2015
    Location: Location:
    Old 06-20-2020 , 06:37   Re: [L4D2] Dynamic Soundtrack Sets
    Reply With Quote #4

    Quote:
    Originally Posted by Sev View Post
    Looks neat. Something like this is always a real quality of life change.

    Failed to compile.

    Also this on a 1.10 compile.
    son of a whoops i forgot to do this one simple thing:
    ConVar version_cvar;

    Should be fixed now.

    Quote:
    Originally Posted by Lux View Post
    Nice besure to mention it only works on local servers for the host.
    To be honest... I don't know whether this plugin actually works for people that aren't admins.
    Yeah, I did testing, and it seems to work on local servers.
    It definitely works for the admins on those servers, but no one that isn't an admin on my local server ever answers what music set they hear.
    __________________
    ragdoll spam, that is all

    Steam profile, where I game, obviously.
    Youtube channel, where I do Stick Death Maze animations and some other stuff.
    no plugin requests, sorry


    My Plugins:
    -search list-
    Modified Plugins:
    1 | 2 | 3 | 4

    Last edited by Shadowysn; 06-20-2020 at 06:40.
    Shadowysn is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 06-20-2020 , 06:57   Re: [L4D2] Dynamic Soundtrack Sets
    Reply With Quote #5

    cmds music_dynamic_stop_playing & music_dynamic_play don't have the server_can_execute flag so it won't work for anyone who is not host.

    To make it work you need to dispatch a "MusicCmd" usermessage.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    Shadowysn
    Senior Member
    Join Date: Sep 2015
    Location: Location:
    Old 06-20-2020 , 07:10   Re: [L4D2] Dynamic Soundtrack Sets
    Reply With Quote #6

    Quote:
    Originally Posted by Lux View Post
    cmds music_dynamic_stop_playing & music_dynamic_play don't have the server_can_execute flag so it won't work for anyone who is not host.

    To make it work you need to dispatch a "MusicCmd" usermessage.
    ...son of a f*ck. I knew this would bite me back.

    Well, RIP this plugin until I figure out how the MusicCmd usermessage is structured, which, IDFK and so does almost everyone else.
    __________________
    ragdoll spam, that is all

    Steam profile, where I game, obviously.
    Youtube channel, where I do Stick Death Maze animations and some other stuff.
    no plugin requests, sorry


    My Plugins:
    -search list-
    Modified Plugins:
    1 | 2 | 3 | 4
    Shadowysn is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 06-20-2020 , 07:15   Re: [L4D2] Dynamic Soundtrack Sets
    Reply With Quote #7

    https://forums.alliedmods.net/showthread.php?t=319685

    If you duplicate exactly what the messages send then it'll work, but it's unintelligible and probably breaks if the game ever updates. Might be easier to SDKCall. Can't use Emit* ?
    __________________
    Silvers is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 06-20-2020 , 07:23   Re: [L4D2] Dynamic Soundtrack Sets
    Reply With Quote #8

    SDKCalls or dhooking pick the poison

    I did some music stuff here with dhooks.
    https://github.com/LuxLuma/L4DMusic_stuff
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    Shadowysn
    Senior Member
    Join Date: Sep 2015
    Location: Location:
    Old 06-20-2020 , 07:36   Re: [L4D2] Dynamic Soundtrack Sets
    Reply With Quote #9

    Quote:
    Originally Posted by Lux View Post
    SDKCalls or dhooking pick the poison

    I did some music stuff here with dhooks.
    https://github.com/LuxLuma/L4DMusic_stuff
    Quote:
    Originally Posted by Silvers View Post
    https://forums.alliedmods.net/showthread.php?t=319685

    If you duplicate exactly what the messages send then it'll work, but it's unintelligible and probably breaks if the game ever updates. Might be easier to SDKCall. Can't use Emit* ?
    ...
    i got punched in the face with knowledge i never knew...

    damn it, i was never a real sourcemod coder to begin with

    ...
    ...

    the hashmap stuff, i mean.
    the Emit* thing I did consider, but didn't do as the dynamic music like the Event.ScenarioWin finale win music could drown out all other sounds but character voices.

    Last edited by Shadowysn; 06-20-2020 at 07:43.
    Shadowysn is offline
    Shadowysn
    Senior Member
    Join Date: Sep 2015
    Location: Location:
    Old 06-21-2020 , 04:08   Re: [L4D2] Dynamic Soundtrack Sets
    Reply With Quote #10

    I don't know what made me go on a bit of a self-deprecating rant on my previous comment, but the plugin's been updated to Version 1.3.0 now.
    It uses signatures, so now it should mostly work on Dedicated Servers.

    I haven't tested it fully, but so far, the incapacitation tune worked.

    Last edited by Shadowysn; 06-21-2020 at 06:44.
    Shadowysn 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 06:28.


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