AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Polymorph: Mod Manager (https://forums.alliedmods.net/showthread.php?t=111535)

fysiks 12-11-2009 19:41

Polymorph: Mod Manager
 
9 Attachment(s)
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.

fysiks 12-11-2009 19:42

Polymorph Compatibility
 
8 Attachment(s)
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.

kikifrh 12-11-2009 20:00

Re: Polymorph: Mod Manager
 
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)
:D

Raddish 12-11-2009 21:34

Re: Polymorph: Mod Manager
 
Nice.

Joker4ever 12-12-2009 01:22

Re: Polymorph: Mod Manager
 
Wow nice , this plugin is even more neat than the others. O: gj again.

orange 12-12-2009 02:08

Re: Polymorph: Mod Manager
 
ooh this will help me for working on the SC multimod server i just havent had time but i will very soon.

One 12-12-2009 03:02

Re: Polymorph: Mod Manager
 
oO GJ.nice idea

Arkshine 12-12-2009 06:08

Re: Polymorph: Mod Manager
 
Interesting. :)

Nextra 12-12-2009 07:02

Re: Polymorph: Mod Manager
 
I could have used this some months ago. I was too lazy to do it myself :)
Well done.

Javivi 12-12-2009 07:28

Re: Polymorph: Mod Manager
 
GJ fysiks

fysiks 12-12-2009 12:33

Re: Polymorph: Mod Manager
 
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 (Post 1014145)
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.

Nextra 12-12-2009 12:42

Re: Polymorph: Mod Manager
 
Why do you set a max-mods limit when you're already working with CellArrays?

fysiks 12-12-2009 12:48

Re: Polymorph: Mod Manager
 
Quote:

Originally Posted by Nextra (Post 1014630)
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.

Nextra 12-12-2009 13:14

Re: Polymorph: Mod Manager
 
Ah ok. I know that the mod limit is not dynamic and the cellarrays are used for other stuff ;)

joropito 12-13-2009 13:46

Re: Polymorph: Mod Manager
 
Quote:

Originally Posted by fysiks (Post 1013837)
Startup:
The plugin will fail the first time it is run. Simply restart the server to create the plugins-polymorph.ini file.

I suggest to use the advantage of set/get_localinfo to fix that with autorestart on first run.

fysiks 12-13-2009 13:48

Re: Polymorph: Mod Manager
 
Quote:

Originally Posted by joropito (Post 1015942)
I suggest to use the advantage of set/get_localinfo to fix that with autorestart on first run.

That won't do anything. It only happens the VERY FIRST time you run it. Once it writes the file it will run any other time you stop/start the server. (unless you change the name of the MOD that is currently written in the file plugins-polymorph.ini file)

fang 12-13-2009 21:07

Re: Polymorph: Mod Manager
 
Pretty amazing mod. Good joke fysiks :)

bmann_420 12-17-2009 04:21

Re: Polymorph: Mod Manager
 
O yes indeed, i was waiting for you to release it :D I wish i wasnt so busy in order to test this to the full extent, like orange was sayin. But you did some good work fysiks, theirs no doubt in that :up:

Apollyon 12-27-2009 23:00

Re: Polymorph: Mod Manager
 
PHP Code:

poly_mapspermod <#>Number of maps played per mod before you can vote for a new mod.
Default 2.
I plan on making this variable customizable per MOD in the initialization file


I tried setting this to "1" in both the server.cfg and amxx.cfg but it never worked. It always used the default of "2". When I compiled the sma with that set to "1" it worked fine. Double-checked cfg files for typos but they were correct. Not sure why that was happening.

fysiks 12-28-2009 00:17

Re: Polymorph: Mod Manager
 
Quote:

Originally Posted by Apollyon (Post 1033417)
I tried setting this to "1" in both the server.cfg and amxx.cfg but it never worked. It always used the default of "2". When I compiled the sma with that set to "1" it worked fine. Double-checked cfg files for typos but they were correct. Not sure why that was happening.

That is strange. I'll look into it and see.

Just curious, what mods are you using?

Apollyon 12-28-2009 02:19

Re: Polymorph: Mod Manager
 
