AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D1 & L4D2] Map changer with rating system (https://forums.alliedmods.net/showthread.php?t=311161)

Dragokas 10-05-2018 20:34

[L4D1 & L4D2] Map changer with rating system
 
9 Attachment(s)
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.

mikaelangelis 10-05-2018 23:18

Re: [L4D] Map changer with rating system
 
Does this mean we can change custom map in admin menu?

Dragokas 10-06-2018 10:01

Re: [L4D] Map changer with rating system
 
Both admins and usual users are allowed to change default and custom maps (vote will be prompted).
Vote is displayed in a little menu (not in a default big black menu), so it does not interfere with the gameplay.

Dragokas 10-06-2018 14:35

Re: [L4D] Map changer with rating system
 
Updated to v.1.6
- Fixed non-essential error in menu handler

Dragokas 11-21-2018 03:32

Re: [L4D] Map changer with rating system
 
v.1.7 (2018/11/21)
- Added support of L4D2 (though, not tested).
- Added ability to see current played map/campaign display name.
- Added ability to vote for setting mark on campaign by non-privilaged users
(new settings "g_iClientsToVoteMark" - to set minimum number of clients to start the vote for mark).
- Added restriction to run plugin by L4d(1,2) servers only.
- Little optimizations and refactoring utilizing StringMaps and inline translation.
- Removed dependency on basevotes.smx plugin.
- Fixed wrong buffer size.

Dragokas 11-24-2018 05:07

Re: [L4D] Map changer with rating system
 
v.1.8 (2018/11/24)
- Fixed menu map order

Dragokas 02-11-2019 14:54

Re: [L4D] Map changer with rating system
 
v.1.9 (2019/02/09)
- Added checking is map exist before displaying list of campaigns.
- Added a MapChanger.txt config file with a lot of custom maps for L4d1.

Dragokas 02-24-2019 10:24

Re: [L4D] Map changer with rating system
 
1 Attachment(s)
v.1.10 (1029/02/24)
- Added checking the number of campaigns in each group before displaying it (to hide empty groups).
- Added !veto and !votepass commands for admin to bypass current vote (required ADMFLAG_VOTE flag).
- Added !maps_reload to refresh the list of maps from config file.
- Added current number / total number of maps inside current played campaign in the title if !maps menu for more easily tracking game process (for custom maps only).
- Added define CUSTOM_MAPS_ADMIN_ONLY to allow change maps to custom for admins only.

Dragokas 04-24-2019 11:25

Re: [L4D] Map changer with rating system
 
v.1.11 (2019/04/11)
- Fixed security issue in admin check
- Added restriction for repeated vote (interval: 1 min.)
- Added logging of all map changing vote actions to logs/vote_map.log
- Map change is now only allowed for admins with flag "k" (ADMFLAG_VOTE), or when only 1 player exists on server.

user2000 02-13-2020 11:00

Re: [L4D] Map changer with rating system
 
I get this error in L42 :cry:

Quote:

L 02/13/2020 - 10:48:56: [SM] Exception reported: Language phrase "#L4D360UI_CampaignName_C8" not found (arg 6)
L 02/13/2020 - 10:48:56: [SM] Blaming: MapChanger.smx
L 02/13/2020 - 10:48:56: [SM] Call stack trace:
L 02/13/2020 - 10:48:56: [SM] [0] Format
L 02/13/2020 - 10:48:56: [SM] [1] Line 429, H:\_To_games\Left4Dead_2\My_mods\MapChanger\M apChanger\MapChanger_1.11\scripting\MapChange r.sp::Command_MapChoose
L 02/13/2020 - 10:49:04: [SM] Exception reported: Language phrase "#L4D360UI_CampaignName_C8" not found (arg 6)
L 02/13/2020 - 10:49:04: [SM] Blaming: MapChanger.smx
L 02/13/2020 - 10:49:04: [SM] Call stack trace:
L 02/13/2020 - 10:49:04: [SM] [0] Format
L 02/13/2020 - 10:49:04: [SM] [1] Line 429, H:\_To_games\Left4Dead_2\My_mods\MapChanger\M apChanger\MapChanger_1.11\scripting\MapChange r.sp::Command_MapChoose


All times are GMT -4. The time now is 03:56.

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