• FastDL Models and Materials
    27 replies, posted
hey guys, I just added VIP content to my gmod server. I was wanting to know I would go about forcing everyone who joins the server to download these models so there isnt any errors? I have this in my lua/autorun/ folder. However after testing it seems that is downloading it to my garrysmod/garrysmod/download folder, still causing errors. resource.AddFile( "models/EIREXE/pdm.mdl" ) resource.AddFile( "models/peterboi/masterchief/masterchief.mdl" ) resource.AddFile( "models/player/blockdude.mdl" ) resource.AddFile( "models/player/slow/luigi_gxy.mdl" ) resource.AddFile( "models/player/slow/mario.mdl" ) resource.AddFile( "models/player/slow/mario_gxy.mdl" ) resource.AddFile( "models/player/grim/grim.mdl" ) resource.AddFile( "materials/VGUI/entities/npc_grim.vtf" ) resource.AddFile( "materials/VGUI/entities/npc_grim.vmt" ) resource.AddFile( "materials/models/assistants/waluigi/body.vmt" ) resource.AddFile( "materials/models/assistants/waluigi/body.vtf" ) resource.AddFile( "materials/models/assistants/waluigi/racket.vmt" ) resource.AddFile( "materials/models/assistants/waluigi/racket.vtf" ) resource.AddFile( "materials/models/EIREXE/mikupd/HS.vmt" ) resource.AddFile( "materials/models/EIREXE/mikupd/HS.vtf" ) resource.AddFile( "materials/models/EIREXE/mikupd/metal.vmt" ) resource.AddFile( "materials/models/EIREXE/mikupd/metal.vtf" ) resource.AddFile( "materials/models/EIREXE/mikupd/miku1.vmt" ) resource.AddFile( "materials/models/EIREXE/mikupd/miku1.vtf" ) resource.AddFile( "materials/models/EIREXE/mikupd/miku2.vmt" ) resource.AddFile( "materials/models/EIREXE/mikupd/miku2.vtf" ) resource.AddFile( "materials/models/EIREXE/mikupd/miku03.vmt" ) resource.AddFile( "materials/models/EIREXE/mikupd/miku03.vtf" ) resource.AddFile( "materials/models/EIREXE/mikupd/miku04.vmt" ) resource.AddFile( "materials/models/EIREXE/mikupd/miku04.vtf" ) resource.AddFile( "materials/models/EIREXE/mikupd/toonB_1.vmt" ) resource.AddFile( "materials/models/EIREXE/mikupd/toonB_1.vtf" ) resource.AddFile( "materials/models/EIREXE/mikupd/toonD.vmt" ) resource.AddFile( "materials/models/EIREXE/mikupd/toonD.vtf" ) resource.AddFile( "materials/models/EIREXE/mikupd/toonH_2.vmt" ) resource.AddFile( "materials/models/EIREXE/mikupd/toonH_2.vtf" ) resource.AddFile( "materials/models/EIREXE/mikupd/pelo diva alternativo/miku2.vmt" ) resource.AddFile( "materials/models/EIREXE/mikupd/pelo diva alternativo/miku2.vtf" ) resource.AddFile( "materials/models/grim/grim_normal.vtf" ) resource.AddFile( "materials/models/grim/grimbody.vmt" ) resource.AddFile( "materials/models/grim/grimbody.vtf" ) resource.AddFile( "materials/models/grim/mouth.vmt" ) resource.AddFile( "materials/models/grim/mouth.vtf" ) resource.AddFile( "materials/models/grim/mouth_normal.vtf" ) resource.AddFile( "materials/models/grim/skelface.vmt" ) resource.AddFile( "materials/models/grim/skelface.vtf" ) resource.AddFile( "materials/models/grim/skelface_normal.vtf" ) resource.AddFile( "materials/models/grim/skelface2.vmt" ) resource.AddFile( "materials/models/grim/skelface2.vtf" ) resource.AddFile( "materials/models/grim/skelface2_normal.vtf" ) resource.AddFile( "materials/models/grim/stimer.vmt" ) resource.AddFile( "materials/models/grim/stimer.vtf" ) resource.AddFile( "materials/models/grim/sythe.vmt" ) resource.AddFile( "materials/models/grim/sythe.vtf" ) resource.AddFile( "materials/models/grim/sythe_mask.vtf" ) resource.AddFile( "materials/models/peterboi/masterchief/Masterchief_Armor.vmt" ) resource.AddFile( "materials/models/peterboi/masterchief/Masterchief_Armor.vtf" ) resource.AddFile( "materials/models/peterboi/masterchief/Masterchief_Armor_normal.vtf" ) resource.AddFile( "materials/models/peterboi/masterchief/Masterchief_Clothes.vmt" ) resource.AddFile( "materials/models/peterboi/masterchief/Masterchief_Clothes.vtf" ) resource.AddFile( "materials/models/peterboi/masterchief/Masterchief_Clothes_normal.vtf" ) resource.AddFile( "materials/models/peterboi/masterchief/Masterchief_Visor.vmt" ) resource.AddFile( "materials/models/peterboi/masterchief/Masterchief_Visor.vtf" ) resource.AddFile( "materials/models/peterboi/masterchief/Masterchief_Visor_normal.vtf" ) resource.AddFile( "materials/models/player/blockdude/blockdude.vmt" ) resource.AddFile( "materials/models/player/blockdude/blockdude.vtf" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_body.vmt" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_body.vtf" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_cap.vmt" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_cap.vtf" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_eye.vmt" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_eye.vtf" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_eyelid.vmt" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_eyelid.vtf" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_face.vmt" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_face.vtf" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_fake_logo.vmt" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_hair.vmt" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_hair.vtf" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_hand.vmt" ) resource.AddFile( "materials/models/player/slow/luigi_gxy/slow_hand.vtf" ) resource.AddFile( "materials/models/player/slow/mario/back.vmt" ) resource.AddFile( "materials/models/player/slow/mario/back.vtf" ) resource.AddFile( "materials/models/player/slow/mario/back_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/black.vmt" ) resource.AddFile( "materials/models/player/slow/mario/black.vtf" ) resource.AddFile( "materials/models/player/slow/mario/black_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/buttons.vmt" ) resource.AddFile( "materials/models/player/slow/mario/buttons.vtf" ) resource.AddFile( "materials/models/player/slow/mario/buttons_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/ear.vmt" ) resource.AddFile( "materials/models/player/slow/mario/ear.vtf" ) resource.AddFile( "materials/models/player/slow/mario/ear_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/eyes.vmt" ) resource.AddFile( "materials/models/player/slow/mario/eyes.vtf" ) resource.AddFile( "materials/models/player/slow/mario/eyes_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/gloves.vmt" ) resource.AddFile( "materials/models/player/slow/mario/gloves.vtf" ) resource.AddFile( "materials/models/player/slow/mario/gloves_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/hair.vmt" ) resource.AddFile( "materials/models/player/slow/mario/hair.vtf" ) resource.AddFile( "materials/models/player/slow/mario/hair_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/hat.vmt" ) resource.AddFile( "materials/models/player/slow/mario/hat.vtf" ) resource.AddFile( "materials/models/player/slow/mario/hat_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/irises.vmt" ) resource.AddFile( "materials/models/player/slow/mario/irises.vtf" ) resource.AddFile( "materials/models/player/slow/mario/irises_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/jeans.vmt" ) resource.AddFile( "materials/models/player/slow/mario/jeans.vtf" ) resource.AddFile( "materials/models/player/slow/mario/jeans_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/pants.vmt" ) resource.AddFile( "materials/models/player/slow/mario/pants.vtf" ) resource.AddFile( "materials/models/player/slow/mario/pants_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/shirt.vmt" ) resource.AddFile( "materials/models/player/slow/mario/shirt.vtf" ) resource.AddFile( "materials/models/player/slow/mario/shirt_normal.vtf" ) resource.AddFile( "materials/models/player/slow/mario/shoes.vmt" ) resource.AddFile( "materials/models/player/slow/mario/shoes.vtf" ) resource.AddFile( "materials
Put it in lua/autorun/server instead.
As quoted from the old wiki: [quote]garrysmod/ is the root folder. The capitalization of the path must match the actual path. For convenience, this function will automatically add any other files that are related to the selected one, and throw an error if it can't find them. For example, a .vmt file will automatically add the .vtf with the same name, and a .mdl file will automatically add all .vvd, .ani, .dx80.vtx, .dx90.vtx, .sw.vtx, .phy and .jpg files with the same name, with a separate error for each missing file. If you do not want it to do this, use resource.AddSingleFile.[/quote] Paths in gmod are no longer safe to include capital letters, so make sure no directories you're using for this have a capital letter (or else rename them), and then edit your script to remove capital letters. This is because of the move towards linux compatibility. Of special note is that part about the game automatically add all other file extensions of related sorts for each file you put in. You don't need two lines for each texture, for instance. You should also look into automating this to grab all files within specified folders. Something like... [lua] function resource.AddFolder(path,extension) if path[#path] != '/' then path = path..'/' end if extension[1] != '.' then extension = '.'..extension end local fs, ds = file.Find(path,"GAME") for k, v in pairs(fs) do if string.EndsWith(v,extension) then resource.AddFile(path..v) end end end [/lua] [lua] resource.AddFolder('materials/models/player/slow/luigi_gxy','vmt') resource.AddFolder('materials/models/player/slow/mario','vmt') resource.AddFolder('materials/models/player/slow/mario_gxy','vmt') etc [/lua] you'll need to double check that, it is untested [editline]16th November 2013[/editline] And don't forget about [url=http://facepunch.com/showthread.php?t=1325153]workshop integration[/url]; you can use just steam to control what public workshop files your players receive (server workshop collection subscribing only gives the content to the server, [url=http://facepunch.com/showthread.php?t=1298882&p=41831591&viewfull=1#post41831591]but you can automate the sending to the client[/url]).
I added the lua file to lua/autorun/server/ and it still does not work. Also, thank you for the advise on cleaning up the code, as of right now I would just like it to work. When I add the models / materials directly to gmod it works. However it does not through FastDL, even though it shows it is downloading them.
Does it say it is downloading them [i]every[/i] time you conect? If so, the fastdl is failing. It has nothing to do with the code by this point; your fastdl file mirror isn't working right and you should ask your server provider about it.
I am the service provider...and no it doesnt.
Are they all workshop? If so do resource.AddWorkshop ("WORKSHOPIDGOESHERE") But leave the " when putting it there. It makes people download it faster and they see everything on the model. Thanks, AVOID (Owner of Catalyst Gaming)
They are not, guess ill try to add them to a workshop. [editline]17th November 2013[/editline] This seems WAYYY overly complicated...
Ignore him, resource.AddWorkshop is useless if you have FastDL. Have you synced up the files with your FastDL host?
Once again...I am the FastDL host. So yes.
So what's the issue? Is it not downloading?
It is downloading, however it is downloading to the wrong location for it to be function-able.
It's supposed to download to garrysmod/garrysmod/downloads. Is it not downloading to the download/model or download/materials directories?
garrysmod/downloads is just so that you don't get your main directories clogged with server trash
Okay well then my client is reading from the garrysmod/download/materials
So there's no issue?
isn't* and it is showing an error on pointshop do I need to make it download/materials/player instead of materials/player
No, post your pointshop code for one of your models in [code] tags.
[code] ITEM.Name = 'Halo Playermodel' ITEM.Price = 15000 ITEM.Model = 'models/peterboi/masterchief/masterchief.mdl' function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) end) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) end [/code] [code] ITEM.Name = 'Luigi' ITEM.Price = 15000 ITEM.Model = 'models/player/slow/luigi_gxy.mdl' function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) end) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) end [/code] [code] ITEM.Name = 'Mario' ITEM.Price = 15000 ITEM.Model = 'models/player/slow/mario_gxy.mdl' function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) end) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) end [/code] [code] ITEM.Name = 'Miku' ITEM.Price = 15000 ITEM.Model = 'models/EIREXE/pdm.mdl' function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) end) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) end [/code] [code] ITEM.Name = 'Minecraft Steve' ITEM.Price = 15000 ITEM.Model = 'models/player/blockdude.mdl' function ITEM:OnEquip(ply, modifications) if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) end) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) end [/code]
Send us the sv_downloadurl link you use. Sometimes you have to configure the web server to distribute those files, IIS is very strict with this and you have to [URL="http://technet.microsoft.com/en-us/library/cc725608(v=ws.10).aspx"]manually add them to the mime type list[/URL]. Use "application/x-unknown" as the mime-type. (If you are using IIS as a web-server that is) Your codes are all correct, so it seems that the web server or the server.cfg is at fault here.
I already added each individually to the Mime type list...they're downloading thats not the issue. [editline]17th November 2013[/editline] but my sv_downloadurl is [url]http://enigmaservers.com/fastdl[/url]
Could you please share the mirror with us? [editline]18th November 2013[/editline] Thank you. The downloads seems to be working and your FastDL is correctly setup along with the resource.AddFile codes and the pointshop codes. Have you tried removing everything from the /download folder and manually add it in to make sure the models isn't the issue? Also, are you the only one having this issue or does everyone on the server have the issue?
You said it shows as an error. A missing texture doesn't make it say error, that's a missing model.
Yeah it is the missing model error.
[QUOTE=code_gs;42893825]Ignore him, resource.AddWorkshop is useless if you have FastDL. Have you synced up the files with your FastDL host?[/QUOTE] Dude it works perfect.... You just dont know how it works. Resource.AddFile was taking years so I deleted my fastdl.lua file to see if that was the issue. Sure enough it was, people still see the model and its faster.
Apoligies if you already know this but [code] resource.AddFile( "materials/models/player/slow/mario_gxy/slow_shoe.vmt" ) resource.AddFile( "materials/models/player/slow/mario_gxy/slow_shoe.vtf") [/code] In that instance only either the vtf or the vmt is needed, not both as one auto mounts the other (if they have the same file name and directory) same with .mdl files, all that is required is the w_ and the v_ .mdl files (also requires the same file names and paths for the .dtx80 thingys)
[QUOTE=AVOID;42939339]Dude it works perfect.... You just dont know how it works. Resource.AddFile was taking years so I deleted my fastdl.lua file to see if that was the issue. Sure enough it was, people still see the model and its faster.[/QUOTE] I'm pretty sure I know how it works. It all depends on your regional server since it downloads from Steam. 80% of the time, FastDL is quicker and resource.AddWorkshop does fail. If you want proof, [url]http://facepunch.com/showthread.php?t=1299246[/url] Anyways, if you want to continue to argue, move it to PMs.
[QUOTE=code_gs;42940507]I'm pretty sure I know how it works. It all depends on your regional server since it downloads from Steam. 80% of the time, FastDL is quicker and resource.AddWorkshop does fail. If you want proof, [url]http://facepunch.com/showthread.php?t=1299246[/url] Anyways, if you want to continue to argue, move it to PMs.[/QUOTE] Hmmm... I guess your right
Sorry, you need to Log In to post a reply to this thread.