AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   NextMap with Sven Co-op Fix (https://forums.alliedmods.net/showthread.php?t=63695)

AdamR 11-27-2007 13:36

NextMap with Sven Co-op Fix
 
2 Attachment(s)
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.

iggy_bus 11-28-2007 16:14

Re: NextMap with Sven Co-op Fix
 
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?

AdamR 11-28-2007 16:50

Re: NextMap with Sven Co-op Fix
 
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.

AdamR 01-16-2008 14:09

Re: NextMap with Sven Co-op Fix
 
I've just noticed this plugin has been approved. Thank you Zenith77 :)

Nomble 03-09-2008 13:50

Re: NextMap with Sven Co-op Fix
 
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!

AdamR 03-09-2008 18:27

Re: NextMap with Sven Co-op Fix
 
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.

cartman-2000 04-23-2008 22:43

Re: NextMap with Sven Co-op Fix
 
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.

AdamR 04-24-2008 04:55

Re: NextMap with Sven Co-op Fix
 
No idea why, it's executing at the right time for me. You might need a plugin to execute the map config file again.

cartman-2000 04-24-2008 17:18

Re: NextMap with Sven Co-op Fix
 
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]

cartman-2000 04-28-2008 21:04

Re: NextMap with Sven Co-op Fix
 
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.

AdamR 01-13-2009 11:49

Re: NextMap with Sven Co-op Fix
 
There are some issues with this working on Sven Co-op 4.0b1 if your 'mapcyclefile' CVAR is not the default 'mapcycle.txt'.

If you possibly know why, please inform this thread, thanks.

AdamR 05-20-2013 14:38

Re: NextMap with Sven Co-op Fix
 
Update

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.

Cheezpuff 05-25-2013 09:03

Re: NextMap with Sven Co-op Fix
 
There Have Votemap + rtv?

AdamR 05-25-2013 17:56

Re: NextMap with Sven Co-op Fix
 
Nope, that's not this plug-in's job. You want mapchooser or the map voting menu for that.

UchihaSkills 06-02-2013 13:37

Re: NextMap with Sven Co-op Fix
 
Quote:

Originally Posted by AdamR (Post 1958445)
Nope, that's not this plug-in's job. You want mapchooser or the map voting menu for that.

Hey i dont understand what is seven co-op :D?

Tonblader 02-21-2016 19:24

Re: NextMap with Sven Co-op Fix
 
it does not work on maps as:

crisis1
crisis2

hostage
hostage2a
hostage2b

grunts1
grunts2

war
war2
war3

AdamR 02-22-2016 13:29

Re: NextMap with Sven Co-op Fix
 
Not a bug.

Those maps are not all meant to be linked.

crisis1 and crisis2 are separate releases. The author stated that crisis1 came out after crisis2, and although the end of crisis1 is the start of crisis2, it's up to the mapper to make a trigger_changelevel correctly to the "next" map. Not for us to alter someone's creative work en masse.

hostage is completely different to hostage2a/hostage2b.

grunts1 is completely different to grunts2. Even though the description of grunts2 says it is preceded by grunts1, both maps have different authors and are over a year apart. Again like with crisis 1 & 2, the map authors decided not to link the maps together and it's not up to plug-ins to fill in gaps that aren't meant to be filled.

war/war2/war3 appears to be the same mission, but again it's up to the author to link them up when one map ends.

dany777 07-24-2021 10:19

Re: NextMap with Sven Co-op Fix
 
The vanilla amx nextmap plugin breaks the vote map system from Sven Coop always choosing the 1st map from the mapcycle.txt
I also tried your version but it seems that only wants to change to the map saying the actual nextmap from the chat.
In other words, not even that can fix.
I really need one of those 2 nextmap plugins so my amx_nextmap config files work for maps that i do want to be changed after certain maps.
Is there a fix for that?

AdamR 07-24-2021 17:21

Re: NextMap with Sven Co-op Fix
 
Quote:

