Page 1 of 2

[CS:S/CS:GO/HL2DM] Map Cycle (+SPA support)

Posted: Mon Jan 11, 2016 12:40 pm
by iPlayer
[CS:S/CS:GO/HL2DM] Map Cycle

Plugin: https://github.com/KirillMysnik/sp-map-cycle

Source.Python Admin counterpart: https://github.com/KirillMysnik/SPA-Map-Cycle


What it is:
  • Map votes (!votemap). You can schedule one. Unfortunately, it only works with mp_timelimit. No frag/round limits. Yet.
    But if you want, it can change maps instantly (without waiting for round end), so it still matches requirements of DM servers.
  • Map extensions. Any map can be extended if you let players do it.
  • Recent maps exclusion. Stops them from switching between two dust's back and forth.
  • Nominations (!nominate). Players can nominate their maps so that these maps appear on first places in the map votes.
  • RockTheVote (!rtv). Players can start map votes prematurely.
  • TimeLeft (!timeleft). Reports how much time is left till the map changes.
  • NextMap (!nextmap). Reports what the next map is.
  • Map ratings (!likemap). Allows players to Like! or Dislike the map they're playing on. Also runs mass surveys right before main map vote.
    Map rating (likes, likes - dislikes or likes:dislikes) is one of the most important factors that defines which maps will make it to the final vote.
  • New maps tracker. Sometimes you add new maps to you maplist and want to make people see and play them. The plugin tracks these maps for X days and bumps them just a bit in map votes.
  • maps folder scanner. If you run a fast-paced gamemode, you probably have a lot of maps. This plugin allows you to rebuild mapcycle.txt if you provide right prefixes.
  • Fancy map names :) . No more de_dust2, it's Dust II now. You can define your own multilangual translations or hardcode the name right into mapcycle.json.
  • mapcycle.json. I'm sorry, but it's just the way it is. Once you have built your mapcycle.txt, the plugin will help you convert it to mapcycle.json. Why JSON? It gives you the opportunity to define extra mapcycling options.
  • Time restriction. Got both de_dust2 and de_dust2_night? No problem. mapcycle.json allows you to set time intervals when each map should appear in map votes.
  • "1. I Don't Care". It's important. I believe that if a player doesn't want to vote, he has all the rights to hit '1' without even looking at the popup.

Popup screenshots
Image

mc command
I'll just paste it here

Code: Select all

mc help:
> mc help
Shows this help message

> mc reload_mapcycle
Reloads mapcycle.json

> mc rebuild_mapcycle
Creates new mapcycle.json based on mapcycle.txt (mapcycle_default.txt)

> mc db show [<starting ID>]
Prints contents of database.sqlite3. If the starting ID is given, shows the
contents only beginning from this ID.

> mc db dump_html
Dumps contents of the database to an HTML page:
<mod folder>/logs/source-python/map_cycle/databasedump.html

> mc db dump_txt
Dumps contents of the database to a text file:
<mod folder>/logs/source-python/map_cycle/databasedump.txt

> mc db save
Saves current maps list from memory to the database

> mc db load
Reloads data from the database into memory

> mc db set_old <map filename>
Marks the given map as old (no NEW! postfix)

> mc db set_old_all
Marks all known maps as old (no NEW! postfix)

> mc db forget_map <map filename>
Removes the given map from the database, doesn't remove the map from the
mapcycle.
Map will be added to the database again if it's still in mapcycle.

> mc scan_maps_folder [<map prefix> ...]
Scans contents of ../maps folder and puts scanned maps in mapcycle.txt.
You can then convert that mapcycle.txt to mapcycle.json by typing
'mc rebuild_mapcycle'.
If map prefixes are given, only maps that start with that prefix will be added
to the list.
Example:
mc scan_maps_folder de_ cs_ gg_


Usage examples
First run instant start

Code: Select all

mc scan_maps_folder        // Scan maps folder into mapcycle.txt
mc rebuild_mapcycle        // Convert mapcycle.txt to mapcycle.json
mc reload_mapcycle         // (optional - you can wait til changelevel or restart the plugin) Load mapcycle.json into memory
mc db save                 // (optional - you can wait til changelevel) Save the maps to the database
mc db set_old_all    // (optional - you can wait 5 days) Strips NEW! flags from all your maps


