Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
EVERY tutorial told me I had to extract the addon that I got from Workshop using either Gmad Convert, or Gmad Extractor, and then add the folder to my server addons. While also using +host_workshop_collection and -authkey, so it will download the same addon from your collection. However if you do this, your server tries to add the same addon twice. It adds the Legacy Version(the folder version of your addon) and the Workshop Version(the .gma files in your addons), when the server tries to load the same addon at the same time it conflicts and causes issues. It took me a long time to figure this out, all because people on YouTube are autistic.
So basically to put addons on your server do this. Any custom addons (ones you've made yourself, coderhire, scriptfodder, or any non-workshop addons) that addon goes straight into your addons folder, and then use Fox's resource generator to add them to your resource.lua in lua/autorun/server. That's it, nothing else.
For Workshop addons, make sure ALL the addons you want are in a collection. Make sure your +host_workshop_collection and -authkey are set in your server.cfg(or if you have NFO or something with a similar control panel, add it through that. After that, add the workshop ID's to resource.lua using resource.AddWorkshop("ID Here"). That's it, nothing else. Don't extract the addon or do any ♥♥♥♥♥♥♥♥ like YouTube tells you to. The only time you do that is if you plan to edit the addon, and in that case make SURE you REMOVE it from your collection and from resource.lua otherwise your server will crash.
As long as you follow this you should have no issues at all. I'm currently running on NFO and have 506 Workshop Addons, and 51 Custom/Script Fodder addons. No problems at all.
Sorry for the poorly formated tutorial but I'm trying to do this quite fast as I have other things to do. If you do have any other problems though, please do add me on Steam, and I will help you out the best that I can.
Also, it's -condebug to print your entire server console to a "console.log" file. Very useful for finding errors, however, -condebug doesn't tell you the problem I just explained, I had a friend of mine tell me.
A lot of places have resource list GENERATORS which have to be run any time content has changed... My system is automated. All gma files in the addons folder on the server are added to the resource list so clients download them. In addition, all gamemodes/gm_name/content/* content is added too.
If that's not enough, I create a folder in the data folder called fastdl/ - all content files are copied there in their respective folders. They are named blah.ext.txt... A batch file is also created which needs to be renamed from blah.bat.txt to blah.bat and executed as admin....
This batch file renames ALL of the files in the fastdl data folder by removing the txt extension. I am also working on it to automatically compress the files ( using Lua and the batch file will rename those too ). After renaming the files, the files are moved to a folder of your choosing.
The default folder I chose to use is the default WAMP Server folder ( Always test your server using a local SRCDS, including a local HTTP server )...
In short, I make it as easy as possible for you, so when you do want to use this on your production server, you just drag and drop the fastdl/ folder from the final directory path to your ftp online, or keep it on your localhost and use your http://ip/fastdl/ as the url for the downloadurl if you want...
Put into addons, it handles all content, and fastdl files. run the bat file as admin, then drag and drop onto FTP if you have a non-local server... If you have a dedicated box you could do your testing on a dedicated dev server on that box to make it 'easier' for moving the fastdl files, however I recommend always using a local srcds because you can run multiple gmod clients at once, see the console, etc...
One side-note... If you want the client to download a workshop file / id but you don't have the .gma file in your addons folder ( or you extracted it to make changes ) then you can use an empty file named blah_blah_blah_1234567.gma ( make sure the only numbers in the filename are from the id, don't use 1_blah_blah_1234567 otherwise the id will be read as 11234567 ) in the appropriate folder and that will be downloaded....
If I recall correctly, I set up the gamemodes/gm_name/content/ dir to be completely recursed, so you can create a separate folder called workshop/ in there and put the blank file .gmas in there you want downloaded.. At the top of the file, I listed examples of how I added m9k files ( for the models ) to be downloaded by the client ( I removed the Lua files because of coding issues and used my own base to run the models which are excellent )...
Actually, yes... The folder must be named workshop/ inside of gamemodes/gm_name/content/
Or, you can put the files in the addons/ folder... Either works.
This is the current one that's known working: https://www.dropbox.com/s/rxk7xfiuzweig4e/sv_add_gamemode_resources_old.lua?dl=0
And this is the one I'm working on as time permits - it has more comments to help it with teaching, and because it is adding more functionality... This is the one which will have the built in compression, etc...
https://www.dropbox.com/s/nu6emfd6iyspr99/sv_add_gamemode_resources.lua?dl=0
One more side note... Files are ONLY moved to the data/fastdl/ folder if the file has changed, or doesn't exist... So, it is best to not delete the folder...
I will eventually add a command, which, when called, will process everything and make the folders and copy the files and all that -- or convar which when set, will process the data when the server starts up instead of simply adding...
But, as it all happens on startup and since it doesn't output every file to the console ( unless you enable the convar ) the time it takes to process thousands of files is incredibly fast. If you enable debugging, it will take a lot longer as print statements are incredibly expensive to run...
Later, as I mentioned, I will be adding either a command or convar so the data is only processed when you want it to... I may also change it so that it is only processed on first launch ( ie if the server hasn't crashed or restarted then it won't try to copy files over... if it has, then it will ) which isn't difficult to do.. I may simply do this instead.