Raised This Month: $ Target: $400
 0% 

[L4D & L4D2] Game Mode Config Loader 1.6


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Thraka
AlliedModders Donor
Join Date: Aug 2005
Plugin ID:
906
Plugin Version:
1.6
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    8 
    Plugin Description:
    Executes a cfg file based on the games current settings at map load.
    Old 05-25-2009 , 19:52   [L4D & L4D2] Game Mode Config Loader 1.6
    Reply With Quote #1

    This plugin will execute a config file based on the current game play mode. Because I like Versus tweaked for a higher difficulty than a coop game, I use this to do that, but leave coop up to the lobby settings. Also, the survivor mode, I think, shouldn't have any adjustments made to it. This plugin gives me that ability.

    Notes
    Left 4 Dead will change the game type automatically when someone hosts a lobby for a specific game type and then ends up connecting to your server.

    The z_difficulty CVAR used to determine the difficulty for co-op uses the values Easy, Normal, Hard, Impossible. While the UI in the game uses Easy, Normal, Advanced, Expert. I set the names of the config files (default) to match the z_difficulty CVAR value, while the description of the coop - difficulty script CVARs matches the UI text.

    If a game mode is selected which is not used by the hardcoded cfg files (see the cvars) it will automatically look for a .cfg file that matches the game mode text. To figure this out, configure your lobby as desired, start the game in the server then check the hidden mp_gamemode cvar for the value. Then create a .cfg file with the same file name as cvar value.

    Version History
    1.8:
    • Created gamemode_resetconvars cvar. Defaults to on and when on, before executing the cfg file for the game mode, the reset_gameconvars console command will execute which resets all the cvars.
    • Executes a .cfg file with the same file name as the value of the mp_gamemode cvar if the mp_gamemode is not coded into the plugin directly. This is a fallback system to execute .cfg files when Valve implements new mutations or game modes.
    • Logs what it excutes.
    1.6:
    • Supports modes added by L4D2
    1.5:
    • Supports teamversus mode.
    1.4:
    • Added suggestions\code from Dionys to re-execute the cfg when mp_gamemode and z_difficulty change mid game.
    • Added plugin version cvar for tracking.
    1.3:
    • Added the ability to auto-execute a config script based on coop difficulty.
    1.2:
    • Changed meta data (URL and TITLE).
    1.1:
    • Removed bad code line.
    • Changed all references from survivor to survival
    1.0
    • Initial release.

    CVARs
    gamemode_config_ver - Version of this plugin.

    gamemode_resetconvars - Resets the console vars () before executing the config
    gamemode_config_coop - CFG file to execute when game mode is coop - Default: coop.cfg
    gamemode_config_versus - CFG file to execute when game mode is versus - Default: versus.cfg
    gamemode_config_teamversus - CFG file to execute when game mode is teamversus. - Default teamversus.cfg
    gamemode_config_survival - CFG file to execute when game mode is survival - Default survival.cfg
    gamemode_config_realism - CFG file to execute when game mode is realism. - Default realism.cfg
    gamemode_config_scavenge - CFG file to execute when game mode is scavenge. - Default scavenge.cfg
    gamemode_config_teamscavenge - CFG file to execute when game mode is teamscavenge. - Default teamscavenge.cfg

    gamemode_config_coop_easy - CFG file to execute when game mode is coop and the difficulty is Easy. - Default: coop_easy.cfg
    gamemode_config_coop_normal - CFG file to execute when game mode is coop and the difficulty is Normal. - Default: coop_normal.cfg
    gamemode_config_coop_hard - CFG file to execute when game mode is coop and the difficulty is Advanced. - Default: coop_hard.cfg
    gamemode_config_coop_impossible - CFG file to execute when game mode is coop and the difficulty is Expert. - Default: coop_impossible.cfg

    The values are used by the plugin to call the exec console command: exec [value].

    Thanks to DJ Tsunami for getting me started.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_gamemode_scripts.sp - 9725 views - 7.4 KB)

    Last edited by Thraka; 05-24-2011 at 16:35. Reason: Updated version.
    Thraka is offline
    Felycity
    Member
    Join Date: Mar 2009
    Old 05-25-2009 , 21:16   Re: [L4D] Game Mode Config Loader
    Reply With Quote #2

    this plugin works well on my server!
    good job!
    Felycity is offline
    DJ Tsunami
    DJ Post Spammer
    Join Date: Feb 2008
    Location: The Netherlands
    Old 05-26-2009 , 06:28   Re: [L4D] Game Mode Config Loader
    Reply With Quote #3

    Nicely done. But, are you sure it's "survivor"? I'm looking at an L4D server right now and it clearly says "survival".

    Edit: also, line 26 shouldn't be there.
    __________________
    Advertisements | REST in Pawn - HTTP client for JSON REST APIs
    Please do not PM me with questions. Post in the plugin thread.

    Last edited by DJ Tsunami; 05-26-2009 at 06:40.
    DJ Tsunami is offline
    PStar
    Veteran Member
    Join Date: Mar 2008
    Old 05-26-2009 , 07:39   Re: [L4D] Game Mode Config Loader
    Reply With Quote #4

    How does it work?

    So i mean does it integrate into the admin menu or something, where i can change the game mode?
    Or what?
    PStar is offline
    DJ Tsunami
    DJ Post Spammer
    Join Date: Feb 2008
    Location: The Netherlands
    Old 05-26-2009 , 11:38   Re: [L4D] Game Mode Config Loader
    Reply With Quote #5

    All this does is execute a cfg file with commands or cvars when the map starts, depending on the current game mode. L4D decides what the current game mode is, you can't change it.
    __________________
    Advertisements | REST in Pawn - HTTP client for JSON REST APIs
    Please do not PM me with questions. Post in the plugin thread.
    DJ Tsunami is offline
    Thraka
    AlliedModders Donor
    Join Date: Aug 2005
    Old 05-26-2009 , 12:13   Re: [L4D] Game Mode Config Loader
    Reply With Quote #6

    Doh! My dislexia is getting the best of me. I think I had survival and I said wait! it's survivor! .. arg. I'll fix that in a few mins

    edit: Done!

    I just thought of something too. Now that I can have different configs for each game mode, I can also change the motdfile cvar to a specific motd file for each type. Very nice!

    Last edited by Thraka; 05-26-2009 at 12:40.
    Thraka is offline
    Frozenology
    Junior Member
    Join Date: Mar 2009
    Old 05-26-2009 , 15:45   Re: [L4D] Game Mode Config Loader
    Reply With Quote #7

    Thanks for Plugins, I will dev an improve version of this.
    __________________
    Aranging Left 4 Dead
    http://www.aranghq.com
    Aranging Left 4 Dead :: Steam Group
    http://steamcommunity.com/groups/aranging
    We mods game to be Arang (Epic).
    Frozenology is offline
    madcap
    Senior Member
    Join Date: Feb 2009
    Old 05-27-2009 , 09:34   Re: [L4D] Game Mode Config Loader
    Reply With Quote #8

    Do the CFGs go in the left4dead/cfg/sourcemod directory?
    madcap is offline
    Thraka
    AlliedModders Donor
    Join Date: Aug 2005
    Old 05-27-2009 , 13:18   Re: [L4D] Game Mode Config Loader
    Reply With Quote #9

    No just the left4dead\cfg folder. Really any location that the normal console exec [filename] would find the file.

    One thing I'm going to do (perhaps today) is have it also execute a difficulty config for coop mode. Since the lobby can set easy normal hard expert, these configs would run when it was coop and right after the coop.cfg runs.
    Thraka is offline
    Thraka
    AlliedModders Donor
    Join Date: Aug 2005
    Old 05-28-2009 , 01:59   Re: [L4D] Game Mode Config Loader
    Reply With Quote #10

    It seems the server is caching the motd content for the clients. So if you change motdfile after server has started and someone has connected, it doesn't seem to load the new page content
    Thraka 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 04:04.


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