Database print

Code: Select all

mc db show

prints something like this:
Image

Installation
  1. Install ControlledCvars and SpamProofCommands packages
  2. Download the latest release of the plugin
  3. Extract contents of the sp-map-cycle-x.x.x directory to your mod folder
  4. Add the following line to autoexec.cfg:
    sp plugin load map_cycle

Source.Python Admin integration
  1. Download the latest development snapshot of SPA Map Cycle
  2. Extract contents of the SPA-Map-Cycle-master directory to your mod folder
  3. Add the following line to autoexec.cfg:
    admin plugin load map_cycle

Configuration
After first loading plugin will create config file called main.cfg in your cstrike/cfg/source-python/map_cycle folder. Go through it, you may want to disable logging, although I would be much happier if you provided log files when you ask something.
There's also a file called downloadlist.txt in cstrike/cfg/source-python/map_cycle folder. It's meant to hold paths to the sounds for this plugin.
mapcycle.json can also be found/created in cstrike/cfg/source-python/map_cycle folder.
Your own map names translations go to cstrike/resource/source-python/translations/map_cycle/map_names_server.ini. Use map_names.ini as a reference.

You can restrict map to some particular time interval:

Code: Select all

    {
        "filename": "cs_assault",
        "timerestrict": "8:00,22:00"
    },

- this way the map will only be playable from 8am to 10pm

Code: Select all

    {
        "filename": "cs_assault_night",
        "timerestrict": "22:00,8:00"
    },

- and this map will only be playable from 10pm to 8am

Feedback
Greatly appreciated. Exceptions, warnings and debug messages can be found in cstrike/logs/source-python

Posted: Mon Jan 11, 2016 6:36 pm
by La Muerte
Feedback: I think that users are used to typing rtv, nominate, timeleft etc without an exclamation mark, personally I would prefer to keep it that way too since its a force of habbit and old habbits die hard hehe.

Furthermore this plugin is awesome.

Posted: Mon Jan 11, 2016 7:11 pm
by satoon101
With GunGame (currently unreleased), I am using say and client commands without any prefix, as well as using the prefix ! and / for say commands with / denoting private.

My suggestion would be to add a server command to start the vote. That will make it easier for other plugins, like GunGame, to be more dynamic in starting map voting themselves.

Posted: Tue Jan 12, 2016 5:11 am
by iPlayer
La Muerte wrote:I think that users are used to typing rtv, nominate, timeleft etc without an exclamation mark


satoon101 wrote:I am using say and client commands without any prefix, as well as using the prefix ! and / for say commands with / denoting private.


Thanks for your replies, guys. Well, it currently does support commands without any prefixes, here's the list:
!votemap, votemap - opens vote popup if vote is active
!nominate, nominate - opens nomination popup if vote has not started yet
!rtv, rtv, !rockthevote, rockthevote - marks your as the one who wants to start the vote
!likemap - rates the map (should probably change to !ratemap?)
!nextmap, nextmap - tells what the next map is
!timeleft, timeleft - tells how much time is left for the current map

My suggestion would be to add a server command to start the vote.

Yes, I remember that. I was configuring GunGame 4 back in the day and I remeber it provided a choice between Mani, it's own vote system and something else.

Source.Python Map Cycle update!

Posted: Tue Jan 12, 2016 8:54 pm
by iPlayer
Source.Python Map Cycle update!

https://github.com/KirillMysnik/sp-map-cycle/releases/tag/v1.1.0-beta

Upgrade instructions are given on the release page. Please, don't forget to delete database.sqlite3 as database schema has changed.

Changes:
  • Fixed #1!
  • Added spmc_launch_vote console command - cancels scheduled vote (if any) and instantly starts a new one (w/o extension option).
  • Added spmc_nextmap_show_on_match_end - defines if the next map should be shown on players screens when the match ends (on top and in chat).
  • Added spmc_timeleft_auto_lastround_warning - defines if players should receive a warning when the round becomes the last one (map runs out of timelimit but instant map changes are turned off).
  • Added 'man_hours' column to the database - unused in current release
  • Added 'av_session_length' column to the database - unused in current release
  • All spmc db show output is now capped to 40 maps. You can now define the map ID to start the output from:

    Code: Select all

    spmc db show 25 // Shows maps from 25 to 64

    Map IDs are now shown in the table.
  • All spmc db show output now only shows Map ID, Map File Name, Detected, Old? and Likes/Dislikes columns as the table became too long to fit in the console.
  • Added spmc db dump-html command - dumps the whole database to an HTML page.
    Page can be found at cstrike/logs/source-python/sp_map_cycle/databasedump.html


