[L4D2] Improved Automatic Campaign Switcher (ACS) [v2.3.0 (20201024)]
3 Attachment(s)
Automatic Campaign Switcher Supports the Last Stand update 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! 4. acs_next_map_menu_options: Controls the maps shown in the next map voting menu [0 = Official and addon maps(Default), 1 = Official maps only, 2 = Depending on the type of the current map ] 5. acs_next_map_menu_excludes: Excludes certain map(s) from the map voting menu [0 = Nothing(Default), 1 = Current map ] 6. acs_next_map_menu_order: Controls the order of maps shown in the next map voting menu [0 = Official then addon maps(Default), 1 = Random ] 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. SilentBr's suggestions were implemented by acs_next_map_menu_options, acs_next_map_menu_excludes and acs_next_map_menu_order. Thanks 'D4rk56' for providing French translation files! French translation files can be found on the github page above. Discord channel: https://discord.gg/8gAmutR Latest: acs_v2.3.0.zip |
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 |
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. |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
Quote:
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. |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
Quote:
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? |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
Quote:
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 |
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.
|
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 |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
Hi everyone, the new ACS with automatic campaign/map list system is complete!
|
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. |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
What file am I missing here exactly:
Code:
L 07/06/2018 - 03:57:43: [L4D2_missionmanager.smx] An error occured while parsing maps.phrases.txt(English), code:1 Also would be good if you added the auto reset to defined map/change maps when server is empty for x amount of time. |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
The problem is that I didn't buy L4D1, there no way for me to test it. However in theory this plugin should be compatible with L4D, as long as the campaign/map list can be correctly generated. |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
PHP Code:
To localize map names, your "maps.phrases.txt" should be something like: PHP Code:
Sorry I forgot to mention this in the intro Quote:
|
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
2 Attachment(s)
Both .sp files failed to compile. The reason is that you didn't parenthesize the values that you were using the view_as operator for.
Before: view_as<something>something2 After: view_as<something>(something2) I also replaced all the "FCVAR_PLUGIN" plugin stuff with an underscore since they're deprecated. Another thing I did was add #pragma newdecls required to both plugins. For acs.sp, you didn't add "void" for the ConVar.AddChangeHook callbacks and other things like OnMapStart and OnPluginStart. You also didn't add "int" for the MenuHandler. Before: public VoteMenuHandler After: public int VoteMenuHandler Aside from that, everything checks out so far, though I do see a lot of hard-coded stuff that could easily be shortened/fixed by Silvers' suggestion. I second his suggestion since it really will reduce all those mutations to like around 25-30 lines of code and will support all mutations including custom ones. This is the one that Silvers is suggesting. PHP Code:
|
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
For transforming the syntax, the thing I did is to remove things like : and decl, and change const String:xxx[] to const char[] xxx. I forget to add return/parameter types as required by the new syntax. I'm really appreciate that you point out these problems :) |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
I use SM 1.8.0.6048 (latest stable build). I don't use the unstable builds.
|
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
|
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
|
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
2. If you are using Linux, permission can cause trouble, so make sure that "mission.cache" is writable by the current user (the one you used to launch srcds). Try "chmod -R 777 mission.cache" 3. A screen shot might be helpful |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
https://imgoat.com/uploads/0a080f42e6/121466.jpg |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
Or look at Dragokas' batch converter which uses the above two. Saves a lot of time and does nearly everything. |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
Your plugin is working now, without any problems. The plugin (not ACS, but l4d2_mission_manager handles name localization) attempts to find the localized mission(campaign) name from "translations/missions.phrases.txt". If localized name can not be found, then the plugin will directly use the name of the mission which is the names you see on the menu. (which is also used by srcds to match servers) In your case, "Questionable Ethics 1" is localized because I have already written it into "missions.phrases.txt". You can edit "missions.phrases.txt" and append localized names for 3-rd party maps. e.g. PHP Code:
Since 3-rd party map VPK does not support multi-language, the display name of the VPK can be in any language, so the plugin does NOT automatically add them to "translations/missions.phrases.txt". |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
I see the mission.cache folder now. Was looking for a file initially, should have looked closer. So, regardless I should edit missions.phrases.txt in order to change how the missions appear in the menu?
|
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Just got an auto error code 6 upon mapswitch... not sure what the cause is but I timed out while loading the next campaign.
|
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
you can try "sm_lmm_list invalid" to see is there any invalid map on the server. |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
The plugin works great, congratulations for the work.
No need to edit the .sp file anymore and extraordinary. But unfortunately it has a serious problem for me. Why let the player be able to open a vote to exchange maps and campaigns in any part of the game. this is a big problem. The correct would be only automatic voting always and only in the final maps of each campaign. And if the player wants to change his vote, also only in final campaigns. Not in any part of the campaign. I also think I should not have the option to change the map, it should be only campaigns. But it's an incredible job. congratulations |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
-Voting should be campaign finale or anytime voting but with cooldown (IE, call vote once a campaign so players actually go through it). -There's no visibility for which campaign is winning in terms of votes. Should be able to see votes in the menu somewhere. |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
I suggest adding/editing 3 commands:
acs_vote - Allow someone to start a vote on finale maps. Cool down can be determined via a cvar like "acs_vote_cooldown" acs_votes - Allow someone to check the current campaign winner during finale maps as many times as they want. Can be enabled/disabled via a cvar like "acs_show_winner" acs_forcevote - Allow admins to force-vote a campaign as the winner. Can be enabled/disabled via a cvar like "acs_admin_force" As Mi.Cura and Mr. Man suggested, voting should only ever be on finales. And if players fail a map X times, even if it's not a finale, let the plugin automatically switch. Can be determined via cvars like "acs_max_failures" and "acs_auto_switch" |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
I use the version Version 1.2.3 of Krufftys Killers until today. https://forums.alliedmods.net/showpo...&postcount=154. But I have to edit .sp.
And the vote only occurs only in the final maps, automatically, the vote can be reopened only to change your vote. The Vote is only for the next Campaign in Coop mode. It should only be in the final maps. Older commands continue to work fine: !mapvote: Allows manual voting if the player wants to change his vote. !mapvotes - Show the total votes. Always on the final maps. |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
One more thing - the server is suddenly switching campaigns all over the place; I was on a custom map and the server suddenly switched over to Dead Center without warning. Also a big problem with ChrisP's original plugin was the lack of campaign/survival map separation, meaning it's currently unclear if switching from campaign to survival maps what the next set of choices are.
So, the logic overall should be this For campaigns: on finale map -> initiate map vote for mode -> coop/survival -> voting is in progress -> if nobody votes, the current gamemode stays and forces change to the next mission (defined in ?) For survival: on round start, continue playing until the max # of times the map can fail as defined in .cfg -> initiate map vote for mode the round before failure -> coop/survival -> voting in progress ->if nobody votes, the current gamemode stays and the current map is restarted. If you want campaign to flow, you can remove the vote mode and instead vote for a new map. |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
Quote:
Quote:
To disable this feature, set "acs_prevent_empty_server" to 0. :) Update: I forget to check the number of players when switching from an addon map, this will switch to c1m1_hotel when someone disconnects even if there are human players on the server. This problem has been fixed: https://github.com/rikka0w0/l4d2_mis...a0e494618a46e4 |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Thanks, will test some more. Also, what's the difference between these two commands:
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. I also was able to call a vote with !chmap in the middle of a game with 2 players and force change map... without the others being able to vote (shows 100% of 1 vote right after I called it) - that isn't really voting then? |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
That's dangerous since trolls and griefers can just use that command per map and force the server to change maps/campaigns whenever they want as long as nobody else votes.
|
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Correct, so unfortunately I've had to take this version off my server and revert to ChrisP's old one.
|
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
I haven't had time to fully read how this plugin handles map listing/naming nor look at the entire code, so please correct me if I'm wrong at any point below.
I would like to recommend creating a KeyValues file that is automatically appended with mapnames as section names, and then creating keys in each section that allow users to customize settings per map. Of course, add a default value so that not all maps would need to be configured to work. Take a look at Super Tanks++ as an example on how to create and use data from a KeyValues file. When creating an automatic campaign/map switcher plugin, it can be a delicate process to make sure that players don't have to deal with hard-coded settings. In the original version, ChrisP had users editing the source code to add campaign maps/names. It IS possible to generate the map names automatically. The only things users would have to do are to assign the Campaign names and order of maps. Example: PHP Code:
The key elements to making this possible are: 1. ReadMapList() 2. KeyValues |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
I will add a convar to control its behavior: 0 - Disable !chmap and !chmap2 (Default value) 1 - Enable, not voted is treated as NO 2 - Enable, not voted is treated as YES |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Quote:
The order of campaigns are controlled by missioncycle.*.txt (e.g. "missioncycle.coop.txt" for coop mode), new maps will be appended to the end of that file (AUTOMATICALLY), removed/invalid maps will be ignored and the server console prompts the admin to remove them (MANUALLY). "missioncycle.*.txt" also allow admin to exclude certain maps from the campaigns cycle. However, currently there's no way of controlling the order of individual map. I'm thinking about introducing a "weight system" to control the order of maps. I still think altering map order is rarely required. I think it might be a good idea to add an admin command which adds missing entries to localization text files. (for campaign and map names) :) |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Sorry but I had a question.
Now the vote for the next campaign only appears in the final maps, do you confirm? |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
I dont understand.
Voting continues to appear anywhere in the game. It should only be on final maps. The rest works well, but this option of player open the vote on any map of powers to players who should not. This plugin would be great if it simply shows the voting for the next campaign, and only at the end of each map, and nothing else. The fact that it automatically adds the maps is incredible, but the option of !chmap and !campaign, I find it unnecessary, could it be removed? Admins can manage the exchange of maps with the plugin: l4d_campaign_manager.smx But for the other players they must use your pluguim (ACS), just my opinion :) |
Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
Now I'm not sure if the modification has already been made.
If it has not been done, please disregard my previous post. And I'll wait for the new version. |
All times are GMT -4. The time now is 05:47. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.