Raised This Month: $12 Target: $400
 3% 

[L4D2] Improved Automatic Campaign Switcher (ACS) [v2.3.0 (20201024)]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
rikka0w0
Member
Join Date: May 2018
Location: Sydney, Australia / Beij
Plugin ID:
6182
Plugin Version:
2.3.0
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    An improved version of ChrisP`s Automatic Campaign Switcher
    Old 06-30-2018 , 12:38   [L4D2] Improved Automatic Campaign Switcher (ACS) [v2.3.0 (20201024)]
    Reply With Quote #1

    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
    Attached Files
    File Type: zip acs_ready_to_go.zip (81.4 KB, 2344 views)
    File Type: zip acs_ready_to_go_2_1_1.zip (100.5 KB, 1845 views)
    File Type: zip acs_v2.3.0.zip (92.9 KB, 2576 views)

    Last edited by rikka0w0; 10-25-2020 at 11:33. Reason: Support the Last Stand update
    rikka0w0 is offline
    nandofs
    Junior Member
    Join Date: Aug 2017
    Old 06-30-2018 , 15:01   Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
    Reply With Quote #2

    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.


    __________________
    --------------------------------------------------------------------------
    I'm not good with English, I use Google's translator. : 3
    But if I understand Spanish perfectly : 3
    --------------------------------------------------------------------------
    nandofs is offline
    rikka0w0
    Member
    Join Date: May 2018
    Location: Sydney, Australia / Beij
    Old 07-01-2018 , 05:56   Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
    Reply With Quote #3

    Quote:
    Originally Posted by nandofs View Post
    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?

    Last edited by rikka0w0; 07-01-2018 at 05:59.
    rikka0w0 is offline
    nandofs
    Junior Member
    Join Date: Aug 2017
    Old 07-01-2018 , 13:24   Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
    Reply With Quote #4

    Quote:
    Originally Posted by rikka0w0 View Post
    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
    __________________
    --------------------------------------------------------------------------
    I'm not good with English, I use Google's translator. : 3
    But if I understand Spanish perfectly : 3
    --------------------------------------------------------------------------
    nandofs is offline
    Psyk0tik
    Veteran Member
    Join Date: May 2012
    Location: Homeless
    Old 06-30-2018 , 16:16   Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
    Reply With Quote #5

    I can't wait to check out the source code of this. I'll happily help you improve this plugin along the way.

    Maybe consider making a GitHub repository for this? It'd be easier since I can make pull requests.
    __________________
    Psyk0tik is offline
    rikka0w0
    Member
    Join Date: May 2018
    Location: Sydney, Australia / Beij
    Old 07-01-2018 , 05:53   Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
    Reply With Quote #6

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

    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 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 07-01-2018 , 14:38   Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
    Reply With Quote #7

    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.
    __________________
    Silvers is offline
    nandofs
    Junior Member
    Join Date: Aug 2017
    Old 07-01-2018 , 23:33   Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
    Reply With Quote #8

    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
    __________________
    --------------------------------------------------------------------------
    I'm not good with English, I use Google's translator. : 3
    But if I understand Spanish perfectly : 3
    --------------------------------------------------------------------------

    Last edited by nandofs; 07-01-2018 at 23:35.
    nandofs is offline
    rikka0w0
    Member
    Join Date: May 2018
    Location: Sydney, Australia / Beij
    Old 07-06-2018 , 03:38   Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180701)]
    Reply With Quote #9

    Hi everyone, the new ACS with automatic campaign/map list system is complete!
    rikka0w0 is offline
    Psyk0tik
    Veteran Member
    Join Date: May 2012
    Location: Homeless
    Old 07-06-2018 , 03:49   Re: [L4D2] Improved Automatic Campaign Switcher (ACS) [v1.9.0 (20180706)]
    Reply With Quote #10

    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.
    __________________

    Last edited by Psyk0tik; 07-06-2018 at 03:49.
    Psyk0tik 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 20:56.


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