Raised This Month: $51 Target: $400
 12% 

Gamemode Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author
thesupremecommander
Member
Join Date: Apr 2012
Plugin ID:
3918
Plugin Version:
1.2.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    A plugin for SourceMod that helps load gamemodes.
    Old 09-22-2013 , 11:21   Gamemode Manager
    Reply With Quote #1

    Gamemode Manager
    A plugin for SourceMod that helps load gamemodes.

    Features
    • unloads all other gamemodes before loading chosen gamemode to avoid conflicts
    • changes gamemode for next map at current map's end
    • works well with Ultimate Mapchooser (using postvote-command as sm_nextgamemode <gamemode>)

    Usage

    CVars
    • gamemode_manager_version - Gamemode Manager version
    • gamemode_manager_use_default <0|1> - how map change should be handled if no gamemode was specifically set (0 - use gamemode of current map, 1 - use default gamemode specified by gamemode_manager_default_gamemode)
    • gamemode_manager_default_gamemode <gamemode> - the default gamemode to be loaded each map (for gamemode_manager_use_default 1)
    • gamemode_manager_debug <0|1> - turns on debugging and action logging

    Commands
    • sm_reloadgamemodes - reload game modes from file config
    • sm_nextgamemode [gamemode] - get/set the next map's gamemode
    • sm_gamemodemenu - opens up a menu to select the next map's gamemode

    Configuration
    Code:
    "gamemodes"
    {
    	"vanilla"							// a gamemode included by default that unloads all other gamemodes when run
    	{
    	}
    	
    	"super-awesome-nonexistent-gamemode"				// name of the gamemode (e.g. sm_nextgamemode super-awesome-nonexistent-gamemode)
    	{
    		"plugins"						// moved between plugins/ and plugins/disabled/ and loaded/unloaded in order specified
    		{
    			"1"	"important-dependency.smx"		// load/unload dependency first
    			"2"	"gamemode/super-awesome-gamemode.smx"	// include full path to plugin
    			"3"	"gamemode/gamemode-modifier.smx"	// load plugin that depends on the gamemode last
    		}
    		
    		"enable-commands"					// executed in the order written after plugins loaded
    		{
    			"1"	"super_gamemode_enabled 1"
    			"2"	"super_gamemode_type 3"
    			"3"	"gamemode_modifier 5.0"
    		}
    		
    		"disable-commands"					// executed in the order written before plugins unloaded
    		{
    			"1"	"super_gamemode_enabled 0"
    		}
    	}
    }
    Requirements
    • SourceMod

    Changelog

    1.2.0 (2013-10-04)
    • revamped admin menu to fix issues
    • prevented possible collisions

    1.1.0 (2013-09-22)
    • added admin menu

    1.0.2 (2013-09-22)
    • fixed up documentation a little

    1.0.1 (2013-09-22)
    • made version CVar public
    • changed path sizes to SourceMod constant

    1.0.0 (2013-09-22)
    • initial release

    Installation
    1. Place plugins/gamemode-manager.smx in your plugins directory.
    2. Edit configs/gamemodes.cfg appropriately and place it in your configs directory.

    Download
    1. plugins/gamemode-manager.smx
    2. scripting/gamemode-manager.sp
    3. configs/gamemodes.cfg

    Last edited by thesupremecommander; 10-04-2013 at 21:51. Reason: 1.2.0 update
    thesupremecommander is offline
    Maxximou5
    AlliedModders Donor
    Join Date: Feb 2013
    Old 09-22-2013 , 12:14   Re: Gamemode Manager
    Reply With Quote #2

    Excellent work, I've been looking for this after I saw another server with this same plugin. May or may not have been yours but nonetheless I'm happy to see it here meow. I'll try it out and report any bugs. Thank you sir!
    Maxximou5 is offline
    Blackglade
    Senior Member
    Join Date: Jul 2012
    Location: NYC
    Old 09-22-2013 , 12:29   Re: Gamemode Manager
    Reply With Quote #3

    THIS IS AMAZING. It can solve so many problems with complete ease!!! Thanks for making it!

    ~ Reserved ~
    Blackglade is offline
    Root_
    Veteran Member
    Join Date: Jan 2012
    Location: ryssland
    Old 09-22-2013 , 12:41   Re: Gamemode Manager
    Reply With Quote #4

    Cool stuff. At first I though its for CS:GO, but this plugin is way better
    Can you also add admin menu integration? Like 'Select game mode' via ServerCommands category.
    __________________


    dodsplugins.com - Plugins and Resources for Day of Defeat
    http://twitch.tv/zadroot
    Root_ is offline
    thesupremecommander
    Member
    Join Date: Apr 2012
    Old 09-22-2013 , 18:06   Re: Gamemode Manager
    Reply With Quote #5

    Quote:
    Originally Posted by Root_ View Post
    Cool stuff. At first I though its for CS:GO, but this plugin is way better
    Can you also add admin menu integration? Like 'Select game mode' via ServerCommands category.
    Added in 1.1.0, just released.
    thesupremecommander is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 09-23-2013 , 10:57   Re: Gamemode Manager
    Reply With Quote #6

    I was just* working on something like this. I'll probably still release it when I'm finished with it, since there are some differences in it.

    * Kinda put it on hold while fixing other plugins.
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 09-23-2013 at 10:57.
    Powerlord is offline
    thesupremecommander
    Member
    Join Date: Apr 2012
    Old 09-23-2013 , 12:47   Re: Gamemode Manager
    Reply With Quote #7

    Quote:
    Originally Posted by Powerlord View Post
    I was just* working on something like this. I'll probably still release it when I'm finished with it, since there are some differences in it.

    * Kinda put it on hold while fixing other plugins.
    Hm, interesting. What kind of differences? I wouldn't mind trying to integrate them into this plugin since this is pretty barebones at the moment.
    thesupremecommander is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 09-26-2013 , 11:09   Re: Gamemode Manager
    Reply With Quote #8

    Quote:
    Originally Posted by thesupremecommander View Post
    Hm, interesting. What kind of differences? I wouldn't mind trying to integrate them into this plugin since this is pretty barebones at the moment.
    Well, for one, Opt-In MultiMod requires explicit support from the game mode it's trying to load. (The Opt-In refers to the plugins having to opt-in to be controlled by it)

    While that may not be a popular feature, there are a few things doing this allows:
    1. One of the required callbacks sends in the map name and the plugin is expected to return whether it supports that map.
      • This was added because some plugins may work on all maps (TF2's Huntsman Hell), some plugins may work on maps with certain prefixes (TF2's Vs. Saxton Hale, CS:S's Gungame), and some plugins may only work on specific maps (TF2's Prop Hunt)
    2. One of the required callbacks is sent when the plugin is activated or deactivated.
      • This allows mode changes between rounds.
      • The plugin that is currently being unloaded is always sent the change callback first.
    3. If it wasn't obvious from earlier, this plugin also calls its own votes to change gamemodes.
    One potential drawback to this is that it doesn't interact well with Stripper: Source, which is commonly used to change koth maps to arena mode for VSH.

    Actually, my plugin is nearly done, but I know that some bugs are still present in it:
    • The standard and medieval (TF2 only) game modes haven't yet been accounted for. Instead, it will search its plugin array and toss an error about missing plugins.
    • Vote processing isn't quite finished.
    • The plugin will currently run a vote after the final round of a map, but the next map's mode is actually determined by a separate vote after the next map is determined. Unfortunately some games (coughteamfortresstwocough) have more complicated logic for determining when the map will change.
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 09-26-2013 at 11:16.
    Powerlord is offline
    thesupremecommander
    Member
    Join Date: Apr 2012
    Old 09-26-2013 , 11:32   Re: Gamemode Manager
    Reply With Quote #9

    Oh, right, I remember you talking about making your own manager like that.

    I'd actually be interested in working out some sort of map vote system for this plugin, but that would require some way to know when a map vote has finished and what map the next map will be, something which I will have to investigate.
    thesupremecommander is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 09-26-2013 , 11:34   Re: Gamemode Manager
    Reply With Quote #10

    Quote:
    Originally Posted by thesupremecommander View Post
    Oh, right, I remember you talking about making your own manager like that.

    I'd actually be interested in working out some sort of map vote system for this plugin, but that would require some way to know when a map vote has finished and what map the next map will be, something which I will have to investigate.
    I'm going to test mine using a convar change hook on sm_nextmap. Having said that, I need to write a workaround for the nextmap plugin setting it on server start... don't want to try a vote then.

    If that doesn't work, both UMC and MCE have public callbacks when they finish map votes... and MCE 1.10 was updated to pass the map back in this callback (gee... I wonder if my multimod plugin had anything to do with me adding that...).

    Unfortunately, the stock Mapchooser doesn't fire any callbacks, but you can tell if it finished its vote via EndOfMapVoteEnabled() && HasEndOfMapVoteFinished() functions.

    You'd have to do the usual OnLibraryAdded/OnLibraryRemoved/AllPluginsLoaded LibraryExists for all 3 to detect which one is in use.
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 09-26-2013 at 11:41.
    Powerlord 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:13.


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