Raised This Month: $ Target: $400
 0% 

[L4D2] Jukebox Spawner (1.12) [11-Dec-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
2207
Plugin Version:
1.12
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    30 
    Plugin Description:
    Auto-spawn jukeboxes on round start.
    Old 02-01-2011 , 22:51   [L4D2] Jukebox Spawner (1.12) [11-Dec-2022]
    Reply With Quote #1

    About:
    • Auto-spawns jukeboxes on round_start.
    • Admin command to spawn jukeboxes aligned to the wall and floor.
    • Positions and angles based on a config (Attached below is a config with jukeboxes on every Valve map).
    • Triggers a horde when track #4 is played.
    • The jukebox plays a max of 7 tracks, the last 2 rarely play.
    • Please note: Each jukebox creates 18 entities within the game. Maximum of 10 jukeboxes allowed (recompile for more).
    • Please note: Sounds which loop will do so forever until you change track or use !jukestop.


    Thanks:
    • 8bit - for the idea.
    • Mr.RuyC and NanX - For helping test the plugin on their server.
    • Zuko & McFlurry for source code (full credits inside the source).


    Custom Tracks and Spawn Config:
    • The config is saved to l4d2_jukebox_spawns.cfg in your servers \addons\sourcemod\data\ folder.
    • The position and angles for each jukebox are saved in a key value structure.
    • Each map has it's own section (as seen below for Dead Center)
    • Simply put "track#" (where # is 1-7 for the track to change or 1-64) followed by the soundscape name in quotes.
    • Soundscape names can be found in the .snd files in your games \reslists\ folders.

    Map Specific overrides:
    When a jukebox is created, it will first check for 7 map specific tracks. In the example below "track1" is a map specific override within the "c1m1_hotel" section so that track will be loaded on that map.
    "main" keyvalue tracks:
    You can specify 7 tracks in the "main" section which force the specified track and track number on all maps. In the example "track4" will be the same on all maps while the rest could be random.
    "random" keyvalue tracks:
    Specifying "track1" to "track7" will override the relative original Valve track. This is how you would remove certain Valve default tracks from playing. Leaving 1 to 7 blank will allow them to play. To give the jukebox a wider selection of tracks, add them from "track8" onwards.


    Example:
    Code:
    "jukeboxes"
    {
    	"main"
    	{
    		"track4"		"Jukebox.re_your_brains"
    	}
    	"random"
    	{
    		"track8"		"Vomit.Use"
    	}
    	"c1m1_hotel"
    	{
    		"num"        "2"
    		"angle1"        "-0.000000 90.000000 0.000000"
    		"origin1"       "412.860748 5683.539062 2880.000000"
    		"angle2"        "-0.000000 90.000000 0.000000"
    		"origin2"       "1854.047729 4510.630859 1216.031250"
    		"track1"        "Jukebox.still_alive"
    		"track4"        "Vomit.Use"
    	}
    }
    Valve orignial tracks
    Code:
        "track1"        "Jukebox.BadMan1",
        "track2"        "Jukebox.Ridin1",
        "track3"        "Jukebox.saints_will_never_come",
        "track4"        "Jukebox.re_your_brains",
        "track5"        "Jukebox.SaveMeSomeSugar",
        "track6"        "Jukebox.still_alive",
        "track7"        "Jukebox.AllIWantForXmas"


    Commands:

    PHP Code:
    // All players
    sm_jukenext    // Changes track on the closest jukebox, must be near by.
    sm_jukestop    // Stops the music playing from all jukeboxes.

    // Admins only (requires "z" flag)
    sm_juke        // Spawns a jukebox where your crosshair is pointing (attempts to align with walls and floor).
    sm_jukebox     // Same as above, but saves the origin and angle to the jukebox spawns config.
    sm_jukedel     // Deletes the jukebox you are pointing at (point near the top above the menu).
    sm_jukewipe    // Removes all the jukeboxes in game and deletes the current map from the config.
    sm_jukelist    // Lists all the Jukeboxes on the current map and their locations.
    sm_juketracks  // Lists all the tracks read from the config and shows which will be playing. 


    CVars:

    Saved to l4d2_jukebox.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // 0=Plugin off, 1=Plugin on.
    l4d2_jukebox_allow ""

    // Create a panic event on these gamemodes when track #4 plays. Separate by commas (no spaces). "" = all.
    l4d2_jukebox_horde_modes ""

    // Display a chat message when the horde is triggered by track #4.
    l4d2_jukebox_horde_notify "1"

    // How many seconds after track #4 plays before triggering a horde.
    l4d2_jukebox_horde_time "42"

    // -1=Infinite, 0=Off. Specify how many times a panic event may occur when track #4 plays.
    l4d2_jukebox_horde_trigger "-1"

    // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    l4d2_crawling_modes ""

    // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
    l4d2_jukebox_modes_disallow ""

    // Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
    l4d2_crawling_modes_tog "0"

    // Jukebox Spawner plugin version.
    l4d2_jukebox_version 


    Changes:
    Code:
    1.12 (11-Dec-2022)
        - Changes to fix compile warnings on SourceMod 1.11.
    
    1.11 (11-Jul-2021)
        - Moved the button forward slightly. This allows using the button which the last update prevented.
    
    1.10 (06-Jul-2021)
        - Fixed getting stuck on the Jukebox. Thanks to "Shadowysn" for reporting. Maybe caused by the "2.2.1.3" game update.
    
    1.9 (10-May-2020)
        - Extra checks to prevent "IsAllowedGameMode" throwing errors.
        - Various changes to tidy up code.
    
    1.8 (01-Apr-2020)
        - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.
    
    1.7 (05-May-2018)
        - Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.
    
    1.6 (21-Jul-2013)
        - Removed Sort_Random work-around. This was fixed in SourceMod 1.4.7, all should update or spawning issues will occur.
    
    1.5 (10-May-2012)
        - Added cvar "l4d2_jukebox_allow" to turn the plugin on and off.
        - Added cvar "l4d2_jukebox_modes" to control which game modes the plugin works in.
        - Added cvar "l4d2_jukebox_modes_tog" same as above.
        - Removed max entity check and related error logging.
        - Small changes and fixes.
    
    1.4 (01-Dec-2011)
        - Added Jukeboxes to these maps: Crash Course, Dead Air, Death Toll, Blood Harvest, Cold Stream.
        - Added command "sm_juketracks" to list tracks read from the config and which will play.
        - Changed command "sm_jukelist" to list all Jukebox positions on the current map.
        - Creates Jukeboxes when the plugin is loaded and removes when unloaded.
        - Fixed "l4d2_jukebox_modes_disallow" cvar not working all the time.
    
    1.3 (19-May-2011)
        - Fixed sm_jukestop not working.
    
    1.2 (19-May-2011)
        - Fixed no tracks loading if a "random" section was not specified. Valve default tracks will be loaded into the "main" section.
        - Fixed PrintToChatAll() error.
    
    1.1 (19-May-2011)
        - Added a "main" section to the keyvalue config which sets a specific track to a specific number for all maps.
        - Added a "random" section to the keyvalue config. Tracks will be randomly be selected from here.
        - Added cvar "l4d2_jukebox_horde_notify" to display a hint when the jukebox triggers a horde.
        - Added command "sm_jukelist" to display a list of randomly selected tracks as well as the override, random and main tracks loaded.
        - Added a check to avoid spawning footlockers when there are too many entities.
        - Added Jukeboxes to saferooms in the the Cold Stream campaign.
        - Changed sm_juke and sm_jukebox to spawn jukeboxes with specified tracks from the "main" and "random" sections and uses overrides for that map if available.
        - Limited sm_jukenext and sm_jukestop to survivor team and admins with 'z' flag only.
    
    1.0 (01-Dec-2011)
        - Initial release.


    Installation:
    1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
    2. Optionally download "l4d2_jukebox_spawns.cfg" and save to your servers \addons\sourcemod\data\ folder. This has jukeboxes saved on every Valve map.

    Updating from 1.4 or older:
    • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
    Attached Files
    File Type: cfg l4d2_jukebox_spawns.cfg (10.9 KB, 4265 views)
    File Type: sp Get Plugin or Get Source (l4d2_jukebox_spawner.sp - 1033 views - 42.9 KB)
    __________________

    Last edited by Silvers; 12-11-2022 at 05:26.
    Silvers is offline
    alexip121093
    Senior Member
    Join Date: Dec 2009
    Location: Hong Kong
    Old 02-02-2011 , 01:24   Re: [L4D2] Jukebox Spawner
    Reply With Quote #2

    how about the Foot Locker (The Passing) . can it be created too?
    __________________
    alexip121093 is offline
    Send a message via MSN to alexip121093
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 02-02-2011 , 01:38   Re: [L4D2] Jukebox Spawner
    Reply With Quote #3

    Quote:
    Originally Posted by alexip121093 View Post
    how about the Foot Locker (The Passing) . can it be created too?
    Edit: wooooo: http://forums.alliedmods.net/showthread.php?t=157183
    __________________

    Last edited by Silvers; 05-18-2011 at 21:49. Reason: update
    Silvers is offline
    marvel
    BANNED
    Join Date: Dec 2009
    Old 02-02-2011 , 05:50   Re: [L4D2] Jukebox Spawner
    Reply With Quote #4

    This is awesome. I love these type of plugins, thanks man will test it
    marvel is offline
    jake84
    Senior Member
    Join Date: Jun 2010
    Location: CA
    Old 02-02-2011 , 06:40   Re: [L4D2] Jukebox Spawner
    Reply With Quote #5

    Couldn't find anything on No Mercy. Otherwise a cool plugin
    jake84 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 02-02-2011 , 06:47   Re: [L4D2] Jukebox Spawner
    Reply With Quote #6

    Quote:
    Originally Posted by jake84 View Post
    Couldn't find anything on No Mercy. Otherwise a cool plugin
    Ooops I forgot to add those! Will update the config later. Thanks


    EDIT: Updated l4d2_jukebox_spawns.cfg, added jukeboxes to the No Mercy campaign.
    __________________

    Last edited by Silvers; 02-02-2011 at 09:15.
    Silvers is offline
    marvel
    BANNED
    Join Date: Dec 2009
    Old 02-02-2011 , 14:29   Re: [L4D2] Jukebox Spawner
    Reply With Quote #7

    Works nice, everybody is playing with the jukebox. Some players stay behind to play with it and even get themselves killed

    One more thing though, players are a bit surprised when the panic event starts and the saferoom door is still closed. Maybe add a message that, when the player controls the jukebox it warns them of song 4, or a message that says jukebox song 4 caused a panic event?
    marvel is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 02-02-2011 , 15:46   Re: [L4D2] Jukebox Spawner
    Reply With Quote #8

    I don't think theres a need for a warning (plus it would be a heap of work to detect). This is the same functionality as Valves Jukeboxes, people should know. The only difference is by default the panic event starts 1 second after (where valves is 42).
    __________________
    Silvers is offline
    war450
    Member
    Join Date: Apr 2006
    Old 02-02-2011 , 17:29   Re: [L4D2] Jukebox Spawner
    Reply With Quote #9

    this was what i was waiting on .

    I have all of your plug-ins installed on my server, i look forward to seeing more plug-ins from you in the future.

    As for the foot locker, yes that would be cool but that entity is like trying to create the dark carnival mini-game as a plugin, I'm sure some one would eventually do it at least, i hope. (maybe bad example but that mini-game is pretty complex)
    war450 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 02-02-2011 , 17:35   Re: [L4D2] Jukebox Spawner
    Reply With Quote #10

    Thanks war450

    Thats a great idea, I'll take a look at the mini-games.

    EDIT: The Stache Whacker and the Moustachio games consist of roughly 60 entities each, too much work for my liking sorry.
    __________________

    Last edited by Silvers; 02-04-2011 at 15:05.
    Silvers 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 19:37.


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