Here's a screenshot of the said page:
Image

Posted: Thu Jan 28, 2016 3:56 am
by satoon101
Since you mentioned in the other thread about updating this to work for CS:GO, I thought I would recommend looking into adding a system that works with the Workshop. I know there is a SourceMod plugin that does this, though I have not looked into the code to figure out how.

Posted: Thu Jan 28, 2016 8:16 pm
by BackRaw
Very nice plugin, good job!

OT: Where is the +w00t button the EventScripts forums had? :D

Re: [CS:S] Map Cycle

Posted: Tue Jun 28, 2016 1:58 am
by iPlayer
Map Cycle 2.0 release

https://github.com/KirillMysnik/sp-map-cycle/releases/tag/v2.0.0-beta

Changes:
  • Renamed from "SP Map Cycle" to "Map Cycle"
  • Updated to the latest Source.Python version
  • Uses SQLAlchemy as a database backend
  • Depends on ControlledCvars and SpamProofCommands custom packages

[CS:S/CS:GO] Map Cycle

Posted: Wed Apr 19, 2017 8:44 am
by iPlayer
Map Cycle 2.1 release

https://github.com/KirillMysnik/sp-map-cycle/releases/tag/v2.1.0-beta

Performed a full refactor, also adapted for CS:GO. The plugin is still in beta though, might crash the server occasionally.

Re: [CS:S/CS:GO] Map Cycle

Posted: Tue Jun 20, 2017 5:33 pm
by Painkiller
The command in hl2dm "!timelefet,timeleft" not work.
This comes ...
|Map Cycle| Map is not changing.

The command "!nextmap,nextmap" the same problem.
|Map Cycle| Next map is not

and I noticed as I said the automatic mapvote not working.

Re: [CS:S/CS:GO] Map Cycle

Posted: Sat Jul 01, 2017 8:37 am
by Painkiller
Hello iPlayer, did you have the time to turn on this, in order to be compatible with hl2dm?

Re: [CS:S/CS:GO] Map Cycle

Posted: Sat Jul 01, 2017 12:15 pm
by iPlayer
No, unfortunately not

Re: [CS:S/CS:GO] Map Cycle

Posted: Sun Jul 09, 2017 1:38 pm
by Froster2406
Hello iPlayer,

i installed your plugin. Works as intented except that it doesn't load the community maps. SInce i am hosting my server with a playlist of communitymaps it would be nice if you could add a feature that loads all the community maps into the mapcycle.txt aswell.

Thank you in advance
Froster

Re: [CS:S/CS:GO] Map Cycle

Posted: Sun Jul 09, 2017 1:44 pm
by iPlayer
Hello, Froster. I suppose you're talking about CS:GO Workshop maps? I will look into it.

Re: [CS:S/CS:GO] Map Cycle

Posted: Wed Jul 12, 2017 3:36 pm
by iPlayer
Painkiller wrote:The command in hl2dm "!timelefet,timeleft" not work.
This comes ...
|Map Cycle| Map is not changing.

The command "!nextmap,nextmap" the same problem.
|Map Cycle| Next map is not

and I noticed as I said the automatic mapvote not working.


I've just tested Map Cycle with HL2DM, and it works just fine (once properly configured, of course).
The only issue I've encountered is that it uses ESC menus instead of radio menus (probably due to the fact that SP forwards PagedESCMenu for PagedMenu when it's available, so I'll probably hard-code the PagedRadioMenu class in there).

So, Painkiller. You've probably forgotten to configure your mc_timelimit. If you leave it at -1, it will copy the mp_timelimit value, which is 0 by default. Then indeed, the only thing that will make the map change will be RTV.

