Garrysmod fastDL resource.lua generator

I’m working on a couple different things for a website designed to generate various configuration files for various games. I’ve just added some support for Gmod in the form of a script that will create a resources.lua file used to force downloads of fastDL and workshop addons. It will also let you download the file you’ve created, if you want, or you can just copy the text into your favorite text editor.

It’s probably not too difficult to break and there’s no real instruction as to how to use it on the site itself, yet, but you to add a collection, you would enter only the 9 digit collection ID. For the site, you would put the full path to your fastDL, where it is hosted on webhosting (It would basically be exactly what you have for the sv_downloadurl variable in your server.cfg file). This means including /server/ at the end, if this is where your files are.

You can play with it here: http://www.configcreator.com/

If you break it in some unusual way, feel free to let me know. Also, it currently only looks for materials, models, resource and sound folders, but if you think it should look in other folders, let me know that, too.

Feedback is appreciated!

Edit - If you tried it within about 10 minutes of my posting this, it was broken due to a folder permission, which I just fixed.

Interesting, but why would someone go to a website to create a new config each time they add / remove files when it can be generated when the server starts in real time and recursively?

Still a good first post.

To view: https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/simple_recursive_resource_loader/sv_add_gamemode_resources.lua.html – to download: https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/simple_recursive_resource_loader/sv_add_gamemode_resources.lua

What it does: It calls resource.AddWorkshop on ALL Workshop / *.gma files in server/garrysmod/addons/ folder, and all *.gma <blank> files in server/garrysmod/gamemodes/<gmname>/content/workshop/ ( Read the file to see how to use this in detail. Basically if you want an addon to be downloaded to client for models, and you want to remove the Lua files or whatever, you’d extract it and ensure it isn’t on your server workshop collection, then create an empty .gma file in the directory and name it whatever you want except do not put any digits in your comment… Add the workshop id to the file name somewhere and it’ll be added too. ), and all content from the game-mode content folder will be resource.AddSingleFile’d on launch. It’ll output the number of files added, number of workshop files added, and files skipped ( wrong format, etc ).

If you don’t like it, you’re certainly not under any obligation to use it.

I work for a GSP, where we offer a function in the control panel to copy custom content to webhosting, for fastDL and frequently get asked how they can set this file up (And many others, the reason the site is being developed). Using the site, there’s nothing extra that needs to be installed, they just enter the information and the resources.lua file is provided to them.

For our company, it’s also better to say “Here, use this convenient script we’ve created” (Disclaimer: I created this in my free time, not as an employee, but customers are the primary intended users) than “Here, download a script from a dropbox linked on a forum and install it yourself”. And even though it was created with customers in mind, anyone is free to use it, or not.