Helping people with "resource.addsinglefile" server problems

Like the title says… if you need any help with force downloading, post it on this server. (not download_url though, never used one of those)

Here is an example of one that worked for me for a deadmau5 hat:

resource.AddSingleFile( “materials/robotboy655/deadmau5.vmt” )
resource.AddSingleFile( “materials/robotboy655/deadmau5.vtf” )
resource.AddSingleFile( “materials/robotboy655/deadmau5.vtf.ztmp” )
resource.AddSingleFile( “materials/robotboy655/deadmau5_green.vmt” )
resource.AddSingleFile( “materials/robotboy655/deadmau5_green.vtf” )
resource.AddSingleFile( “materials/robotboy655/deadmau5_green.vtf.ztmp” )
resource.AddSingleFile( “materials/robotboy655/deadmau5_red.vmt” )
resource.AddSingleFile( “materials/robotboy655/deadmau5_red.vtf” )
resource.AddSingleFile( “materials/robotboy655/deadmau5_red.vtf.ztmp” )
resource.AddSingleFile( “models/robotboy655/deadmau5.dx80.vtx” )
resource.AddSingleFile( “models/robotboy655/deadmau5.dx80.vtx.ztmp” )
resource.AddSingleFile( “models/robotboy655/deadmau5.dx90.vtx” )
resource.AddSingleFile( “models/robotboy655/deadmau5.dx90.vtx.ztmp” )
resource.AddSingleFile( “models/robotboy655/deadmau5.mdl” )
resource.AddSingleFile( “models/robotboy655/deadmau5.mdl.ztmp” )
resource.AddSingleFile( “models/robotboy655/deadmau5.phy” )
resource.AddSingleFile( “models/robotboy655/deadmau5.phy.ztmp” )
resource.AddSingleFile( “models/robotboy655/deadmau5.sw.vtx” )
resource.AddSingleFile( “models/robotboy655/deadmau5.sw.vtx.ztmp” )
resource.AddSingleFile( “models/robotboy655/deadmau5.vvd” )
resource.AddSingleFile( “models/robotboy655/deadmau5.vvd.ztmp” )

good luck!

Why use AddSingleFile? With AddFile, there’s no need for ztmp files, nor any other model files other than “.mdl”, or duplicate vtf names.

That could be simplified to

[lua]resource.AddFile( “materials/robotboy655/deadmau5.vmt” )
resource.AddFile( “materials/robotboy655/deadmau5_green.vmt” )
resource.AddFile( “materials/robotboy655/deadmau5_red.vmt” )
resource.AddFile( “models/robotboy655/deadmau5.mdl” )[/lua]

or you write a function to include the files inside a directory

isnt there more console errors with addfile? addsinglefile reduces console errors

No there’s not