Git Product home page Git Product logo

rockthevote's Introduction

RockTheVote

A rewrite of the RockTheVote plugin by MrOats, with new features.

This plugin will choose rarely played maps as the next map and as RTV menu options, depending on who is in the server. Maps also have cooldowns before they can be nominated again to prevent overplaying them. There are also text-menu alternatives to the built-in game votes. These are much less annoying as they don't take control of your mouse.

Chat commands

Everyone can use these commands.

Command Description
rtv Rock the vote! If a vote has already started, then this reopens the vote menu.
nom/nominate Open the nomination menu. Maps that are colored red can't be nominated until other maps have been played (noted in paretheses next to the map name)
nom [map] Nominate a map. [map] can be a partial map name (e.g. "coldburn" instead of "coldburn_beta123"). If multiple maps contain [map], then a nomination menu will be opened so you can select which map you wanted.
nom [map]* Search for a map without accidentally nominating one.
unnom/unom/denom Undo your nomination.
listnom/lnom/nomlist/noms List the current nominations.
maplist/listmaps Get a list of all votable maps.
series? Show how much progress has been made in the current map series.

Console commands

These commands also work in chat.

Command Admin only? Description
.forcertv Yes Force a map vote now.
.cancelrtv Yes Cancels an active map vote.
.map [map] Yes Force a map change.
.set_nextmap [map] Yes Set the next map for when the current map ends. This doesn't work for maps in a series (which use trigger_changelevel instead of game_end)
.mapstats [map] No Show previous play times for the current map or the specified map.
.newmaps [player] No Show a list of maps that were not played in a long time. Player name is optional and can be a steam id or '\all' for all players. Add '\cycle' as an arugment to show only maps in the map cycle.
.recentmaps [player] No Show list of maps that were played recently. Player name is optional and can be a steam id or '\all' for all players.
.vote No Open the vote menu (requires rtv.gameVotes 1 CVar).

CVars

CVar Description
secondsUntilVote Prevents rtv'ing until this many seconds after the map starts (without this a single person could start a vote before anyone else joins).
iMaxMaps The max number of maps shown in the vote menu. 8 is the maximum.
secondsToVote How long the vote menu will be shown.
iPercentReq Percentage of players needed to rtv before a vote starts (rounded up to the nearest whole number).
NormalMapCooldown Time in hours before a map can be nominated again.
MemeMapCooldown Time in hours before a map in hidden_nom_maps.txt can be nominated again.
gameVotes If set to 1, enables the .vote command to replace the built-in game votes. Currently only killing and survival mode votes are supported.
forceSurvivalVotes If set to 1, enables the Semi-Survival game vote (players respawn when everyone dies). Requires ForceSurvival to be installed.
restartVotes If set to 1, enables map restart votes.

Installation

  1. Download all the files in this repo and save them to this folder: scripts/plugins/RockTheVote/
  2. Add this to default_plugins.txt
    "plugin"
    {
        "name" "RockTheVote"
        "script" "RockTheVote/RockTheVote"
        "concommandns" "rtv"
    }
  1. Add these CVars to your server.cfg file. The values listed here are the defaults.
as_command rtv.secondsUntilVote 120
as_command rtv.iMaxMaps 5
as_command rtv.secondsToVote 25
as_command rtv.iPercentReq 66
as_command rtv.NormalMapCooldown 24
as_command rtv.MemeMapCooldown 240
as_command rtv.gameVotes 1
as_command rtv.forceSurvivalVotes 0
  1. Create a file for the normal votable maps, or symlink your mapvote.cfg file here: scripts/plugins/cfg/mapvote.txt.
    Maps listed here can be nominated with the normal cooldown (NormalMapCooldown). The addvotemap text is optional in this list.
  2. Create the hidden map list file: scripts/plugins/cfg/hidden_nom_maps.txt
    Maps listed here have a large nom cooldown (MemeMapCooldown) and never randomly show up in the vote menu or as the next map.
  3. Install Python 3 and run db_setup.py. This will create the folders needed to track player map stats. If you don't do this, the map cycle will be random instead of based on previous map play times of the players currently in the server.
  4. [Optional] Run series_maps.py to update series_maps.txt. Then, check the file to undo/fix any bad series maps detections. Use something like TortoiseDiff to compare the before/after files. If you don't follow this step, the series? command may not work properly, as well as map cooldowns for map series. The file included here is accurate for the TWLZ server but maybe not yours.
  5. [Optional] Install the ForceSurvival plugin if you want to enable forceSurvivalVotes.

Keeping up-to-date

There are 4 map lists that are used by this plugin:

  1. mapcycle.txt - This is the default map cycle file. This file is used to select the "Next map".
  2. scripts/plugins/cfg/mapvote.txt - This is a new file which lists votable maps, except for maps you don't want anyone to play normally. It can be a copy of the default mapvote.cfg file or symlinked to it.
  3. scripts/plugins/cfg/hidden_nom_maps.txt - This is a new file which holds votable maps which should only rarely be played because they're really bad or overplayed and you question why they're on the server at all.
  4. scripts/plugins/RockTheVote/series_maps.txt - This file lists all map series. Each line represents an ordered list of maps in a single series.

As you add new maps, you'll need to decide which lists to put them in.

  • Is the map good? Add it to both the mapcycle.txt and mapvote.txt
  • Is the map kinda bad? Add it to mapvote.txt.
  • Is the map garbage? Add it to hidden_nom_maps.txt.
  • Is the map a series? Add it to series_maps.txt as well.

Check the angelscript logs for [RTV] messages. You'll see warnings about maps being in the wrong combination of lists, if you messed that up.

rockthevote's People

Contributors

wootguy avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cads182

rockthevote's Issues

Nominate Crash

My server crash if two persons or more nominates a map and start a vote.
CPU rise to 100% and after a seconds restarts automatically to default map.

Bug

  • Map limit more that 8 causes to create another page on RTV and you can't vote them because keeps spamming the first one.
  • gameVotes on 0 doesn't work, you can still use them, it prints in chat [Vote] Command disabled. and opens the menu anyways.

Force RTV

  • Players can't re-open menu when admin forces RTV.

Game locks up when activating RTV

Sven Co-op locks up when I type in "rtv" into the chat. I'm trying to run it as a test before I fire up my server, and all of my attempts end up with the same outcome.

I'm running Windows 10.
No crash dumps AFAIK.
AngelScript log: https://pastebin.com/7rTbHE57

Plugins:

No matching symbol 'RelaySay' in GameVotes.as

I've followed all of the steps to install the plugin, however, i check my AngelScript log and i get this:

ERROR: mypathtosvencoop/svencoop_addon/scripts/plugins/gamevotes.as (162, 3) : No matching symbol 'RelaySay'
ERROR: mypathtosvencoop/svencoop_addon/scripts/plugins/gamevotes.as (210, 4) : No matching symbol 'RelaySay'
ERROR: mypathtosvencoop/svencoop_addon/scripts/plugins/gamevotes.as (214, 4) : No matching symbol 'RelaySay'
ERROR: Plugin script compilation failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.