Raised This Month: $342 Target: $400
 85%   Almost there!

Polymorph: Mod Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   Hawk552 (427)
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-11-2009 , 19:41   Polymorph: Mod Manager
Reply With Quote #1

Polymorph: Mod Manager

Description:
This is a map chooser replacement. It allows voting for the next mod (GunGame, HNS, etc.). It does not pause plugins so plugins from the mods are not loaded unless it is being played.
Admin Commands:
amx_nextmod
Console command to show/choose the next MOD to be played. When you change the next MOD it will choose a random map from the MOD's map list to be the default map.
Default access is ADMIN_MAP.
amx_votemod
Starts a vote for the next MOD (and consequently the next map. Then it changes the map.
Default access is ADMIN_MAP.

Cvars:
poly_mode <#>
0: Always stay on one mod unless changed manually with admin command. (Map votes only)
1: Play X maps then next mod will default to next in polymorph folder (Map votes only)
2: Play X maps then next mod will be chosen by vote. (Map and Mod votes)
Default: 2
poly_mapspermod <#>
Number of maps played per mod before you can vote for a new mod. Default 2.
This variable is now customizable per MOD in the initialization file.
poly_extendmod <1|0>
Allow extending the current mod (Mode 2).
Default 1.
amx_extendmap_max 90
amx_extendmap_step 15
Setup:
  • Install polymorph.amxx like any other plugin.
  • Create the folder /addons/amxmodx/configs/polymorph/.
  • Create MOD initialization files:
    • File must be in the polymorph folder.
    • File must begin with a number.
    • Example file 0_MyFirstMod.ini
      Code:
      ; Mod Cofiguration
      ; Comments here.
      
      [mod]
      name "Mod Name"
      mapsfile maps1.ini
      mapspermod 2
      
      [cfg]
      sv_gravity 900
      sv_alltalk 0
      hostname "This server is running ModName"
      
      
      [plugins]
      plugin1.amxx
      plugin1b.amxx
    • "mapsfile" must be in the polymorph folder. It should contain all the maps that you want to be eligible to be played with the MOD
  • If a mod comes with a plugins-<modname>.ini file (like Zombie Plague), it must removed.
  • If you want a plugin running for all mods then place it in plugins.ini. If you want it running for only certain mods, list it in your mod's .ini file in the polymorph folder.
Startup:
The plugin will fail the first time it is run. Simply restart the server to create the plugins-polymorph.ini file.


Thanks to the SuperCentral Community for letting me test this on a public server.

Optimization/coding suggestions are welcome.

The changelog is in the source code.
Attached Files
File Type: sma Get Plugin or Get Source (polymorph.sma - 5964 views - 26.7 KB)
__________________

Last edited by fysiks; 05-08-2011 at 00:54.
fysiks is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-11-2009 , 19:42   Polymorph Compatibility
Reply With Quote #2

MOD Compatibility
Gungame:
  • Delete mapchooser.amxx.
  • Put poly_mapchooser.amxx in the /plugins folder.
  • Rename it as mapchooser.amxx
  • Add mapchooser.amxx to the list of plugins in the Polymorph MOD initializaition file.
CSDM:
  • If you run CSDM, the module will not unload after playing CSDM.
  • So, add poly_csdm_off.amxx to every MOD that does not use the CSDM module. (tested but unconfirmed on an active server)
If you know of any MODs that will have compatibility issues like Gungame does, let me know.

Addons:
Polymorph: Rock the Vote:
This is a simple rtv plugin. Say rtv or rockthevote.
Starts a MOD vote followed by a map vote.
Add poly_rtv.amxx in plugins.ini
Cvars:
rtv_enable <1|0> (Default 1)
Enable the plugin.
rtv_ratio 0.51
Ratio required to rock the vote.
rtv_wait 1
Minutes before you can rtv
If you want to write add-on plugins for Polymorph you can use the attached include file.
Attached Files
File Type: sma Get Plugin or Get Source (poly_rtv.sma - 4168 views - 4.2 KB)
File Type: sma Get Plugin or Get Source (poly_mapchooser.sma - 4007 views - 345 Bytes)
File Type: sma Get Plugin or Get Source (poly_csdm_off.sma - 3027 views - 205 Bytes)
File Type: inc polymorph.inc (667 Bytes, 1467 views)
__________________

Last edited by fysiks; 12-02-2010 at 19:00.
fysiks is offline
Luix
Senior Member
Join Date: Dec 2009
Location: Venezuela
Old 12-22-2017 , 18:05   Re: Polymorph Compatibility
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
MOD Compatibility
Gungame:
  • Delete mapchooser.amxx.
  • Put poly_mapchooser.amxx in the /plugins folder.
  • Rename it as mapchooser.amxx
  • Add mapchooser.amxx to the list of plugins in the Polymorph MOD initializaition file.
This doesn't work, the poly_mapchooser.sma he uploaded doesn't register the plugin with the correct name in order to detect it.

Gungame detects the mapchooser this way:
PHP Code:
// start a map vote
stock start_mapvote()
{
    new 
dmmName[24], plugin;
    
    
// Galileo - galileo.amxx
    
if(galileoID != -1)
    {
        
log_amx("Starting a map vote from Galileo");
        
        
server_cmd("gal_startvote -nochange");
    }

    
// AMXX Nextmap Chooser - mapchooser.amxx
    
else if((plugin is_plugin_loaded("Nextmap Chooser")) != -1)
    {
        
log_amx("Starting a map vote from Nextmap Chooser");

        new 
oldWinLimit get_cvar_num("mp_winlimit"), oldMaxRounds get_cvar_num("mp_maxrounds");
        
set_cvar_num("mp_winlimit",0); // skip winlimit check
        
set_cvar_num("mp_maxrounds",-1); // trick plugin to think game is almost over

        // call the vote
        
if(callfunc_begin_i(get_func_id("voteNextmap",plugin),plugin) == 1)
            
callfunc_end();

        
// set maxrounds back
        
set_cvar_num("mp_winlimit",oldWinLimit);
        
set_cvar_num("mp_maxrounds",oldMaxRounds);
    } 
I just changed the name of the plugin to "Nextmap Chooser" like the default plugin to make it work. Hope it works for you too
Attached Files
File Type: sma Get Plugin or Get Source (poly_mapchooser.sma - 616 views - 335 Bytes)
__________________

Last edited by Luix; 12-22-2017 at 18:10.
Luix is offline
kikifrh
Senior Member
Join Date: May 2009
Old 12-11-2009 , 20:00   Re: Polymorph: Mod Manager
Reply With Quote #4

Gj, seems a really good plugin, I'll test on my server when getting home :p
+k for the good work ^^ (I think it will be approved)

Last edited by kikifrh; 12-11-2009 at 20:02.
kikifrh is offline
Raddish
BANNED
Join Date: Jul 2008
Location: Argentina
Old 12-11-2009 , 21:34   Re: Polymorph: Mod Manager
Reply With Quote #5

Nice.
Raddish is offline
Joker4ever
Member
Join Date: Dec 2008
Old 12-12-2009 , 01:22   Re: Polymorph: Mod Manager
Reply With Quote #6

Wow nice , this plugin is even more neat than the others. O: gj again.
Joker4ever is offline
orange
Senior Member
Join Date: Dec 2005
Old 12-12-2009 , 02:08   Re: Polymorph: Mod Manager
Reply With Quote #7

ooh this will help me for working on the SC multimod server i just havent had time but i will very soon.
__________________
orange is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-12-2009 , 12:33   Re: Polymorph: Mod Manager
Reply With Quote #8

Thanks everybody. It's been a long time in the making .

Added the admin commands so far to the first post.

Quote:
Originally Posted by orange View Post
ooh this will help me for working on the SC multimod server i just havent had time but i will very soon.
I updated it to this version since the last time someone added mods to it. This version will, hopefully, be less confusing and if a MOD does not have all the parts to it in the initialization file it will not stop working. It will just skip that MOD.
__________________

Last edited by fysiks; 12-12-2009 at 12:40.
fysiks is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 12-12-2009 , 12:42   Re: Polymorph: Mod Manager
Reply With Quote #9

Why do you set a max-mods limit when you're already working with CellArrays?
__________________
In Flames we trust!
Nextra is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-12-2009 , 12:48   Re: Polymorph: Mod Manager
Reply With Quote #10

Quote:
Originally Posted by Nextra View Post
Why do you set a max-mods limit when you're already working with CellArrays?
The number of MODs is not dynamic with any cell arrays. The dynamic arrays are used for lists of map names, cvars, and plugin names. I figured the number of MODs is not dynamic enough to require it .

And it reduces the number of native calls too.
__________________

Last edited by fysiks; 12-12-2009 at 12:50.
fysiks 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:02.


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