View Single Post
Author Message
nosoop
Veteran Member
Join Date: Aug 2014
Old 11-24-2015 , 03:31   [TF2] Map Voting Tweaks (2015-11-24)
Reply With Quote #1



Description:
Changes the vote panel so it:
  1. Rewrites the workshop map name to a friendly display name (currently built for 1.7, so I can't take advantage of GetMapDisplayName). Also removes excluded maps (as determined by the MapChooser plugin).
  2. Hooks the callvote command, handling it if it's a NextLevel or ChangeLevel vote and resolving display names back into workshop names if necessary.
  3. Optionally overrides the vote call, allowing clients to use the NextLevel vote panel to nominate a map instead.
ConVars:
  • sm_tfmapvote_version: Plugin version.
  • sm_tfmapvote_nominate (default true): Whether or not "next map" vote calls should be treated as map nominations.
  • sm_tfmapvote_exclude (default true): Whether or not recent maps (as determined by GetExcludeMapList) are removed from the vote panel.
Things the plugin will clobber:
The plugin modifies the user data of the first entry in the ServerMapCycle string table, which stores the map cycle for the voting panel. Honestly, I don't know if it's used for anything else. I've spent a long night testing the crap out of this plugin, and I can't find any other side effects of modifying that table, so it should be okay.

This plugin will try to clean up and restore something that resembles the original ServerMapCycle table when unloaded, so in the event that A VERY BAD THING™ happens, you can unload it and things should act like the plugin was never there. I'm pretty sure that the table gets regenerated on map change, too.

Dependencies:
Currently requires MapChooser to perform map nominations and get map exclusions. I'll have to see if this can be an optional dependency eventually.

Changelog:
  • 0.1.3 (2015-11-24, the "why am I up at six in the morning again" edition)
    • Removed hardcoded stringtable index and added support for ChangeLevel.
  • 0.1.1 (2015-11-23, the "wait, it's not October" edition) (4)
    • Initial public release.
Source code on Github.
Attached Files
File Type: sp Get Plugin or Get Source (tf_map_voting_tweaks.sp - 1289 views - 11.4 KB)

Last edited by nosoop; 11-24-2015 at 09:02. Reason: my post keeps getting eaten send help also 0.1.3
nosoop is offline