AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Improved Automatic Campaign Switcher (ACS) [v2.0.0 (20181007)] (https://forums.alliedmods.net/showthread.php?t=308708)

rikka0w0 06-30-2018 12:38

[L4D2] Improved Automatic Campaign Switcher (ACS) [v2.0.0 (20181007)]
 
1 Attachment(s)
Automatic Campaign Switcher

This version of Automatic Campaign Switcher is based on ChrisP`s original version (v1.2.2), which is available here: https://forums.alliedmods.net/showthread.php?t=156392

Introduction
Automatic Campaign Switcher, or ACS, was written as an easy way to keep the Left4Dead 2 default map rotation going on a server without people being booted because the vote to restart a campaign was not passed. I also tried to write ACS in such a way that it would be easy to change for those who wish to edit the source to have custom campaigns and maps in l4d2 as well. If you decide not to edit the files, then ACS will cycle through maps in chronological order corresponding to the L4D story timeline. ACS also includes a voting system in which people can vote for their favorite campaign/map on a finale or scavenge map. The winning campaign/map will become the next map the server loads.

Installation
This plugin requires "L4D2 Mission Manager" to work, which can be found here: http://forums.alliedmods.net/showthread.php?t=308725
There's a simple way to install, just unzip "acs_ready_to_go.zip" to your "left4dead2/addons/sourcemod" folder. "L4D2 Mission Manager" is included.

Features
The improved version inherits all features of the original version, with several advanced feature added:
1. Adding new maps no longer requires modification and recompiling of the sp file, the plugin automatically finds them. No more hard coding
2. A new map voting system is introduced, players can use "!chmap" to initiate a vote if they want to change the map immediately.
3. A new command "!chmap2" allows players to vote when they want to switch to any map available on the server, even the target map is not the first map of a campaign.

4. Better localization support, messages, menus and map names can now be displayed in client`s language
5. Bug fixes, e.g. the original version uses a wrong way to load CVars.
6. Prevent an empty server running 3-rd maps
7. [New Feature] A new admin menu for changing maps, located in Admin menu -> Server Commands (Added upon the request of Mi.Cura, file: l4d2_mm_adminmenu.smx)

Note: For security reasons, "!chmap" and "!chmap2" are disabled by default to prevent griefers' misuse, see CVar "acs_chmap_policy".

Console Variables (CVars)
Most of them have exactly the same definition as the original version, (please refer to ChrisP`s original post), except three new CVars:
1. acs_chmap_broadcast_interval, controls the frequency of the "!chmap" advertisement
2. acs_prevent_empty_server, if enabled, the server automatically switch to the first available official map when no one is playing a 3-rd map
3. acs_chmap_policy, set to 0 disables "!chmap" (by default), set to 1 enables "!chmap" and treats abstention as NO, set to 2 enables "!chmap" and treats abstention as YES. In most case, DONT set it to 2!

Map/campaign List Configuration
"l4d2_mission_manager" provides information about maps and campaigns, this is fully automatic. After parsing all mission text files cached by "l4d2_mission_manager", the plugin will load "left4dead2/addons/sourcemod/configs/missioncycle.*.txt", if not exist, the plugin will create one. (* can be coop/versus/scavenge/survival) Any new installed maps will be appended to the end of "missioncycle.*.txt". The order of entries in "missioncycle.*.txt" controls the order of map cycle.
Invalid entries (e.g. removed campaign) in "missioncycle.*.txt" will be ignored and printed on the server console.
Some maps can be excluded from the map cycle, see "missioncycle.*.txt" for more information, those maps can only be loaded via "!chmap" and after the finale map the server loads the first map in the map cycle.

Map/campaign Name Localization
The localized campaign names are in "left4dead2/addons/sourcemod/translations/missions.phrases.txt" or "left4dead2/addons/sourcemod/translations/chi/missions.phrases.txt", depends on the language. If a campaign is not in "left4dead2/addons/sourcemod/translations/missions.phrases.txt", the name in "missioncycle.*.txt" will be used for display. If a campaign is listed in "left4dead2/addons/sourcemod/translations/missions.phrases.txt", the plugin will attempt to display the campaign name in the client`s language, (for Simplified Chinese, is "left4dead2/addons/sourcemod/translations/chi/missions.phrases.txt"), if fails then display the English name.

TODO & Known problems
1. Map/Campaign cycle randomizer
2. (Reported by Mr. Man) Some finale maps aren't triggering the mapvote function. (Although it does not affect default map cycle) The cause is under investigation
After including Lux's patch in the latest release, it should be fixed!

Latest source code is available on Github: https://github.com/rikka0w0/l4d2_mission_manager

This plugin has been proved stable in coop mode on my server.
nandofs's and Mr. Man's problem has been fixed, Silvers' suggestion is still under consideration.

Thanks 'D4rk56' for providing French translation files! French translation files can be found on the github page above.

nandofs 06-30-2018 15:01

Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
 
The server I have is the VERSUS mode.
I'm testing your add-on and I found a problem
I followed all the instructions to install it correctly.
However, the problem continues.
When we reach the end of the campaign, we vote for the next campaign, but the campaign does not change and the server automatically restarts and takes us out of the server.
http://subirimagen.me/uploads/20180630140005.jpg
http://subirimagen.me/uploads/20180630140031.jpg
http://subirimagen.me/uploads/20180630140050.jpghttp://subirimagen.me/uploads/20180630140108.jpg

Crasher_3637 06-30-2018 16:16

Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
 
I can't wait to check out the source code of this. I'll happily help you improve this plugin along the way. :D

Maybe consider making a GitHub repository for this? It'd be easier since I can make pull requests.

rikka0w0 07-01-2018 05:53

Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
 
Quote:

Originally Posted by Crasher_3637 (Post 2600177)
I can't wait to check out the source code of this. I'll happily help you improve this plugin along the way. :D

Maybe consider making a GitHub repository for this? It'd be easier since I can make pull requests.

All contributions are welcomed!
To solve nandofs's problem, a lot of code need to be reworked. There is a design flaw in the original plugin.
Currently my plan is to make the map list parser into a separate plugin, called "L4D2 Mission Manager", github repo: https://github.com/rikka0w0/l4d2_mission_manager, it eases the maintenance of the plugin and also allows other mod to reuse the code.

It will take some time before the plugin becomes fully functional for versus and survival modes.

rikka0w0 07-01-2018 05:56

Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
 
Quote:

Originally Posted by nandofs (Post 2600160)
The server I have is the VERSUS mode.
I'm testing your add-on and I found a problem
I followed all the instructions to install it correctly.
However, the problem continues.
When we reach the end of the campaign, we vote for the next campaign, but the campaign does not change and the server automatically restarts and takes us out of the server.

Thanks for your feedback.
Sorry I cant read Spanish, which mode are you playing? Is that the original versus mode or it is a mutation mode similar to versus mode? It will be helpful for my debugging if you can provide some segment of the server console output~:)

BTW how do you add the developer console option to the game menu?

nandofs 07-01-2018 13:24

Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
 
Quote:

Originally Posted by rikka0w0 (Post 2600266)
Thanks for your feedback.
Sorry I cant read Spanish, which mode are you playing? Is that the original versus mode or it is a mutation mode similar to versus mode? It will be helpful for my debugging if you can provide some segment of the server console output~:)