I was just testing it on my test server with my team change plugins. One mod for humans join ct team and the other for humans join t team. The mods worked fine.

DarkGod 12-28-2009 02:53

Re: Polymorph: Mod Manager
 
fysiks is my hero.

patroderix 12-29-2009 03:57

Re: Polymorph: Mod Manager
 
Hi,

I've got some problem with the plugin !

first : the plugin only show me max 8 mods when i type amx_nextmod in the console
and while typing amx_votemod it show me 7 mods
I've got 9 mods
second : when execute the cvar in polymorph folder it rename my server with max 21 characters in hostname

so can you change this and also make it possible to vote for the same mod not as extended
Thanks a lot and sorry for my bad english

patroderix 12-29-2009 04:02

Re: Polymorph: Mod Manager
 
Oh sorry
find the bug when only see 8 of my 9 mods the name of the maplist was not right !!

fysiks 12-29-2009 18:41

Re: Polymorph: Mod Manager
 
Quote:

Originally Posted by patroderix (Post 1034928)
when execute the cvar in polymorph folder it rename my server with max 21 characters in hostname

Fixed in next version. I increased the length by 32 characters. I was using that var for filenames so I never needed something that long until I added in using "hostname".

Quote:

Originally Posted by patroderix (Post 1034928)
also make it possible to vote for the same mod not as extended
Thanks a lot and sorry for my bad english

I'll have to think about this one. I'm thinking that the cost will outweigh the benefits if I make that easily customizable by a cvar. I could easily make a custom version for you though.

Quote:

Originally Posted by patroderix (Post 1034933)
Oh sorry
find the bug when only see 8 of my 9 mods the name of the maplist was not right !!

If a mod fails to load it will log it in the amx logs. So, if a MOD is missing always check there to see if any failed (and which ones). I'm glad it was an easy fix :).

Quote:

Originally Posted by DarkGod (Post 1033562)
fysiks is my hero.

ok.

Apollyon 12-30-2009 00:16

Re: Polymorph: Mod Manager
 
While testing, I commented-out "mapchooser.amxx" in the plugins.ini file like was required with your previous multi-mod plugin. Is this still required? It's not stated in your first post here.

fysiks 12-30-2009 00:48

Re: Polymorph: Mod Manager
 
Quote:

Originally Posted by fysiks (Post 1013837)
This is a map chooser replacement.

So, yes, you should (must) comment mapchooser.amxx. If you are running gungame then there are special instructions for that using mapchooser.amxx.

patroderix 12-31-2009 09:17

Re: Polymorph: Mod Manager
 
Quote:
Originally Posted by patroderix https://forums.alliedmods.net/images...s/viewpost.gif
also make it possible to vote for the same mod not as extended
Thanks a lot and sorry for my bad english


I'll have to think about this one. I'm thinking that the cost will outweigh the benefits if I make that easily customizable by a cvar. I could easily make a custom version for you though.

if you can make a version for me without extend map just vote for the mod thanks a lot it is what i want so much

fysiks 12-31-2009 18:41

Re: Polymorph: Mod Manager
 
2 Attachment(s)
Here ya go. It includes the "hostname" fix too. (Not an official release)

Just remind me when I make an official release to re-fix it for your voting request.

Updated: Updated this version to the latest. In fact, it was found that my previous "fix" didn't fix it because there was another variable that was too short. This is fixed now. You can have a longer "hostname" now.

I just now realized that you edited your post to inform me of this issue! Sorry I didn't see it sooner. :|

patroderix 12-31-2009 19:04

Re: Polymorph: Mod Manager
 
Quote:

Originally Posted by fysiks (Post 1038421)
Here ya go. It includes the "hostname" fix too. (Not an official release)

Just remind me when I make an official release to re-fix it for your voting request.

Oh Thank you very much and an happy new year 2010

It works perfectly for the vote mod but not for the hostname it still 21 characters max

ConnorMcLeod 12-31-2009 21:44

Re: Polymorph: Mod Manager
 
A clean multimod plugin, good job :)

fysiks 01-01-2010 00:57

Re: Polymorph: Mod Manager
 
Quote:

Originally Posted by ConnorMcLeod (Post 1038579)
A clean multimod plugin, good job :)

