Garry's Mod

Garry's Mod

Not enough ratings
How to configure MapVote / GamemodeVote [UPDATED 03/30/2024]
By Psychotrickser
This guide explains how to properly configure my MapVote/GamemodeVote addon
   
Award
Favorite
Favorited
Unfavorite
TROUBLESHOOTING...
⠀⠀the Mapvote doesn't seem to work in one of my gamemodes
Not all gamemodes are compatible with ULX Mapvotes. Reconstructed Ultimate Chimera Hunt and Extreme Football Throwdown are some examples. That's why I publish new versions of those gamemodes that are compatible with ULX Mapvotes and especially with this Mapvote Addon. Have a look at my workshop addons if you want.
If a gamemode that you want to play is not yet compatible with this addon please leave a comment. I'll then look into it.
⠀⠀there is a conflict with another addon
Sadly I can't make this addon compatible with all other addons on the workshop and I won't try since it would be a lot of work.
⠀⠀I found a bug
If you believe that you found a bug leave a comment under this guide or on the addon's workshop page and I'll have a look
EXPLANATION
All of the following Options are accessible through the MapVotes GUI. You can open it up by typing !mvmenu in chat. Most stuff is self explanatory.
⠀⠀Config


RTVPlayerCount: Sets the amount of players needed to start a vote during an ongoing round
GamemodeTimeLimit: Time in seconds a gamemode vote lasts
ReplayMapButton: Sets whether or not there should be a button in the vote to replay the current map+gamemode
GamemodDesc: Sets whether or not to display a short gamemode description during a gamemode vote
SortMapsBy: Sets whether maps and gamemodes should be sorted alphabetically or be in a random order or sorted by their ratings
MapLimit: The maximum amount of maps during a vote (doesn't apply to gamemodes)
MapvoteTimeLimit: Time in seconds a map vote lasts
MapPreviews: Sets whether or not there are map previews
MapCooldown: Sets whether or not recently played maps may appear in a mapvote
MapsBeforeRevote: Sets the amount of maps to be played before a recently played map may appear in a mapvote again
Statistics: Sets whether to show during a mapvote how often a map has been played
GamemodeVote: Sets whether to skip the gamemode vote and stick to the current one
PlayercountDependingGamemodes: Sets whether gamemodes should be disabled/enabled based on player count
DisplayGamemodeIcons: Sets whether gamemode icons should be displayed during a gamemode vote
GamemodesAndMapsHaveRatings: Sets whether gamemodes and maps should have ratings
SandboxCountdown: Time in seconds for the sandbox countdown
StartMapvoteCooldown: Time in seconds for the cooldown phase after starting a map vote
AdminsHaveMoreVotePower: Sets whether administrators have more voting power
Language: Language for the display of the map voting menu (e.g., "de" for German)
FilterCSSMaps: Automatically blocks maps containing CSS content from mapvotes
ColorUnplayedMapsGray: Whether or not to display map/gamemode names that haven't been played at least once in a light gray

PlayersCanPingDuringVote: Whether or not to allow players to send out pings to attract other players attention for example a specific map
⠀⠀Gamemodes

This Tab contains the gamemode prefixed for each gamemode. Most of them are already set by default through the gamemode file itself.
To entirely prevent a gamemode from appearing in MapVotes just put "nil" as a value.
⁣⁣⁣⁤⁢⁢⁢⁢⠀⠀Localization

This Tab contains the translated stuff that will be displayed during MapVotes. You can edit them to your liking
⠀⠀PlayerCountDependingGameModes

This tab allows you to restrict gamemodes from appearing in a MapVote depending on whether or not there's enough or too many players. This is useful since there's gamemodes that require more or less players than others.
⠀⠀GamemodesDesc


In this Tab you can edit the gamemode descriptions that will be displayed during MapVotes.
⠀⠀RatingResults

This tab shows you how many many ratings and stars a Gamemode or Map has received. These will be displayed as stars during MapVotes.
You can edit those values by doubleclicking them.
⠀⠀Statistics

This tab keeps track of how often a Gamemode or Map has been played.
You can, for whatever reason, edit those values by double clicking a line.
⁣⁣⁣⁤⁢⁢⁢⁢⠀⠀RecentMaps
This Tab contains the Maps that are on Cooldown meaning they'll be excluded from MapVotes until a certain amount of other Maps have been played. This prevents players from picking the same map over and over again.
⠀⠀CSSMaps

This tab shows you which maps contain CSS content. You can add more maps to this list or remove some.
These maps will be excluded from MapVotes if 'FilterCSSMaps' is set to true in the Config Tab.
⁣⁣⁣⁤⁢⁢⁢⁢⠀⠀ConVa⁤rs⁤

This Tab controls the round or time limits of gamemodes. You can edit the values by doubleclicking them.
⁣⁣⁣⁤⁢⁢⁢⁢⠀⠀Useful Addons

This Tab holds recommendations for additional addons to further optimize your server.
⁣⁣⁣⁤⁢⁢⁢⁢⠀⠀InstalledAddons

This Tab contains a list of all installed Addons on the server. There's a search function and you can click on in image to open up the Workshop page.
⁣⁣⁣⁤⁢⁢⁢⁢⠀⠀InstalledMaps

This Tab contains a list of all installed Maps on the server.
⁣⁣⁣⁤⁢⁢⁢⁢⠀⠀ConCommands

This Tab provides some useful Functions e.g. printing a list of all installed Addons to your or the server's console.
⁣⁣⁣⁤⁢⁢⁢⁢⠀⠀Cleanup

Over time data of maps and gamemodes that aren't installed on the server anymore can accumulate over time. To prevent your files from becoming too large this Tab can generate a list of all that useless data and allows you to delete them.
HOW TO...
⠀⠀create gamemode specific workshop collections
The more gamemodes your server has the longer it will take for players to join your server and download all necessary addons. To make life easier I made an addon which allows you to set up gamemode specific workshop collections to cut joining time to a fraction:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2965162101
⠀⠀blacklist a gamemode
Switch to the Gamemodes Tab and put a "nil" as the map prefix value. This will prevent the gamemode from appearing in MapVotes.
⠀⠀blacklist a map

Open up the ULX menu by typing in !menu in chat and switch over to settings>ULX Player Votemap List. Then click on the map that you wanna blacklist and click on 'remove'. Done
⠀⠀set map prefixes for gamemodes
Not all gamemodes have default map prefixes. In that case you can set them manually for this addon. Just switch to the Gamemodes Tab and double click the line you wanna edit. Type in the map prefixes separated by a comma for each prefix.
⠀⠀add a map instead of prefix to a gamemode
Switch to the Gamemodes Tab and put in the whole map name instead of a prefix.
⠀⠀run specific commands automatically when a gamemode is loaded
(suggested by Vox Andrews)
Just create a text file with the gamemode's name in the data/mapvote folder. Call it ultimatechimerahunt.txt for example and type in the following lines:
sv_playermodel_selector_gamemodes 0
uch_roundtime 5

(Make sure to give each command a new line)
When the gamemode ultimatechimerahunt loads, the server automatically runs the console commands 'sv_playermodel_selector_gamemodes 0' to disable changing playermodels through the Playermodel Selector Addon and 'uch_roundtime 5' to set the round time to 5 minutes. This is just an example. You can type in whatever you want for whichever gamemode you want.

This will be reworked and added to the MapVote GUI.
⠀⠀create custom map previews

There are two ways to use custom Map Previews instead of the default ones. The first and easy way is by using my Super Map Icon Maker.

The second way is as follows:
Take a screenshot of the map and edit it in an image editor like GIMP.
Make it 512x512 big and convert it to a .png. The name of it is important. Make sure it's the same name as the map!
For the map ttt_minecraft_b5 the corresponding preview would be called ttt_minecraft_b5.png.

After you're done create a folder with any name you like. Inside that create a file called addon.json and put this in it:
{
"title" : "YOURCUSTOMADDONNAME",
"type" : "ServerContent",
"tags" : ["fun","realism"],
"ignore" :
[
"*.psd",
"*.vcproj",
"*.svn*"
]
}
Think of a name for your new map icons addon and replace 'YOURCUSTOMADDONNAME'.

Then inside that folder create another folder called 'maps'. Inside that folder create a folder called 'thumbs' and put all your map preview files in it.
Now you can convert your addon folder to a .gma file and upload it to the workshop so everyone can have the same previews or you move your folder to your /addons/ folder so that they only apply for you.
⠀⠀report a map as containing CSS content
By executing the console command mapvote_reportcssmap or clicking the corresponding button inside the GUI>ConCommands the server automatically adds the current map to the cssmaps.json file. If the config option FilterCSSMaps is set to true, this map won't appear in future mapvotes anymore
Planned/Possible/ProbablyStupid Features
Very likely:
+ Add compatibility with more gamemodes
+ Add config option to RTV function to allow choosing whether to start a Mapvote immediately or to wait until round end
+ Add Localization Button to let clients choose their preferred language instead of lading it from server
+ Add Reset Button for Config Files inside !mvmenu

Likely:
+ Add more Vote Menu Layouts
+ Add Gamemode/Map sequence option to predefine a sequence of gamemodes and maps that will be loaded in linear order (skips mapvotes during the execution)
+ Add fancy frames to map buttons
+ Add GIFs showcasing the gamemodes
+ Add customization options to change colours, fonts, frames
+ Fix incompatibility with other MapVote addons by overriding them
+ Remove ULX dependancy

Less likely:
+ Replace file-based saves through SQL databases to increase performance
+ Add icons of players that are talking during mapvote as moving images
+ Add minigames to Mapvote Menu
+ Add HTTP Request to synchronize CSS Maps List
+ Add HTTP Request to download Map Previews
+ Add HTTP Request to allow users to submit Previews of Maps that don't have one yet

DONE:
+ Download missing map icons from workshop (already added) and save them inside data/maps/thumbs
+ Make Config GUI more user-friendly by adding more buttons with restrictions to possible values and add ConVars
+ Add Chat Command to open up MapVote Config Menu
+ Add high-resolution Gamemode Images
+ Make Changing Vote Layout happen during a Vote instead of when a new one is called
+ Add ConVars Tab to !mvmenu for setting round limits to gamemodes before a MapVote
+ Add Tab to GUI !mvmenu with additional, useful Addons
+ Allow server owners to display image and text in top right as advertisement

37 Comments
cd0m 28 Mar @ 1:12pm 
Yeah I meant remove prefixes from a mapvote not adding them, only way it seems you can remove a prefix is by editing the file manually
Psychotrickser  [author] 27 Mar @ 5:35pm 
@cd0m Try the chat command !mvmenu
cd0m 27 Mar @ 1:27pm 
A way to remove prefixes from a mapvote selection in the menu would be nice
MadMartin 21 Mar @ 12:49pm 
Fixed it, the problem was that i had it disabled in the config for some reason.

It has worked until now, but somehow it stopped working today?
I'm trying to fix it rn.
Psychotrickser  [author] 17 Mar @ 11:35pm 
@Maffin Someone also requested a player count restriction for maps some time ago. Sadly there's no way of automatically determining what player count the map is best suited for. Since there's tens of thousands of maps on the workshop one would have to test them all and hardcode the player count limits. Something I did for the gamemodes of which there's only a few dozens

@MadMartin Are you playing on a dedicated or listened server?
Maffin 17 Mar @ 7:47am 
So I see its possible to restrict gamemodes to player amounts, but why not maps? Like small maps should only be selectable on small player counts, and large ones only on big player counts. These definitions should be available as settings so they can be made at the owner'S discretion
MadMartin 15 Mar @ 10:35am 
I'm unable to GM vote for some gamemodes, for example TTT, throwing "lua/mapvote/cl_mapvote.lua:1261: attempt to call method 'SetImage' (a nil value)
" into the console....
Psychotrickser  [author] 12 Mar @ 2:34pm 
done
Psychotrickser  [author] 12 Mar @ 2:21pm 
Good point. I'll add a minimum player limit for RTVs
Mofker 12 Mar @ 2:14pm 
Understood! Is there any way of preventing players from triggering a mapvote when the server only has a single person on it?