View Single Post
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 10-05-2018 , 20:34   [L4D1 & L4D2] Map changer with rating system
Reply With Quote #1

Description:
Campaign and mission (chapter) chooser with the rating system, groups and sorting.

Features:
  • automatic parsing of custom maps vpk files - no need to add map names manually! (since v2.0)
  • allows rating campaigns.
  • allows choosing a concrete map within the campaign.
  • allows to sort campaigns by rating.
  • provides 3 groups, where you can assign a map to (for your convenience).
  • vote for the map is displayed in a little menu (not in a default big black menu), so it does not interfere with the gameplay.
  • show current campaign / map name, current custom map number / and a total number of maps in the currently played campaign.
See the major functionality on screenshots attached.
Settings (data):
- addons/sourcemod/data/mapchanger_vote_block.txt - allows to specify player names or SteamId, you want to block access from voting specially.
- addons/sourcemod/data/mapchanger_black_cycle.txt - black list of map names, you want to exclude from automatic cycle.
Settings (ConVars):
Can be found in: cfg/sourcemod/l4d_mapchanger.cfg
PHP Code:
// Minimum delay (in sec.) allowed between votes
l4d_mapchanger_delay "60"

// How long (in sec.) does the vote last
l4d_mapchanger_timeout "10"

// Delay (in sec.) between announce and vote menu appearing
l4d_mapchanger_announcedelay "2.0"

// Number of seconds to display notify message before the actual change map
l4d_mapchanger_mapchange_notify_time "2"

// Display default maps menu items? (1 - Yes, 0 - No)
l4d_mapchanger_allow_default "1"

// Display custom maps menu items? (1 - Yes, 0 - No)
l4d_mapchanger_allow_custom "1"

// Show the list of chapters within campaign? (1 - Yes, 0 - No)
l4d_mapchanger_show_chapter_list "1"

// Short name of your server (specify it, if you want custom campaign name will be prepended to it)
l4d_mapchanger_servername_short ""

// Minimum number of players to allow starting the vote for mark
l4d_mapchanger_votemark_minplayers "3"

// Flag allowed to access the vote for change to default maps
l4d_mapchanger_default_voteaccess "kp"

// Flag allowed to access the vote for change to custom maps
l4d_mapchanger_custom_voteaccess "k" 

// Flag(s) allowed to veto/votepass the vote
l4d_mapchanger_vetoaccess "d"

// Allow VIP players to change the map? (1 - Yes, 0 - No)
l4d_mapchanger_vip_voteaccess "1"

// Flag(s) allowed to start the vote for mark (rating). Leave empty to allow everybody.
l4d_mapchanger_votemark_access ""

// Flag(s) allowed to remove the rating.
l4d_mapchanger_remove_mark_access "z"

// 0 - Don't change finale map (drop to lobby); 1 - instant on vehicle leaving; 2 - instant on finale win; 4 - Wait till credits screen appear; 8 - Wait till credits screen ends (values can be combined)
l4d_mapchanger_finale_change_type "12"

// Which next campaign to use (on finale chapter of standard campaign)? (0 - next standard, 1 - random standard)
l4d_mapchanger_nextmap_on_standard "1"

// Which next campaign to use (on finale chapter of custom campaign)? (0 - next standard, 1 - random standard, 2 - next custom, 3 - random custom)
l4d_mapchanger_nextmap_on_custom "3"

// Print map change info to server console? (1 - Yes, 0 - No)
l4d_mapchanger_server_print_info "1" 
Following ConVars control the behaviour of native (black screen) votes:
Spoiler


Additional ConVars, if you have:
  • installed DragoStats by Dragokas
  • hx_stats.inc file in /scripting/include folder of your local compiler
PHP Code:
// Minimum points in statistics system required to allow start the vote
l4d_mapchanger_vote_stat_points "10000"

// Minimum play time (in minutes) in statistics system required to allow start the vote
l4d_mapchanger_vote_stat_playtime "600" 
Commands:
PHP Code:
// Show map list to begin vote for changelevel / set mark etc.
!maps

// Force change level to the next map (for Root admin)
!mapnext
!next

// Refresh the list of maps
!maps_reload

// Allow admin to veto current vote
!veto

