Raised This Month: $ Target: $400
 0% 

[L4D2] Dynamic Soundtrack Sets (Unfinished)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Plugin ID:
7168
Plugin Version:
1.3.5
Plugin Category:
Fun Stuff
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    4 
    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 (Unfinished)
    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, finished state.
    This plugin functions with Dedicated Servers, but there are some hiccups here and there. This is not a finished plugin.


    -= 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.
    - A few hooks will cancel the music played by this plugin, otherwise the music could've potentially looped for the whole map.



    -= Bugs =-

    - The random inconsistencies of client-server communication and the unconventional method of this plugin can mean inconsistent bugs.
    - Sometimes, the incapacitation tune of both sets plays at once, overlapping each other.


    -= Releases =-
    Code:
    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 that don't work for other people.
    Version 1.2.5 (Dynamic_Soundtrack_Local)
    - Initial release.

    -= Total Views as of 7/2/2020 =-

    Dynamic_Soundtrack.sp = 22
    dynamic_soundtrack.txt = 24
    Dynamic_Soundtrack_Local.sp = 39


    -= 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!

    If you want this plugin just for Singleplayer, choose Dynamic_Soundtrack_Local.
    Otherwise, choose Dynamic_Soundtrack.
    Attached Files
    File Type: sp Get Plugin or Get Source (Dynamic_Soundtrack.sp - 18 views - 27.2 KB)
    File Type: txt dynamic_soundtrack.txt (557 Bytes, 39 views)
    File Type: sp Get Plugin or Get Source (Dynamic_Soundtrack_Local.sp - 57 views - 16.6 KB)
    __________________

    Last edited by Shadowysn; 07-01-2020 at 20:34. Reason: Dynamic_Soundtrack seems to work good in Local Servers.
    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: Brexit
    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.
    __________________
    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.
    __________________

    Last edited by Shadowysn; 06-20-2020 at 06:40.
    Shadowysn is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Brexit
    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.
    __________________
    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.
    __________________
    Shadowysn is offline
    Silvers
    AlliedModders Donor
    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: Brexit
    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
    __________________
    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 22:15.


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