Team Fortress 2

Team Fortress 2

87 ratings
TF2 Map Workshop for server owners
By Powerlord
A guide for server owners to deal with the TF2 Map Workshop
   
Award
Favorite
Favorited
Unfavorite
Introduction
This is a quick guide for setting up Workshop Maps for Team Fortress 2 Dedicated Servers.

It will have an extra focus on using Workshop maps with SourceMod and its map voting plugins.

I have been in contact with Valve's John S. about various Map Workshop bugs.

SourceMod supports workshop maps since SourceMod 1.8.
Current Bugs
No known bugs.
Commands
There are really 3 commands involved with the Map Workshop. They are:

  • tf_workshop_map_sync - Used both to download a map and add it to the server's tracking list.
    • Tracked maps will be automatically updated as well as have the map's full name available to server-side plugins.
    • Maps in the server's mapcyclefile (mapcycle.txt by default) are automatically added to the tracked maps list.
  • tf_workshop_map_status - List all maps currently being tracked.
  • tf_workshop_refresh - Force the server to check all currently tracked maps for updates.
Installing a Workshop Map
Before you can install a map, first you have to find one.

To do this, you can search the Map Workshop. You can filter by the workshop filters shown.


Once you find a map you like, copy its ID from your browsers title bar, or click the Share button and copy the ID from there.

On your server's console, run the command tf_workshop_map_sync followed by the ID number. For Glassworks, this would be tf_workshop_map_sync 454118349.

If you don't have access to the server console but you have rcon access, you can run rcon tf_workshop_map_sync with the map ID instead.

If you don't have that access either, but you are a SourceMod admin with sm_rcon access, you can use sm_rcon tf_workshop_map_sync with the map ID as an alternative.

Adding the map to your server's rotation

To add a workshop map to a mapcycle, you have two options as to how to add it.

The first is by adding workshop/ID number (example: workshop/454118349 for glassworks).

The second is by adding workshop/anythinghere.ugcmap ID. (example: workshop/cp_glassworks_rc6.ugc454118349. This syntax may allow you to add additional information, but the information can be fake and/or misleading. In the example, GlassWorks has the wrong version number.

All maps in the mapcycle file are automatically tracked.

It is hightly recommended that you put all of your tf_workshop_map_sync lines in a file that is executed on every map change, such as server.cfg
SourceMod integration
SourceMod 1.8 or newer has full support for Workshop maps

All core plugins have been redesigned to display a workshop map's real name instead of its ID.

Here is what resolved maps look like in SourceMod's MapChooser:



In the above screenshot, the mapcycle was:

workshop/454118349
lumberyard
workshop/454160949
pipeline
dustbowl

Neither workshop map name resolution or workshop display names will occur until a map is being tracked; how to add a map to the tracked list is mentioned in a previous section.

Technical notes for plugin developers

For plugin developers, SourceMod has two commands for workshop maps:

FindMap[sm.alliedmods.net] takes a full or partial map name and gives you a FindMapResult[sm.alliedmods.net] back with its status.

GetMapDisplayName[sm.alliedmods.net] takes a workshop map's mapcycle entry and gives you its short name back.
For example, calling GetMapDisplayName on "workshop/454118349" or "workshop/cp_glassworks_rc6a.ugc454118349" will give you "cp_glassworks_rc6a" back.
39 Comments
blue_mantv 8 Feb, 2022 @ 9:49am 
for each map tf_workshop_map_sync lines in the server.cfg ? an example

tf_workshop_map_sync 1234567
tf_workshop_map_sync 55668445
tf_workshop_map_sync 959666
Tiny Tony 8 Dec, 2020 @ 12:58pm 
I'm having a lot of issues and not really understanding any of this information :(
CoconutC 16 Jan, 2020 @ 6:14am 
Ah yeah actually you cannot record demos when playing in a workshop map. Because the file name will contains "/".
Wins 31 Jul, 2018 @ 8:04am 
if you're still struggling with changing the map, you need to do changelevel workshop/ID number
or rcon changelevel workshop/ID number
RealmTree 30 Jul, 2018 @ 2:45pm 
How can i get my workshop maps to appare with workshop/ infront of its name so people find it in the workshop tab of the server browser?
Vezzy 4 Oct, 2017 @ 7:57pm 
Same here. I still can't get them to load and download through the workshop, it seems. People still just get the same old "map missing" errors. Is there any other thing I may need? Oh, by the way, do I need to put a "1" behind that tf_workshop_map_sync command, or is this the only line I need?
N/A 4 Oct, 2017 @ 7:10pm 
im confused at sourcemod intergration
AyeTSG 18 Aug, 2017 @ 4:14pm 
I cannot for the life of me find a release of mapchooser extended 1.11 or umc 3.4.6, and help?
Vezzy 17 Aug, 2017 @ 3:21pm 
Thanks man. I'll work on it and I'll probably come back if I can't figure it out.
Powerlord  [author] 17 Aug, 2017 @ 3:07pm 
@Vezenmodder It should be automatic if they are in your mapcycle file. If you use a different map voting system (like UMC), you can instead just put tf_workshop_map_sync lines in your server.cfg. I don't currently have a TF2 server to check if putting them in your autoexec.cfg works or if that's still broken.