UPD: Well, seems that radio menus don't work in HL2DM at all. How do you guys play it? oO

Re: [CS:S/CS:GO] Map Cycle

Posted: Thu Jul 13, 2017 12:46 am
by satoon101
iPlayer wrote:The only issue I've encountered is that it uses ESC menus instead of radio menus (probably due to the fact that SP forwards PagedESCMenu for PagedMenu when it's available, so I'll probably hard-code the PagedRadioMenu class in there).

It's actually the opposite. The RadioMenus are used unless they are known to not be available for a game. The ESCMenus work for all games except for CS:GO. The RadioMenus are definitely preferable, so they are set as the menus/options in the menus.__init__ in all games except for HL2:DM (which doesn't support RadioMenus).

Re: [CS:S/CS:GO/HL2DM] Map Cycle

Posted: Sat Jul 15, 2017 11:45 am
by Painkiller
Good morning people,

I had the whole week late layer and therefore I report only now.

@ Iplayer you gave me the last time mc_vote_duration 30
Mc_scheduled_vote_time 4.5

These two commands and I thought with it would be set.

I have mc_timelimit set to 5 but it does not work.

Re: [CS:S/CS:GO/HL2DM] Map Cycle

Posted: Sat Jul 15, 2017 11:53 am
by iPlayer
Upload your cfg/source-python/map_cycle/main.cfg or post it here. If posting here, please be sure to wrap it into

Code: Select all

[code][/code]
!

EDIT: Please also post here your cfg/source-python/map_cycle/mapcycle.json

Re: [CS:S/CS:GO/HL2DM] Map Cycle

Posted: Fri Jul 21, 2017 6:03 pm
by Painkiller

Code: Select all

// ######################################################################### //
//                                  Logging                                  //
// ######################################################################### //

// Default Value: 4
// Logging level: 4 - debug, 3 - info, 2 - warning, 1 - error, 0 - critical, -1
//   - message (always displayed)
   mc_logging_level 4


// Default Value: 5
// Logging areas (flags): 1 - console, 2 - main log, 4 - Source.Python log, 8 -
//   plugin log
   mc_logging_areas 5


// ######################################################################### //
//                               Maps Settings                               //
// ######################################################################### //

// Default Value: -1
// Time per map. -1 - copy mp_timelimit, 0 - disable (use !rtv), other values -
//   time in minues
   mc_timelimit 5


// Default Value: 0
// 0 - wait for round end to change the map, 1 - change the map instantly.
//   Useful for DeathMatch servers.
   mc_instant_change_level 0


// Default Value: 2
// Maximum number of extensions available per each map. 0 - none.
   mc_max_extends 2


// Default Value: 15
// Additional time given by every map extension, in minutes
   mc_extend_time 10


// Default Value: 2
// How many of the last played maps to exclude from votes? 0 - include all, 1 -
//   exclude current map, 2 - exclude current and previous map etc
   mc_recent_maps_limit 2


// Default Value: 5
// How long is a new map considered new, in days. -1 - disable tracking new
//   maps
   mc_new_map_timeout_days 5


// Default Value: 1
// 0 - use filename (de_dust2) to refer to the map, 1 - use full name (Dust II)
//   to refer to the map
   mc_use_fullname 1


// Default Value: 1
// 0 - use filename if full name is not available, 1 - try to guess missing
//   full names
   mc_predict_missing_fullname 1


// Default Value: 1
// 0 - include map prefix in the full name (DE Dust II), 1 - exclude map prefix
//   from the full name (Dust II)
   mc_fullname_skips_prefix 1


// Default Value: 0
// 0 - perform alphabetic sorting by filename, 1 - perform alphabetic sorting
//   by full name
   mc_alphabetic_sort_by_fullname 0


// ######################################################################### //
//                               Votes Settings                              //
// ######################################################################### //

// Default Value: 1
// Enable !votemap command? This automatically enables map votes. 0 - disable
//   and disable map votes, 1 - enable and enable map votes
   mc_votemap_enable 1


// Default Value: 5
// Max number of maps to include in the vote. 0 - include all maps.
   mc_votemap_max_options 5


// Default Value: 30
// Duration of voting, in seconds
   mc_vote_duration 30


