{"id":74,"date":"2014-10-22T02:39:00","date_gmt":"2014-10-22T00:39:00","guid":{"rendered":"http:\/\/www.mesnie.org\/?p=74"},"modified":"2016-02-05T00:21:16","modified_gmt":"2016-02-04T23:21:16","slug":"configuring-your-garrys-mod-server-workshop-under-linux-or-windows","status":"publish","type":"post","link":"https:\/\/terageek.org\/en\/tuto\/configurer-le-workshop-de-son-serveur-garrys-mod-sous-linux-ou-windows\/","title":{"rendered":"Configuring your Garry's Mod server workshop"},"content":{"rendered":"<p style=\"text-align: justify;\">Welcome to the Mesnie, the house, the brotherhood of Gamers, who support your community gaming projects!<\/p>\n<p style=\"text-align: justify;\">Tutorials on the gmod server workshop are rare and incomplete, so I decided to make one.<\/p>\n<p style=\"text-align: justify;\">See also : <a href=\"http:\/\/www.mesnie.org\/tuto\/tuto-serveur-gmod-dedie-sous-linux\/\">Creating a dedicated Garry's Mod server under Linux\u00a0<\/a><\/p>\n<p style=\"text-align: justify;\"><span style=\"text-decoration: underline;\">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).<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3>Introduction<\/h3>\n<p>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.<\/p>\n<p>&nbsp;<\/p>\n<h3>Limits and solutions<\/h3>\n<p><del>Three<\/del> However, there are two limitations:<\/p>\n<p>- SOLVED!! <del>Addons larger than 64 MB are blocked, Garry being aware of this and doing nothing;<\/del><\/p>\n<p>-You are forced to update addons, if any, every time the serv is rebooted (unavoidable but automatic).<\/p>\n<p>-You won't be able to modify the plugin code directly using this method.<\/p>\n<p>&nbsp;<\/p>\n<p><del>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.<\/del><\/p>\n<p>-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.<\/p>\n<p>&nbsp;<\/p>\n<p>Here we go, good luck!<\/p>\n<p>&nbsp;<\/p>\n<h3>Prerequisite:<\/h3>\n<p>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.<\/p>\n<p>&nbsp;<\/p>\n<h3>Mandatory steps :<\/h3>\n<ol>\n<li>Get your Steam API Key<\/li>\n<li>Create a collection in the workshop, add addons and publish it<\/li>\n<li>Activate the API and Workshop ID when the server is launched<\/li>\n<li>Create an LUA file listing all the addons to be downloaded on the client side<\/li>\n<li>Restart your serv and enjoy!<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<blockquote><p><strong>1) Get your Steam API Key<\/strong><\/p><\/blockquote>\n<p>Go here and follow the instructions <a href=\"https:\/\/steamcommunity.com\/dev\/apikey\" target=\"_blank\">https:\/\/steamcommunity.com\/dev\/apikey<\/a><br \/>\nMake a note of this key somewhere, it will be used as the -authkey in the server launch options.<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p>\u00a0<strong>2) Create a collection in the workshop, add its addons and publish it<\/strong><\/p><\/blockquote>\n<p>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...<br \/>\nI've put together some nice screenshots for you so you don't have to struggle too much.<br \/>\nWe're already on our way to the <a title=\"Gmod workshop\" href=\"http:\/\/steamcommunity.com\/workshop\/browse?appid=4000\" target=\"_blank\">Gmod workshop<\/a>Log in to your Steam account.<\/p>\n<p><strong>a) Creating your collection<\/strong><\/p>\n<p>Then click on \"collections\" then \"create a collection\".<\/p>\n<figure style=\"width: 1088px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/image.noelshack.com\/fichiers\/2014\/39\/1411502579-collections.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"http:\/\/image.noelshack.com\/fichiers\/2014\/39\/1411502579-collections.jpg\" alt=\"\" width=\"1088\" height=\"853\" \/><\/a><figcaption class=\"wp-caption-text\">gmod collections<\/figcaption><\/figure>\n<p>Choose a title and a cover image, which must be square and MORE than 195\u00d7195 pixels in size.<br \/>\nEnter a description, select the type of collection (default (linked objects) in 99% of cases).<br \/>\nYou can add tags to indicate what your collection will contain.<\/p>\n<p>You validate, and end up on a page that is of absolutely no immediate use (the logic of this workshop...).<\/p>\n<figure style=\"width: 1001px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/image.noelshack.com\/fichiers\/2014\/39\/1411502867-collection-inutile.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"http:\/\/image.noelshack.com\/fichiers\/2014\/39\/1411502867-collection-inutile.jpg\" alt=\"\" width=\"1001\" height=\"727\" \/><\/a><figcaption class=\"wp-caption-text\">unnecessary collection<\/figcaption><\/figure>\n<p><strong>b) Adding addons to the collection<\/strong><\/p>\n<p>You return to <a title=\"the workshop\" href=\"http:\/\/steamcommunity.com\/workshop\/browse?appid=4000\" target=\"_blank\">the workshop<\/a> and go to the page of an addon that interests you, at random <a title=\"Wiremod\" href=\"http:\/\/steamcommunity.com\/sharedfiles\/filedetails\/?id=160250458\" target=\"_blank\">Wiremod<\/a><br \/>\nAnd you add it using the little \"add to collection\" button.<\/p>\n<figure style=\"width: 993px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/image.noelshack.com\/fichiers\/2014\/39\/1411503153-collection-ajouter.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"http:\/\/image.noelshack.com\/fichiers\/2014\/39\/1411503153-collection-ajouter.jpg\" alt=\"\" width=\"993\" height=\"667\" \/><\/a><figcaption class=\"wp-caption-text\">Add collection<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>You add as many as you like, and can then add more and more.<\/p>\n<p><strong>c) Publishing your collection<\/strong><\/p>\n<p>Don't get me wrong, it's totally counter-intuitive to find your collection...<br \/>\nTo do this, return to the Gmod workshop home page, <a title=\"Collections&quot; tab\" href=\"http:\/\/steamcommunity.com\/workshop\/browse\/?appid=4000&amp;section=collections\" target=\"_blank\">collections tab<\/a>. This time go right to \"Your workshop files\" under the search bar. Then the Collections tab.<\/p>\n<p>Click on your collection, and at the top, click on \"Publish\". <strong>otherwise your workshop collection will be inactive.<\/strong><\/p>\n<figure style=\"width: 1054px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/image.noelshack.com\/fichiers\/2014\/39\/1411503595-collection-publier.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"http:\/\/image.noelshack.com\/fichiers\/2014\/39\/1411503595-collection-publier.jpg\" alt=\"\" width=\"1054\" height=\"764\" \/><\/a><figcaption class=\"wp-caption-text\">Publish<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Well done, the collection is up and running!<\/p>\n<p><strong>d) Write down the ID of your collection<\/strong><\/p>\n<p>You end up with a collection page whose address looks like this:<\/p>\n<p><code>http:\/\/steamcommunity.com\/sharedfiles\/filedetails\/?id=251973500<\/code><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\">Make a note of the ID!!!<\/span>\u00a0 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!<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p><strong>3) Activate the API and Workshop ID when the server is launched<\/strong><\/p><\/blockquote>\n<p>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.\u00a0<a title=\"here\" href=\"https:\/\/steamcommunity.com\/dev\/apikey\" target=\"_blank\">here<\/a>.<\/p>\n<p>At this point, as indicated in the prerequisites, you need to be able to define the launch options for your server.<\/p>\n<p>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.<br \/>\nIn your shortcut or launch script, where you find options such as -game garrysmod or +map gm_flatgrass, you will add in <strong>replacing YourCollectionID and YourSteamAPI with your previously noted values <\/strong>: +host_workshop_collection YourCollectionID -authkey YourSteamAPIKey<br \/>\nWithout inverted commas, as is customary syntax.<\/p>\n<p>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.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p><strong>4) Create an LUA file listing all the addons to be loaded on the client side<\/strong><\/p><\/blockquote>\n<p>The last step is to redo or update it as soon as you add or remove addons! Don't forget!<br \/>\nIt 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.<\/p>\n<p>To do this, you will create a .lua file (for example a .txt file that you will rename to .lua) in the :<br \/>\nyour server\/garrysmod\/lua\/autorun\/server<br \/>\nYou give it the name of your choice (without capitals, especially under Linux), for example I called it workshop_launcher.lua<\/p>\n<p>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.<\/p>\n<p><strong>Manual method :<\/strong><br \/>\nThe contents of this file will look like this:<br \/>\n<code>resource.AddWorkshop( \"187437437\" )<br \/>\nresource.AddWorkshop( \"125490679\" )<br \/>\nresource.AddWorkshop( \"278881337\" )<br \/>\nresource.AddWorkshop( \"150404359\" )<br \/>\nresource.AddWorkshop( \"144982052\" )<br \/>\n<\/code><br \/>\nWhere between the inverted commas is the ID of each addon, which you need to enter one by one. How do I get the ID?<br \/>\nOn an addon page, for example wiremod: http:\/\/steamcommunity.com\/sharedfiles\/filedetails\/?id=160250458<br \/>\nThe ID corresponds to the number at the end, in this case 160250458<\/p>\n<p><strong>Automatic method<\/strong><br \/>\nRecently, I discovered a superb tool, a small programme, capable of generating the workshop file, just by entering your CollectionID! It's really handy!<\/p>\n<p>ATTENTION: No longer available!<\/p>\n<p>Use this site!\u00a0<a href=\"http:\/\/www.configcreator.com\/create\/gmod\/resources.lua\" target=\"_blank\">http:\/\/www.configcreator.com\/create\/gmod\/resources.lua<\/a><br \/>\n<del>Topic link : <a href=\"http:\/\/facepunch.com\/showthread.php?t=1325685\" target=\"_blank\">http:\/\/facepunch.com\/showthread.php?t=1325685<\/a><\/del><br \/>\n<del> Direct programme download link :\u00a0<a href=\"https:\/\/mega.co.nz\/#!olsDGCzC!TiJ0tW0aOmqsiC3jx-PSlx68gKQ2RU3N7VYtkYayj9I\" target=\"_blank\">https:\/\/mega.co.nz\/#!olsDGCzC!TiJ0tW0aOmqsiC3jx-PSlx68gKQ2RU3N7VYtkYayj9I<\/a><\/del><\/p>\n<figure style=\"width: 349px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/image.noelshack.com\/fichiers\/2014\/39\/1411504782-workshop-ressource-generator.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"http:\/\/image.noelshack.com\/fichiers\/2014\/39\/1411504782-workshop-ressource-generator.jpg\" alt=\"ressource generator workshop\" width=\"349\" height=\"467\" \/><\/a><figcaption class=\"wp-caption-text\">ressource generator workshop<\/figcaption><\/figure>\n<p>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.<\/p>\n<p>Hours saved if you have lots of addons!<\/p>\n<p>&nbsp;<\/p>\n<blockquote><p><strong>5) Take advantage<\/strong><\/p><\/blockquote>\n<p>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.<\/p>\n<p>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.<\/p>","protected":false},"excerpt":{"rendered":"<p>Bienvenue chez la Mesnie, la maison, la fratrie des Gamers, qui porte vos projets de jeu en communaut\u00e9 ! Les tutos sur le workshop des serveurs gmod\u00a0sont rares et incomplets, j&rsquo;ai donc d\u00e9cid\u00e9 d&rsquo;en faire un. Voir aussi : Cr\u00e9er un serveur Garry&rsquo;s Mod d\u00e9di\u00e9 sous Linux\u00a0 N&rsquo;h\u00e9sitez pas \u00e0 poser vos questions en commentaires, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":81,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[20,19,15,4,13,5,21,18,12,16,17,14],"class_list":["post-74","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tuto","tag-api","tag-api-key","tag-garrys-mod","tag-gmod","tag-server","tag-serveur","tag-srcds","tag-steam-api","tag-tuto-2","tag-tutorial","tag-tutoriel","tag-workshop"],"_links":{"self":[{"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":0,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/media\/81"}],"wp:attachment":[{"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/terageek.org\/en\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}