// Allow admin to bypass current vote
!votepass 
Supported games:
- L4D1.
- L4D2.
Supported game modes:
- Coop
- Versus (since v3.0)
- Survival (since v3.0)
Using:
- Copy contents of archive to addons/sourcemod/

* You don't need anything to setup. Everything is automated:
- cutom maps is parsed automatically.
- map cycle is run by alphabet or in random order (depending on ConVar settings).
Dependency:
- Localizer.inc - #phrases translator (included)
- SourceMod v1.10+
Recommended plugins:
[ANY] Restart Empty Server (or Map)
Integrated functions from plugins:
VIP Core by R1KO
DragoStats Coop by Dragokas
Conflicting plugins:
- Automatic Campaign Switcher (ACS)
- Listen servers are supported, however, not recommended. Fixing their bugs is on your own.
- Force mission changer plugins and similar (because Map Changer is already include this functionality).
References
- [L4D1 & L4D2] Votekick (no black screen)
- [L4D1 & L4D2] Vote difficulty (no black screen)
- [L4D1 & L4D2] Votemute (no black screen)
- [L4D1 & L4D2] DragoStats Coop
ChangeLog


Translations:
- English (from @Dragokas)
- Russian (from @Dragokas)
- Ukrainian (from @Dragokas)
- Traditional Chinese (from @in2002)
- Simplified Chinese (from @sorallll)
Credits:
- @Marttt - for the listen server client detection stock
- @komashchenko - for UTF8 strings stock
Thanks to people, involved in Localizer project:
- @Externet - for the most amazing IDE BasicPawn and its excellent support, which has greatly simplified the development of this include.
- @Wend4r and @KyleSanderson - for suggesting walkaround against IDatabase leak while too many single threaded queries are queued.
- @asherkin - for explaining multiple DB result sets (no, they aren't used here), influencing on correct Lock/Unlock usage.
- @R1KO & @CrazyHackGUT - for the manual and comments on various database stuff.
TODO:
- API
- RTV (to vote for next campaign)
- Replace shitty bugged Valve KeyValues class (e.g. using MemoryEx), causing constant issues with letter case and writing chinese+ANSI mixed strings, like these.
- Improve Localizer speed using Silver's VPK_API
Donate
Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
- Patreon
- BitCoin
- Ю.Money
FAQ:
Quote:
Q: How do I change group (category) of custom map?
A: 1) Run client, enter !maps, select desired map, than item "Move to another group", select group.
Or for mass-change:
2) Go to file: configs/MapChanger_info.txt and change value of "group" key to 0, 1 or 2 (index of category) without map change when client logged-in, than enter command "sm_maps_reload" on client or, alternatively, do this change with the server powered off.

Q: I added VPK, but I don't see it in the list. What should I do?
A: 1) Restart the server (preferably) or enter command sm_maps_reload
2) If it doesn't work, you may have a conflict between maps. Try delete everything (or move all vpk-s into subfolder), than return files back one by one with the step by step testing.
3) If you have addonlist.txt file on your server (in the root folder of the game), check isn't this map specially disabled there.
4) Try re-download vpk from official server, and re-upload the vpk file.
5) Maybe the particular map is too outdated and no longer can work in the latest game version, ask developer or in community.

Q: Is there !rtv functionality to be able vote for next map?
A: No. It is planned to implement in the far future.

Q: Can I use !rtv functionality from another map changer plugin?
A: Yes, but it is highly not recommended and is not supported. Anyway, if you do so, you should set ConVar "l4d_mapchanger_finale_change_type" to "0" or to "8" to prevent MapChanger from forcing change finale map too early.

Q: How can I change/correct !maps menu items text according to my preference?
A: Edit file: translations/MapChanger.phrases.txt
P.S.:
- Project and updates discontinued. Don't ask.
Attached Images
File Type: jpg 1.jpg (27.8 KB, 2668 views)
File Type: jpg 2.jpg (54.5 KB, 2156 views)
File Type: jpg 3.jpg (32.3 KB, 1911 views)
File Type: jpg 4.jpg (34.5 KB, 1687 views)
File Type: jpg 8.jpg (45.4 KB, 1802 views)
Attached Files
File Type: zip MapChanger_3.X.zip (94.7 KB, 625 views)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 07-02-2023 at 22:19.
Dragokas is offline