• Forcedownload
    7 replies, posted
Sorry if there might have been a bunch of things about similar things on here, But I can't use the Search for some reason. Anyway, I can't get this Forcedownload thing to work, I'm trying to install a model and it's materials, The model works fine and I got The Materials in a folder ready for AddDir, but It won't work. Take A look. [QUOTE]function AddDir(dir) // Recursively adds everything in a directory to be downloaded by client local list = file.FindDir("../"..dir.."/*") for _, fdir in pairs(list) do if fdir != ".svn" then // Don't spam people with useless .svn folders AddDir(dir.."/"..fdir) end end for k,v in pairs(file.Find(dir.."/*", true)) do resource.AddFile(dir.."/"..v) end end AddDir("materials/trench") resource.AddFile( "models/player/policetrench.mdl" )[/QUOTE] To clarify, When I join the game and Choose the Stuff to whatever, The model is there but it's got no texture, I.E, It's Purple and Black. Any help with this would be appreciated, Also, If You know where I can get a working tool to add all the Material files that could work too. Thanks. EDIT: Also this. [IMG]http://i.imgur.com/s7sWp.png?1[/IMG] That is the Error in HLDS that I get.
Don't use that code. Use this program instead. [url]http://facepunch.com/showthread.php?t=904405[/url]
[QUOTE=Cyberuben;38324090]Don't use that code. Use this program instead. [url]http://facepunch.com/showthread.php?t=904405[/url][/QUOTE] Thanks. [editline]4th November 2012[/editline] That too actually did this. [QUOTE]resource.AddFile( "models/player/policetrench.mdl" ) resource.AddSingleFile( "barneyface.vmt" ) resource.AddSingleFile( "black.vtf" ) resource.AddSingleFile( "blank_n.vtf" ) resource.AddSingleFile( "bmouth.vmt" ) resource.AddSingleFile( "boots_n.vtf" ) resource.AddSingleFile( "detail_leather.vtf" ) resource.AddSingleFile( "dt_fabric2.vtf" ) resource.AddSingleFile( "dt_leather1.vtf" ) resource.AddSingleFile( "eyeball_l.vmt" ) resource.AddSingleFile( "eyeball_r.vmt" ) resource.AddSingleFile( "eye_ao.vtf" ) resource.AddSingleFile( "eye_glow.vtf" ) resource.AddSingleFile( "eye_lightwarp.vtf" ) resource.AddSingleFile( "gasmask.vmt" ) resource.AddSingleFile( "gasmask_exp.vtf" ) resource.AddSingleFile( "gasmask_lens.vmt" ) resource.AddSingleFile( "gasmask_neck.vmt" ) resource.AddSingleFile( "gloves.vtf" ) resource.AddSingleFile( "gloves2_n.vtf" ) resource.AddSingleFile( "gloves_n.vtf" ) resource.AddSingleFile( "hands.vmt" ) resource.AddSingleFile( "MetrocopBoots.vmt" ) resource.AddSingleFile( "metrocop_sheet.vmt" ) resource.AddSingleFile( "metrocop_sheet_normal - ¬«»¿n.vtf" ) resource.AddSingleFile( "metrocop_sheet_normal.vtf" ) resource.AddSingleFile( "noise_detail_01.vtf" ) resource.AddSingleFile( "normal.vtf" ) resource.AddSingleFile( "reflection-cubemap-.vtf" )[/QUOTE] Notice how the resource.AddSingleFile's do not have the paths, That removed a lot of the work though so still, Thanks. But if anyone could show Me a tool that adds the directories as well that would be Good.
There is no tool that adds directories. It's a code you probably found on the Gmod wiki, it's not working and has been reported as "broken" by many server owners. I've been posting that link to the Resource generator plenty of times to people with exactly the same problem. I know what I am talking about. No idea why I was rated dumb, but since I do know what I talk about, it's just childish. I may not given him the exact answer he asked for, but it's a working answer. Also, Noobin, you have to select the "steamapps/<yourusername>/garrysmod/garrysmod" folder, using the tool, not the folder containing the materials. In the tool you can select the "addons folder". If you do this, select "steamapps/<yourusername>/garrysmod/garrysmod/addons" If you're on a server, select "/orangebox/garrysmod/" and for the addons folder select "/orangebox/garrysmod/addons". There is nothing wrong with the tool, have been using it for quite a while. If you get the wrong output, it's you doing something wrong, not the tool.
[QUOTE=Cyberuben;38326191]There is no tool that adds directories. It's a code you probably found on the Gmod wiki, it's not working and has been reported as "broken" by many server owners. I've been posting that link to the Resource generator plenty of times to people with exactly the same problem. I know what I am talking about. No idea why I was rated dumb, but since I do know what I talk about, it's just childish. I may not given him the exact answer he asked for, but it's a working answer. Also, Noobin, you have to select the "steamapps/<yourusername>/garrysmod/garrysmod" folder, using the tool, not the folder containing the materials. In the tool you can select the "addons folder". If you do this, select "steamapps/<yourusername>/garrysmod/garrysmod/addons" If you're on a server, select "/orangebox/garrysmod/" and for the addons folder select "/orangebox/garrysmod/addons". There is nothing wrong with the tool, have been using it for quite a while. If you get the wrong output, it's you doing something wrong, not the tool.[/QUOTE] I didn't rate You dumb. Anyway, Thanks, But could You help with something else? I'm not sure if This is allowed but here, Take a look and see if You can help Me out some more if You want, Seems kind of related. [URL="http://facepunch.com/showthread.php?t=1223591"]http://facepunch.com/showthread.php?t=1223591[/URL]
You can update the AddDir code from the wiki with the new file library changes. [lua]function AddDir(dir) // Recursively adds everything in a directory to be downloaded by client local list = file.Find("../"..dir.."/*", "GAME") for _, fdir in pairs(list) do if fdir != ".svn" then // Don't spam people with useless .svn folders AddDir(dir.."/"..fdir) end end[/lua] [url]https://docs.google.com/document/d/1CIMxhvD7UX1lJPGi_DpDmPdTcVloIDYo-6AAMQl_KCs/edit?pli=1[/url]
[QUOTE=rokrox;38339196]You can update the AddDir code from the wiki with the new file library changes. [lua]function AddDir(dir) // Recursively adds everything in a directory to be downloaded by client local list = file.Find("../"..dir.."/*", "GAME") for _, fdir in pairs(list) do if fdir != ".svn" then // Don't spam people with useless .svn folders AddDir(dir.."/"..fdir) end end[/lua] [url]https://docs.google.com/document/d/1CIMxhvD7UX1lJPGi_DpDmPdTcVloIDYo-6AAMQl_KCs/edit?pli=1[/url][/QUOTE] Yet the code is buggy and a workaround, doesn't work all the times.
will I be the first to point out that file.Find returns 1 table of files and 1 table of folders? aka that won't search recursively
Sorry, you need to Log In to post a reply to this thread.