• Auto-Workshop Adder for Dedicated Servers: Never type AddWorkshop again
    11 replies, posted
Picture of example output: [IMG]https://steamuserimages-a.akamaihd.net/ugc/172667621370647681/490B5B5E3A7CD1B1182F35B2EEDE9BB50C7B0C0A/[/IMG] Addon located at: [url]http://steamcommunity.com/sharedfiles/filedetails/?id=893736359[/url] Gist located at: [url]https://gist.github.com/Iamgoofball/b00a183eab1739bf6aee49cf9273e80d[/url] Tired of typing resource.AddWorkshop("1234567890") for the billionth time? With the [b]Auto-Workshop Adder[/b], you never have to do that again! Simply follow these easy setup instructions and you'll be able to get your workshop downloads set up in seconds! This was created after I was given a list of 90 addons for some darkRP server and was told to set up downloading for all of them. I didn't feel like typing in 90 numbers manually, or going to some website Initial Setup: [b]Step 1.[/b] Add this addon to your workshop collection. [b]Step 2.[/b] Make sure your server has an API Key and a Workshop collection in the launch path for SRCDS. [b]Step 3.[/b] Turn on your server. [b]If some or all of the addons are listed as invalid, do not worry![/b] This is normal due to engine.GetAddons() being rather finicky about the first time addons are located and loaded. [b]Step 4.[/b] After it has fully loaded, shut off your server, and turn it back on again. [b]Step 5.[/b] Players can now join and automatically download the addons from Steam's servers and mount them while joining! [b]Please note this does not bypass player download filter settings.[/b] Only they can adjust those. No more directing players to subscribe to your collection! No more clogging your game with loads of addons you don't ever use because the server owner didn't want to manually AddWorkshop everything! It's a win/win situation for everyone! Putting new addon(s) on the server: [b]Step 1.[/b] Shut down the server, and add your new addon(s) [b]Step 2.[/b] Restart the server. The new addons will be marked as invalid, [b]due to a engine bug[/b]. Shut the server off again, and turn it back on a second time. [b]Step 3.[/b] When the server turns on again, the addon will now be available to players joining! Q&A/Troubleshooting: [b]Q:[/b] I restarted the server but the addon is still invalid! [b]A:[/b] Restart a second time, and if the error still persists, try removing the addon from the collection, restarting, re-adding it, then restarting again. [b]Q:[/b] That didn't work! [b]A:[/b] The addon is either off the workshop, or corrupted somehow. It likely isn't functional to begin with. If you can verify this is not the case, leave a comment and I'll try to assist you. I understand this isn't exactly the most complex script, or that a lot of the people who frequent this subforum likely have their own homebrew version of this, but a majority of servers and server owners do not and would heavily benefit from being able to implement this with one addition to their workshop collection. The restarting is rather obnoxious but it's due to engine.GetAddons() not returning a wsid inside the addon table if it's the first time the addon has launched, for whatever fucking reason. Probably just a bug. If anyone's got a way around this, please let me know.
can you put this on Github. I don't want to go through decompiling the addon to see how it works...
I love this.
[QUOTE=pineappleplay;52029370]can you put this on Github. I don't want to go through decompiling the addon to see how it works...[/QUOTE] I'll throw it into a gist, it's pretty simple so I didn't bother making a repo.
Awesome :D
I don't get it? Is it supposed to download workshop content to the server or allow the workshop addons to be auto downloaded for clients that join? I just use steam to add ws addons to a collection and set the server to download the collection addons. And all you need to do is visit ws pages to add them to collections.
[QUOTE=Extra Mental;52229892]I don't get it? Is it supposed to download workshop content to the server or allow the workshop addons to be auto downloaded for clients that join? I just use steam to add ws addons to a collection and set the server to download the collection addons. And all you need to do is visit ws pages to add them to collections.[/QUOTE] It's supposed to output a string with every single resource.AddWorkshop you'd ever need to manually type in order to set up WorkshopDL. Similar to f0x's resource generator
It's cool, but personally I'd never get to 90 addons. Props for doing something about it.
Adding addons that are pure lua, server-only and other unneeded shit for clients to download, nice.
I don't mean to be so negative, but there already exists addons that do this (and for quite some time). The [URL="https://steamcommunity.com/sharedfiles/filedetails/?id=309020990"]workshop download script[/URL] by Parakeet does this but also handles addons which the client doesn't need to download. E.g. An addon containing only a map which isn't the current map, lua only addons, etc.
Rad as hell, didn't know that existed. Whoops.
Pretty cool for very little code. Glad this is a thing!
Sorry, you need to Log In to post a reply to this thread.