The Steam Workshop is a very useful tool for server owners, particularly with adding custom content such as addons and models. Instead of uploading all of an addon's custom content to your file server, and then setting up a FastDL script so that your player's download the content to their client, you can instead click a button to add an addon to your Workshop collection, and code one line to add all of the content to your player's download queue.
- The first thing we need to do is create a collection of the addons you wish to use. You can do this by clicking this link and then click the "Create Collection" button on the right. If you don't see the "Create Collection" button on the right, make sure you're signed in to your Steam account. You can click the Login button in the upper-right hand section of the screen to log in.
- The next thing you'll need to do is register for a Steam Web API key. Think of this key as a password, you don't want to share it with others! You can register for your API key at the following page: http://steamcommunity.com/dev/apikey
- Now we need to add your collection and API key to your server. You'll now want to log into ForcePanel and navigate to your server's page. Once you're there, you'll want to scroll down to the section "Server Configuration" and input your collection's ID under Workshop Collection ID and your Steam Web API key under Authkey.
- NOTE: The Workshop Collection ID is found in the URL of the collection. For example, the M9K Weapons Full Pack collection ID is 300653696.
- The Workshop will now be working with your server! However, there is another step if you want your players to download the content from each addon. If you don't follow this step and your addon uses custom models (such as TDMcars, a custom model, etc.) then your players will see errors once they connect. To remedy this, you'll need to create or edit a Lua script so that the Garry's Mod client knows that you wish for your players to download the files. The Lua script can be named whatever you'd like, and it will be placed inside of your server's /garrysmod/lua/autorun/server directory. The inside of your Lua script will need to look like the following:
So, to further elaborate, let's say you added the following addon to your Workshop collection: http://steamcommunity.com/sharedfiles/filedetails/?id=104606562
Your Lua script would simply contain the following line of code:
We obtain the ID (104606562) from the URL as you may have guessed. You can see ?id=104606562, you'll simple copy that number to the right of ?id=. Unfortunately, at the time of writing, there isn't a function to force every addon in your collection ID to download, so you'll need to add each respective addon ID for this to work.
NOTE: You must use the ADDON ID in resource.AddWorkshop(). NOT the COLLECTION ID. FastDL will not work if you use resource.AddWorkshop with your COLLECTION ID.
Check out the below link for instructions directly from the Garry's Mod wiki page:
Check out the below link for instructions with using the resource.AddWorkshop function: