Page 1 of 1

How do I force content to be downloaded?

Posted: Tue May 22, 2012 4:06 pm
by kraze
To do this you will need to use a LUA file.
  1. Connect to your server FTP by using the connection info on the "File Manager" tab
  2. Navigate to garrysmod/lua/autorun/server/
  3. Create a new "Example.lua" file.
  4. Then add this code for each custom file "resource.AddSingleFile("file path here")"
  5. For each workshop addon added via a collection add "resource.AddWorkshop("workshopid")"
As example of this would be..

Code: Select all

   resource.AddSingleFile( "sound/siege/jihad.wav" )
   resource.AddSingleFile( "sound/siege/big_explosion.wav" )
   resource.AddSingleFile( "materials/vgui/entities/weapon_jihadbomb.vtf" )
   resource.AddSingleFile( "materials/vgui/entities/weapon_jihadbomb.vmt" )
   
   resource.AddWorkshop( "157450041" )
   resource.AddWorkshop( "158962453" )
Save the file, run a websync and your files should be force downloading now.

We have also created a very handy tool to automatically generate a resource.lua file for you. http://www.configcreator.com/create/gmod/resources.lua

Information sourced from http://maurits.tv/data/garrysmod/wiki/w ... xd2d2.html and http://maurits.tv/data/garrysmod/wiki/w ... x5809.html

Re: How do I force content to be downloaded?

Posted: Tue May 07, 2013 6:14 pm
by kraze
We've seen a few people who have tried force downloading map files to clients. Do not do this as it will require all clients who do not have the maps to download them all before joining.

When the server switches to a custom map that the client does not have it will automatically start downloading it for them.