Thanks. It wasn't easy :).

Jack86 01-01-2010 09:52

Re: Polymorph: Mod Manager
 
Awesome ! I was waiting for this for a long time.
+karma

bmann_420 01-02-2010 17:47

Re: Polymorph: Mod Manager
 
Hey Fysiks, i just updated added a few mods. With your mapchooser and rtv, it doesnt want to do a map vote after the mod is choosed. It reverts back to where it was at, and you must disconnect and rejoin for the same mod. Maybe when yea get on steam we can figure some thing out to ;) (you can also view the files if you want in the ftp)

Code:

L 01/02/2010 - 16:42:52: Invalid CVAR pointer
L 01/02/2010 - 16:42:52: [AMXX] Displaying debug trace (plugin "polymorph.amxx")
L 01/02/2010 - 16:42:52: [AMXX] Run time error 10: native error (native "set_pcvar_string")
L 01/02/2010 - 16:42:52: [AMXX]    [0] 55059.attach::setDefaultNextmap (line 702)
L 01/02/2010 - 16:42:52: [AMXX]    [1] 55059.attach::plugin_cfg (line 223)
L 01/02/2010 - 16:43:33: Invalid CVAR pointer
L 01/02/2010 - 16:43:33: [AMXX] Displaying debug trace (plugin "polymorph.amxx")
L 01/02/2010 - 16:43:33: [AMXX] Run time error 10: native error (native "set_pcvar_string")
L 01/02/2010 - 16:43:33: [AMXX]    [0] 55059.attach::setDefaultNextmap (line 702)
L 01/02/2010 - 16:43:33: [AMXX]    [1] 55059.attach::checkModVotes (line 576)
L 01/02/2010 - 16:44:18: Invalid CVAR pointer
L 01/02/2010 - 16:44:18: [AMXX] Displaying debug trace (plugin "polymorph.amxx")
L 01/02/2010 - 16:44:18: [AMXX] Run time error 10: native error (native "get_pcvar_string")
L 01/02/2010 - 16:44:18: [AMXX]    [0] 55059.attach::changeMap (line 803)


fysiks 01-02-2010 17:53

Re: Polymorph: Mod Manager
 
That's strange. It somehow failed to get the pointer for amx_nextmap :(.

bmann_420 01-02-2010 18:17

Re: Polymorph: Mod Manager
 
Crap nuggets, somehow nextmap.amxx got disabled. It seems to work now.. One of those days.

I see the max mods in the vote is 10, but the menu is 5, and their is no next page?

fysiks 01-02-2010 18:23

Re: Polymorph: Mod Manager
 
Quote:

Originally Posted by bmann_420 (Post 1040646)
Crap nuggets, somehow nextmap.amxx got disabled. It seems to work now.. One of those days.

I see the max mods in the vote is 10, but the menu is 5, and their is no next page?

Yeah, not a "paged" menu. It's just like mapchooser.

bmann_420 01-02-2010 21:01

Re: Polymorph: Mod Manager
 
Alrighty :D So per say, map configs. How would we go about doing that? Use map configs as a regular and it will just simply enabled what needs to be or do they need to be put somewhere else? (plugins & cvars per map)

fysiks 01-02-2010 21:27

Re: Polymorph: Mod Manager
 
Quote:

Originally Posted by bmann_420 (Post 1040804)
Alrighty :D So per say, map configs. How would we go about doing that? Use map configs as a regular and it will just simply enabled what needs to be or do they need to be put somewhere else? (plugins & cvars per map)

I really have no clue what you just said lol.

Jack86 01-02-2010 22:06

Re: Polymorph: Mod Manager
 
I think he wants to know does he need to put his map specific cvars and plugins from per-map configs in polymorph.ini in [cfg] and [plugins ] sectors , or they can be read normally from their curent files.

What i would like to see is edit of poly_mode cvar so it has an option like current 0 or 1 but without any map votes, it just goes on one mod following mapcycle (or even better, maps listen under that mods mapsfile maps.ini) until its manually changed or it follows mapcycle (or as stated in first example) for X maps then changes mod but without any autovotes for mapchange.


All times are GMT -4. The time now is 19:36.

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