Welcome to the Mesnie, the house, the brotherhood of Gamers, who support your community gaming projects!
Tutorials on the gmod server workshop are rare and incomplete, so I decided to make one.
See also : Creating a dedicated Garry's Mod server under Linux
Feel free to ask any questions you may have in the comments, and to make a donation if you can (top right of the site).
Introduction
Thanks to the Workshop, if you follow this tutorial correctly, you can keep the addons on your Gmod server (Garry's Mod) up to date automatically each time the serv is rebooted, without version problems, you don't need FTP to configure a FastDL and redo it each time a plugin is changed, you relieve your FTP server... In short, there are so many advantages to Gmod servers! The whole thing may seem complex at first, but once you've got the hang of it you'll soon get used to it and it's much easier to manage.
Limits and solutions
Three However, there are two limitations:
- SOLVED!! Addons larger than 64 MB are blocked, Garry being aware of this and doing nothing;
-You are forced to update addons, if any, every time the serv is rebooted (unavoidable but automatic).
-You won't be able to modify the plugin code directly using this method.
If you still want to use addons larger than 64 MB: you'll need to download them client-side (in your game), retrieve the .gma file, rename it, and place it in the server's "addons" folder, subscribe to the item anyway, and follow all the steps in the tutorial, including step 4) so that players download the addon when they connect to the serv if you wish, and you'll need to repeat this procedure each time the addon is updated.
-If you want to modify an addon that can only be found on the workshop, you need to use a .gma extractor and then use your addon as a regular addon, putting its folder in the addons folder.
Here we go, good luck!
Prerequisite:
Access to your server's launch options. You can do this if you host your server yourself on a dedicated machine or at home, for example, but it's blocked with some bad hosts (particularly because you could have a 64-slot server when you're paying for 16, for example), but sometimes you can still manage the workshop.
Mandatory steps :
- Get your Steam API Key
- Create a collection in the workshop, add addons and publish it
- Activate the API and Workshop ID when the server is launched
- Create an LUA file listing all the addons to be downloaded on the client side
- Restart your serv and enjoy!
1) Get your Steam API Key
Go here and follow the instructions https://steamcommunity.com/dev/apikey
Make a note of this key somewhere, it will be used as the -authkey in the server launch options.
2) Create a collection in the workshop, add its addons and publish it
I don't know about you, but personally I find the workshop very, very badly organised, and it's hard to find what you're looking for...
I've put together some nice screenshots for you so you don't have to struggle too much.
We're already on our way to the Gmod workshopLog in to your Steam account.
a) Creating your collection
Then click on "collections" then "create a collection".

Choose a title and a cover image, which must be square and MORE than 195×195 pixels in size.
Enter a description, select the type of collection (default (linked objects) in 99% of cases).
You can add tags to indicate what your collection will contain.
You validate, and end up on a page that is of absolutely no immediate use (the logic of this workshop...).

b) Adding addons to the collection
You return to the workshop and go to the page of an addon that interests you, at random Wiremod
And you add it using the little "add to collection" button.

You add as many as you like, and can then add more and more.
c) Publishing your collection
Don't get me wrong, it's totally counter-intuitive to find your collection...
To do this, return to the Gmod workshop home page, collections tab. This time go right to "Your workshop files" under the search bar. Then the Collections tab.
Click on your collection, and at the top, click on "Publish". otherwise your workshop collection will be inactive.

Well done, the collection is up and running!
d) Write down the ID of your collection
You end up with a collection page whose address looks like this:
http://steamcommunity.com/sharedfiles/filedetails/?id=251973500
Make a note of the ID!!! This number at the end of the URL of your collection, here "251973500" in my case, note it down, for example in your note where you have kept your API, because it will also be useful to you!
3) Activate the API and Workshop ID when the server is launched
If you didn't write down your API when I told you to, you're a bit of a fool, but you can find it again. here.
At this point, as indicated in the prerequisites, you need to be able to define the launch options for your server.
As far as I'm concerned, mine runs on Linux, and I use DanielGibbs' excellent management script in which all you have to do is enter the IDs. In your case, unless you have a fairly well-developed launch script, you may have to do it by hand.
In your shortcut or launch script, where you find options such as -game garrysmod or +map gm_flatgrass, you will add in replacing YourCollectionID and YourSteamAPI with your previously noted values : +host_workshop_collection YourCollectionID -authkey YourSteamAPIKey
Without inverted commas, as is customary syntax.
At this stage, if you restart your server, in the console you should see it retrieve the files from the workshop and extract them automatically.
4) Create an LUA file listing all the addons to be loaded on the client side
The last step is to redo or update it as soon as you add or remove addons! Don't forget!
It consists of ensuring that your users automatically download files from the workshop when they connect to the server. Otherwise, for them, it will be as if the addons had not been installed. Note that pure LUA addons don't need this trick, as the LUA is sent automatically to clients when they connect, unlike addons that contain textures and sounds, for example.
To do this, you will create a .lua file (for example a .txt file that you will rename to .lua) in the :
your server/garrysmod/lua/autorun/server
You give it the name of your choice (without capitals, especially under Linux), for example I called it workshop_launcher.lua
There are 2 methods for filling it in, one manual and one automatic. The manual method is worthwhile if you only have a few addons.
Manual method :
The contents of this file will look like this:
resource.AddWorkshop( "187437437" )
resource.AddWorkshop( "125490679" )
resource.AddWorkshop( "278881337" )
resource.AddWorkshop( "150404359" )
resource.AddWorkshop( "144982052" )
Where between the inverted commas is the ID of each addon, which you need to enter one by one. How do I get the ID?
On an addon page, for example wiremod: http://steamcommunity.com/sharedfiles/filedetails/?id=160250458
The ID corresponds to the number at the end, in this case 160250458
Automatic method
Recently, I discovered a superb tool, a small programme, capable of generating the workshop file, just by entering your CollectionID! It's really handy!
ATTENTION: No longer available!
Use this site! http://www.configcreator.com/create/gmod/resources.lua
Topic link : http://facepunch.com/showthread.php?t=1325685
Direct programme download link : https://mega.co.nz/#!olsDGCzC!TiJ0tW0aOmqsiC3jx-PSlx68gKQ2RU3N7VYtkYayj9I

You enter the ID, click Generate, then I get a few script errors during loading, validate 2 or 3 times, and then all you have to do is copy the list and paste it into your .lua file.
Hours saved if you have lots of addons!
5) Take advantage
All that's left is to restart the serv and ask someone who doesn't have the addons to connect to see if it works.
If everything is good, all you have to do is enjoy! If not, ask your questions - I realise that it's hard to get it right the first time, no matter how hard you try.
Leave a Reply
You must be logged in to post a comment.