Raised This Month: $7 Target: $400
 1% 

NextMap with Sven Co-op Fix


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Sven Coop        Category:   Server Management       
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 11-27-2007 , 13:36   NextMap with Sven Co-op Fix
Reply With Quote #1

Warning: As of Sven Co-op 5.22 (released 16th January 2020) this plug-in is no longer relevant, and should not be used.

Thank you for your interest, however since 13 years ago when I built this fix I've had the opportunity to make the corrections outlined by this plug-in in the Sven Co-op game server code directly. Therefore this plug-in is no longer necessary and may in fact even conflict with the game's base functionality.

You may instead be interested in manipulation of a Sven Co-op game server CVAR, mp_nextmap_cycle. The game server will populate this with the map it intends to cycle to next. It will not advance position in the cycle until the map specified is running. That means cycle interruptions such as map votes, manual "changelevel", and series-link maps (e.g. svencoop1 to svencoop2) should no longer be a problem.


Description

I've spent a lot of time modifying the original nextmap plugin, and fixed it to work with Sven Co-op map cycles.

The differences are mainly to only increment the map cycle position when the map at the current position is being played, so map series do not cause maps in the cycle to get skipped. It also allows the nextmap cvar that some maps decide to use work, and still not skip maps.

I've commented around stuff I've added/changed.

Worth mentioning: I have not designed or tested this plugin in any other game than Sven Co-op. Although it may appear to work, I highly recommend you do not use it on a live public or private server for any other game than Sven Co-op.


Installation

Ensure you comment out the original nextmap.amxx in your plugins.ini. Place my nextmap_sven.amxx in the same plugins folder (or anywhere you want really) and add a new line for nextmap_sven.amxx underneath the commented out nextmap.amxx line.

I do not recommend you overwrite the original nextmap.amxx in case you have problems with this modified one. However, you can set amx_nextmap_svenfix to 0 to disable my modifications without having to load the original plugin. It is 1 by default, you do not need to specify that to any configuration file.

If you want to use the new feature that will randomize selections through your map cycle, you also need to define CVAR amx_nextmap_random with value 1. This feature is disabled by default to prevent confusion for those of you updating blindly. If you are going to use this feature then you should also have a large map cycle to go with it for best results. (really, 50+ maps) This will greatly improve the fresh/unpredicted experience your players will get.

Please let me know if this plugin works properly on your server. I suggest you test it out with map series, keeping note of your cycle. Some test procedures and an overview of the original problem can be found here.


Updates

1st/Feb/2012
  • Added functionality to send the next map to player score boards (for Sven Co-op 4.5 and later).
  • Also changed CVAR's to pointer CVAR's.


26th/Jan/2013
Sorry for the long publish delay...
  • New feature: Option to choose a next map at random, instead of progress through the cycle in a linear fashion.
    The currently and previously played map from the cycle (oh yes, taking into account Sven Co-op multimaps) are excluded from selection.
    This feature requires 3+ maps in the cycle, and is disabled by default to prevent confusion. Set CVAR "amx_nextmap_random" to 1 to enable this feature.
  • New feature: Command to choose a new map "amx_nextmap_choose [map]".
    Using this command will let you specify the next map manually, or if the parameter is left blank choose one from the cycle at random. Doing so via this command will also update the next map on the scoreboard.
    Default access is ADMIN_MAP.
  • New feature: The map being loaded is now shown when the intermission scoreboard appears.
Back-end changes of which won't be noticed by players:
  • Added more comments so other people can see what's going on more.
  • Cleaned up log/console outputs.
  • Made more use of pointer CVAR's.
  • Moved a lot of common functionality into re-usable functions.
  • More meaningful variable names.
Attached Files
File Type: sma Get Plugin or Get Source (nextmap_sven.sma - 2255 views - 12.7 KB)
File Type: sma Get Plugin or Get Source (nextmap_sven_20120201.sma - 1856 views - 8.2 KB)
__________________
Thanks,

Adam Reece - Sven Co-op team.

Last edited by AdamR; 08-05-2021 at 13:32. Reason: Update: 26/Jan/2013
AdamR is offline
Send a message via Skype™ to AdamR
iggy_bus
BANNED
Join Date: Oct 2005
Old 11-28-2007 , 16:14   Re: NextMap with Sven Co-op Fix
Reply With Quote #2

