FastDL Weapon Icon Issue

Before I get into this, everything that I’ve set up on my fastDL has worked correctly, but icons. I’ve tried for hours trying to figure out how to make them download for my players, but none of the attempts have worked. I don’t see what the problem is, I’m setting it up as I would for any other file.

My code:



resource.AddFile("materials/VGUI/ttt/icon_rusty.vtf")
resource.AddFile("materials/VGUI/ttt/icon_rusty.vmt")


I’ve got those added in a forceddownloads.lua file in my lua/autorun folder.

Could you post the weapon code?

Well I dont think that this has to do anything with the code actually…

I used to have the same problem so it took me a couple of hours to figure out what was actually wrong… In the code I had the same as you but I noticed that the vgui part needed to be lower case due to my fastdl didnt allow me to have upper case folders so I changed it from upper case to lower case on both the servers VGUI folder to vgui and change in the lua to materials/vgui…

Hope it helps :slight_smile:

Sure, here it is. http://pastebin.com/HPeYSC0R

Sadly this didn’t work man, I’ve tried this many times :frowning:

Make sure the force download path is with a lower case vgui. Also may you paste the path that is inside of your .vmt file?

If you haven’t already, put the files in your TTT content directory (gamemodes/terrortown/content/materials/VGUI/ttt) and add the code snippet from the OP to your weapon code like this:


if SERVER then
   resource.AddFile("models/weapons/w_357_rusty.mdl")
   resource.AddFile("materials/VGUI/ttt/icon_rusty.vtf")
   resource.AddFile("materials/VGUI/ttt/icon_rusty.vmt")
   AddCSLuaFile()
end


I’ve tried making the forced download path as a lowercase vgui and capital VGUI. Not really sure if this is what you’re looking for since I didn’t make the .vmt file, but here’s what’s inside.



"VertexLitGeneric"
{
	"$baseTexture" "Models/Weapons/w_357_rusty/w_357"
}


The files dont have to be in the inside of the gamemode folder. It works perfectly find outside of the folder.

I’ve done a lot of custom icon work, so I should be able to help here. To get mine to work, I’ve put the .vmt at the top of the file with resource.addfile. So instead of making a forcedownload.lua file, edit up the shared.lua of the swep.

So your code is:


if SERVER then
   resource.AddFile("models/weapons/w_357_rusty.mdl")
   AddCSLuaFile()
end

You would add the vtf/vmt underneath the model line.

For example, here’s the top of our mp5 code:


if SERVER then
   AddCSLuaFile( "shared.lua" )
   resource.AddFile("materials/VGUI/ttt/icon_empg_mp5.vmt")
end

I assume you already know to name your icon something unique and make sure the image has the right ‘properties’.

Yeah, I’ve also tried



resource.AddFile("materials/icons/icon_drilldo.vmt")
resource.AddFile("materials/icons/icon_drilldo.vtf")


I’ll try this, thanks for the help.

Ya go into your .vmt file and check what the path file is. It’s most likely the vmt path file your having issues with.

Here’s whats inside the vmt file path.



"VertexLitGeneric"
{
	"$baseTexture" "Models/Weapons/w_357_rusty/w_357"
}


The icon works fine for me since I have it locally

Thats the path of your icon? If it is the path is wrong which explains why it isn’t working.

No, the path to the icon that’s in the weapon file is


vgui/ttt/icon_rusty

The path to the icon in the fastDL file is


resource.AddFile("materials/vgui/ttt/icon_rusty.vmt")