Forced Downloads

I’m looking for some advice on forced downloads, I’ve encountered an issue I just can’t seem to resolve after a couple of days.

The issue seems to be that the server isn’t running the lua file to know its supposed to make the clients download the files listed in it.

I first set the forced downloads up from memory, then went to the wiki here:

I also re-read several other resources on the subject including some threads here. I’m nearly certain its configured properly but I’ll explain how its set up here.

I have my forceddownloads.lua in my “garrysmod/lua/autorun/server” directory.

Here is an excerpt from the file itself, the first few lines.



resource.AddSingleFile( "/models/BioPolice.dx80.vtx.bz2" )
resource.AddSingleFile( "/models/BioPolice.dx90.vtx.bz2" )
resource.AddSingleFile( "/models/biopolice.mdl.bz2" )
resource.AddSingleFile( "/models/BioPolice.phy.bz2" ) 

Remove the .bz2 extension, the engine looks for those anyway. Also use AddFile on just the .mdl and it’ll automatically send all the rest of the files for that model. Same for materials using vtf it’ll send the vmt automatically.

See the Additional Notes at the bottom on the wiki: http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index5809.html

I’ll try that (I wanted to use single file so I could easily see where an issue may be if client’s don’t get a specific file.) I don’t see how that will correct the server not attempting to make clients download them though, the resource.AddSingleFile function is just as valid as resource.AddFile and its not as if its not finding the files because of the bz2 or it would be quite apparent as it attempted to download them.

As what Ninja said remove the bzip extension and also remove the first forward stash.

Before:


resource.AddSingleFile( "/models/BioPolice.dx80.vtx.bz2" )
resource.AddSingleFile( "/models/BioPolice.dx90.vtx.bz2" )
resource.AddSingleFile( "/models/biopolice.mdl.bz2" )
resource.AddSingleFile( "/models/BioPolice.phy.bz2" )

After:


resource.AddSingleFile( "models/BioPolice.dx80.vtx" )
resource.AddSingleFile( "models/BioPolice.dx90.vtx )
resource.AddSingleFile( "models/biopolice.mdl" )
resource.AddSingleFile( "models/BioPolice.phy" )

Ok, again your correcting the file paths but not explaining why its not trying to download them at all, regardless of whether the path is right the server should try downloading them! Neither of you have answered the original reason for this post…