Originally Posted by dany777 (Post 2753539)
The vanilla amx nextmap plugin breaks the vote map system from Sven Coop always choosing the 1st map from the mapcycle.txt
I also tried your version but it seems that only wants to change to the map saying the actual nextmap from the chat.
In other words, not even that can fix.
I really need one of those 2 nextmap plugins so my amx_nextmap config files work for maps that i do want to be changed after certain maps.
Is there a fix for that?

Oh, hey, people still use this plugin?

I fixed the nextmap oddness in Sven Co-op's own server code over a year ago. The nextmap fix from this should probably be disabled now, which can be done with amx_nextmap_svenfix set to 0.

dany777 08-05-2021 12:31

Re: NextMap with Sven Co-op Fix
 
Quote:

Originally Posted by AdamR (Post 2753567)
Oh, hey, people still use this plugin?

I fixed the nextmap oddness in Sven Co-op's own server code over a year ago. The nextmap fix from this should probably be disabled now, which can be done with amx_nextmap_svenfix set to 0.

Well.. sorry but even with the amx_nextmap_svenfix set to 0, i tried to vote for a map from the vote menu and it still goes to the map mentioned in the chat with which one will be next.
It always goes for the 1st one you put in the mapcycle.txt (Unless amx_nextmap it's used and still using the votemap menu, still goes for the map from the amx_nextmap)
Didin't did the fix for me.

AdamR 08-05-2021 13:23

Re: NextMap with Sven Co-op Fix
 
Quote:

Originally Posted by dany777 (Post 2754567)
Well.. sorry but even with the amx_nextmap_svenfix set to 0, i tried to vote for a map from the vote menu and it still goes to the map mentioned in the chat with which one will be next.
It always goes for the 1st one you put in the mapcycle.txt (Unless amx_nextmap it's used and still using the votemap menu, still goes for the map from the amx_nextmap)
Didin't did the fix for me.

Then I'd suggest not using this plug-in at all. It's highly outdated and, apart from mapcycle randomisation, only does fixes that are already present in the game as standard. If anything this plug-in will just create conflicts with the base game.

To quote the main purpose of this plug-in I wrote 14 years ago,
Quote:

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.
Sven Co-op now handles all of that itself correctly as of version 5.22 (January 2020). The changes I had made to this plug-in addressing that are no longer relevant.

In addition, the game server declares CVAR mp_nextmap_cycle and populates it with the map name that the server intends to cycle to next. If this doesn't happen either because of a vote to something else, a manual "changelevel", or because of a series-link map (e.g. svencoop1 to svencoop2), then the mp_nextmap_cycle value will not advance to the next entry in the cycle. Also the value of this variable is mirrored to all players periodically (typically when connecting and respawning) so the game client can show this on the scoreboard.

--

As of 19th August 2021 this plug-in is now out of the current/approved plug-in list.
(Thanks for moving this asherkin.)

dany777 08-05-2021 18:01

Re: NextMap with Sven Co-op Fix
 
Quote:

Originally Posted by AdamR (Post 2754574)
Then I'd suggest not using this plug-in at all. It's highly outdated and, apart from mapcycle randomisation, only does fixes that are already present in the game as standard. If anything this plug-in will just create conflicts with the base game.

To quote the main purpose of this plug-in I wrote 14 years ago,

Sven Co-op now handles all of that itself correctly as of version 5.22 (January 2020). The changes I had made to this plug-in addressing that are no longer relevant.

In addition, the game server declares CVAR mp_nextmap_cycle and populates it with the map name that the server intends to cycle to next. If this doesn't happen either because of a vote to something else, a manual "changelevel", or because of a series-link map (e.g. svencoop1 to svencoop2), then the mp_nextmap_cycle value will not advance to the next entry in the cycle. Also the value of this variable is mirrored to all players periodically (typically when connecting and respawning) so the game client can show this on the scoreboard.

Oh woow, i never knew about that CVAR.
Then i disabled your plugin and i tried that mp_nextmap_cycle command.. it works like a charm.
Well.. i guess this means that ill have to replace "amx"nextmap" from my config maps to "mp_nextmap_cycle"
Thanks alot for telling me about that command!


All times are GMT -4. The time now is 01:42.

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