BTW how do you add the developer console option to the game menu?

I'll tell you what the problem is, in the best possible way, since I'm not very good at English.
I am playing the original VERSUS mode, everything is fine, the voting menu of the campaigns appears, we select the campaign and we can only hope it ends until all the survivors escape or die, the rematch vote begins but nobody votes, after 5 to 10 seconds, the server votes us and restarts, without changing the campaign.
I hope you understand my explanation :P

Silvers 07-01-2018 14:38

Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
 
Instead of FindGameMode() and hard coding gamemode strings, take a look at any one of my plugins which add "_modes_tog" cvar, simple way to detect for any mutation/mode.

nandofs 07-01-2018 23:33

Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
 
Excellent friend with this update worked for me.
I just had to change the delay from 6 seconds to 5 seconds.
so that I can change correctly.


before
//Define the wait time after round before changing to the next map in each game mode
#define WAIT_TIME_BEFORE_SWITCH_COOP 7.0
#define WAIT_TIME_BEFORE_SWITCH_VERSUS 6.0
#define WAIT_TIME_BEFORE_SWITCH_SCAVENGE 11.0

now
//Define the wait time after round before changing to the next map in each game mode
#define WAIT_TIME_BEFORE_SWITCH_COOP 7.0
#define WAIT_TIME_BEFORE_SWITCH_VERSUS 5.0
#define WAIT_TIME_BEFORE_SWITCH_SCAVENGE 11.0

rikka0w0 07-06-2018 03:38

Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
 
Hi everyone, the new ACS with automatic campaign/map list system is complete!

Crasher_3637 07-06-2018 03:49

Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
 
Congrats. :)

I haven't had the time to convert the source code to the new syntax yet. I could probably shorten the code by 50-100 lines once I convert it.

And maybe we can work together to add L4D1 support.


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

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