// Default Value: 5
// Remaining time (in minutes) before the map should change to start a
//   scheduled vote (don't include vote duration)
   mc_scheduled_vote_time 4.5


// Default Value: 3
// Chat reaction to player votes (flags): 1 - show player's nickname, 2 - show
//   their choice
   mc_votemap_chat_reaction 3


// Default Value: 1
// Allow players to change their choices (vote for another map)? 0 - disallow,
//   1 - allow
   mc_votemap_allow_revote 1


// Default Value: 1
// Enable `I Don't Care` option as the first option the map voting popup? 0 -
//   disable, 1 - enable
   mc_votemap_whatever_option 1


// Default Value: 1
// Show vote progress in the bottom of the screen? 0 - do not show, 1 - show.
//   Also set sv_hudhint_sound 0 to disable annoying whistle sounds.
   mc_votemap_show_progress 1


// Default Value: 1
// Use HudMsg instead of HintText to show vote progress (in CS:GO HudMsg looks
//   better, in CS:S there's no difference)? 0 - use HudMsg, 1 - use HintText.
   mc_votemap_progress_use_hudmsg 1


// Default Value: 0
// 0 - initial sorting shuffles maps randomly, 1 - initial sorting sorts maps
//   alphabetically.
   mc_alphabetic_sort_enable 0


// Default Value: "admin_plugin/actions/startyourvoting.mp3"
// Path to the `vote has started` sound, leave empty to disable
   mc_sound_vote_start "admin_plugin/actions/startyourvoting.mp3"


// Default Value: "admin_plugin/actions/endofvote.mp3"
// Path to the `vote has ended` sound, leave empty to disable
   mc_sound_vote_end "admin_plugin/actions/endofvote.mp3"


// ######################################################################### //
//                      Nomination (!nominate) Settings                      //
// ######################################################################### //

// Default Value: 1
// Enable !nominate command? 0 - disable, 1 - enable
   mc_nominate_enable 1


// Default Value: 1
// Allow player to change their nomination (nominate another map)? 0 -
//   disallow, 1 - allow
   mc_nominate_allow_revote 1


// ######################################################################### //
//                            RTV (!rtv) Settings                            //
// ######################################################################### //

// Default Value: 1
// Enable !rtv command? 0 - disable, 1 - enable
   mc_rtv_enable 1


// Default Value: 0.6
// Percentage of players that used !rtv to start map vote
   mc_rtv_needed 0.6


// Default Value: 30.0
// Time before first RTV can be held, in seconds
   mc_rtv_delay 30.0


// ######################################################################### //
//                             !nextmap Settings                             //
// ######################################################################### //

// Default Value: 1
// Enable !nextmap command? 0 - disable, 1 - enable
   mc_nextmap_enable 1


// Default Value: 1
// Show the name of the next map automatically on match end? 0 - disable, 1 -
//   enable
   mc_nextmap_show_on_match_end 1


// ######################################################################### //
//                             !timeleft Settings                            //
// ######################################################################### //

// Default Value: 1
// Enable !timeleft command? 0 - disable, 1 - enable
   mc_timeleft_enable 1


// Default Value: 1
// Warn players if current round becomes the last one? 0 - do not warn, 1 -
//   warn
   mc_timeleft_auto_lastround_warning 1


// ######################################################################### //
//                           Like/Dislike Settings                           //
// ######################################################################### //

// Default Value: 1
// Enable map rating and !likemap command? 0 - disable, 1 - enable
   mc_likemap_enable 1


// Default Value: 3
// How to calculate map rating? 1 = likes (absolute value), 2 = likes -
//   dislikes, 3 = likes / (likes + dislikes)
   mc_likemap_method 3


// Default Value: 1
// Enable `I Don't Care` option as the first option like/dislike voting popup?
//   0 - disable, 1 - enable
   mc_likemap_whatever_option 1


// Default Value: 10.0
// Duration of automatic likemap survey, in seconds. 0 - disable survey.
   mc_likemap_survey_duration 10.0


Re: [CS:S/CS:GO/HL2DM] Map Cycle

Posted: Fri Jul 21, 2017 6:11 pm
by iPlayer
EDIT: Please also post here your cfg/source-python/map_cycle/mapcycle.json