I have a question.

In original nexmap there is one thing that I hate.

For example, if current map is de_cbble, and next two maps in mapcycle.txt are de_aztec, de_dust2...and admin comes on the current map (de_cbble) and gives vote for de_dust2, and it passes, he accepts and changes to de_dust2 that has been voted, then nexmap is again de_dust2 because it was in mapcycle.txt

Is this fixed in your modification so the real next map (in my example de_aztec) would not be skipped if there has been a vote accepted?
iggy_bus is offline
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 11-28-2007 , 16:50   Re: NextMap with Sven Co-op Fix
Reply With Quote #3

Yes, in theory, my modification would notice that aztec isn't being played so it would hold the map cycle position until it is played.

Remember: I have not designed or tested this for any other game than Sven Co-op, therefore I do not recommend using this plugin in a live public/private server for any other game.
__________________
Thanks,

Adam Reece - Sven Co-op team.
AdamR is offline
Send a message via Skype™ to AdamR
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 01-16-2008 , 14:09   Re: NextMap with Sven Co-op Fix
Reply With Quote #4

I've just noticed this plugin has been approved. Thank you Zenith77
__________________
Thanks,

Adam Reece - Sven Co-op team.
AdamR is offline
Send a message via Skype™ to AdamR
Nomble
Junior Member
Join Date: Aug 2004
Old 03-09-2008 , 13:50   Re: NextMap with Sven Co-op Fix
Reply With Quote #5

Hello, I'm still having problems with the nextmap. Right now when I type in the console "nextmap" it says the correct nextmap. But when I type it in chat it says wrong and it still changes to the wrong one!
Nomble is offline
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 03-09-2008 , 18:27   Re: NextMap with Sven Co-op Fix
Reply With Quote #6

If a map calls a new map via the game_changelevel entity, this plugin has no control over that. It can only remember that the next map that should have been played will still show as next, and be run when possible.
__________________
Thanks,

Adam Reece - Sven Co-op team.
AdamR is offline
Send a message via Skype™ to AdamR
cartman-2000
Member
Join Date: Aug 2007
Old 04-23-2008 , 22:43   Re: NextMap with Sven Co-op Fix
Reply With Quote #7

This doesn't work on some maps, afrikakorps1 for example, it still goes to the next map in the mapcycle and not the next one in the series. The thing I've noticed is the the map config (that has the nextmap cmd for afrikakorps2) gets executed before this mod does. so this mod still sets the nextmap to what it's not suppost to be set to. Is it posible to add code to the mod to reexecute the maps cfg file after this mod is done on map start.
cartman-2000 is offline
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 04-24-2008 , 04:55   Re: NextMap with Sven Co-op Fix
Reply With Quote #8

No idea why, it's executing at the right time for me. You might need a plugin to execute the map config file again.
__________________
Thanks,

Adam Reece - Sven Co-op team.
AdamR is offline
Send a message via Skype™ to AdamR
cartman-2000
Member
Join Date: Aug 2007
Old 04-24-2008 , 17:18   Re: NextMap with Sven Co-op Fix
Reply With Quote #9

can't find one that does only that. But would adding something like this to the end of plugin_init in this plugin fix this?

server_cmd("exec maps/%s.cfg", g_currentMap);

[edit]
seems to work fine.
[/edit]


[edit again]
actually, it doesn't work if you put deagles map management plugin on the server, that plugin sets the map at the start of the map too.

by putting this line into the end of plugin_init

set_task(6.0, "execmapcfg")

and moving the server_cmd line in this post into it's own function will fix this.

like:
public execmapcfg()
{
server_cmd("exec maps/%s.cfg", g_currentMap);
}

[/edit]

Last edited by cartman-2000; 05-15-2008 at 21:20.
cartman-2000 is offline
cartman-2000
Member
Join Date: Aug 2007
Old 04-28-2008 , 21:04   Re: NextMap with Sven Co-op Fix
Reply With Quote #10

Would it be possible to have a random nextmap, instead of having a sequential nextmap. I'm in the process of adding maps to my server and the mapcycle position usually gets reset before it reaches the end, so the maps at the end of the mapcycle rarely get played and the ones in the beginning of the mapcycle get played to much.

Last edited by cartman-2000; 04-28-2008 at 21:06.
cartman-2000 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 07:29.


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