Main Contents

Idea for Garry’s Mod Mod Downloader

Games, Nerd Shit | Comments (0)

I’ve had a little idea, and if I could could code it could result in a nifty in-game mod downloading tool.

Looking at the Lua documentation the other day, I’ve noticed that there’s a shared function called GetAddonList. This being a shared function it can be called on the server and the client, which makes this all possible. The function will return a list of files in your addons directory.

The server could send a usermessage on connect containing a list of all the addons the server has running, and when the client receives the list it can compare it the addons that game has. If it finds an addon that the server has but the player doesn’t, it will lookup the addon in a database.

On retrieving information about such addons, a message would appear on the client’s screen warning them that they don’t have all the addons they don’t have installed. On click on this warning or whatever, it would open a VGUI page listing human-readable versions of the mod names as well as a button to install it.

This is where two modules will be required. A HTTP module to download a zip of the mod, as Gmod’s HTTP functions have a character limit, and a ZIP module to extract the downloaded content. Though if ZIP support becomes problematic I could always host certain mods unzipped in a directory and it could download each one individually.

Once all the mods the user chooses to download have been downloaded and extracted, it will ask them to restart Gmod for changes to take effect, and then hopefully when they restart the game they’ll have the mods they need, all done with little or no effort as compared to installing manually.

Stephen Swires @ August 13, 2008


Feed