TTT Icon Help

So for my TTT server, I’m having a few issues with my icons for the Cannibalism SWEP.

Started with issues with the SWEP working in-game, but it worked when I added it to gamemodes > terrortown > entities > weapons, then it began working. The icon wasn’t working in-game, in the menu, so I tried a few things, including changing the VMT/VTF locations in the actual file. One thing I found odd was VGUI in terrortown > content > materials > VGUI was capitalized, which I’m not sure if it’s supposed to be like that, but I edit the SWEP’s file to be the following;


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

Originally it was just;


if SERVER then
AddCSLuaFile( "shared.lua" )
resource.AddFile("materials/vgui/ttt/ttt_cannibalism.vmt")
resource.AddFile("materials/svgui/ttt/ttt_cannibalism.vtf")
end


And at the bottom of the code it was;


if CLIENT then
SWEP.Icon = "vgui/ttt/ttt_cannibalism"

SWEP.EquipMenuData = {
	type = "Weapon",
	desc = "CANNIBALISM! GET RID OF EVIDENCE AND GAIN HEALTH!"
};
end

But I had changed it to;



if CLIENT then
SWEP.Icon = "materials/VGUI/ttt/ttt_cannibalism.vtf"

SWEP.EquipMenuData = {
	type = "Weapon",
	desc = "Eat bodies to get rid of the evidence, and also to restore some health!"
};
end

So I eventually tried adding it to the FastDL using the following code in lua > autorun > server > cannibalism.lua (custom file name), but unfortunately I had no luck with it, unless I didn’t do it correctly.


resource.AddFile ("ttt_cannibalism.vmt")
resource.AddFile ("ttt_cannibalism.vtf")

**One thing I noted was, when I restarted my server, it didn’t update the description of the Cannibalism SWEP in the Traitor menu, which brings up a bit of controversy. It’s in the code above this, the one that says desc = “yaddayadda”. **

Any help is truly appreciated, so thanks.

In the VMT, did you write


"UnlitGeneric"
{
 "$basetexture" "vgui/Location"
 "$vertexcolor" 1
 "$vertexalpha" 1
 "$translucent" 1
}

? Taken from ttt.badking.net

Perhaps it’s because you did not change the path for the SWEP.Icon, it’s still ““materials/VGUI/ttt/ttt_cannibalism.vtf””.

[editline]22nd February 2014[/editline]

All other Icons use a different path, like the C4: “VGUI/ttt/icon_c4”. It seems the “.vtf” should be omitted and so should the “materials/”

You haven’t fastDl’d it correctly for a start:


 
resource.AddFile("materials/vgui/ttt/ttt_cannibalism.vmt") 
resource.AddFile("materials/vgui/ttt/ttt_cannibalism.vtf") 
--really you only need to fastDL either VTF or the VMT as aslong as they have the same file path and name they'll add the other. 

Secondly;


if SERVER then
AddCSLuaFile( "shared.lua" )
resource.AddFile("materials/vgui/ttt/ttt_cannibalism.vmt")
resource.AddFile("materials/svgui/ttt/ttt_cannibalism.vtf") --"svgui" - nope, vgui, make sure they have the correct file path.
end

Make the VGUI folder lower caps and the filepath to VGUI lower caps as Linux has issues with folders with capital letters.

I figured out how to make the vgui folder lower-case, and I tried changing the FastDL and the SWEP’s contents to ‘vgui’ as opposed to ‘VGUI’, however it’s still pink and black checkerboards, not to mention the description still won’t update.

[editline]22nd February 2014[/editline]

So yeah, icons still not working, don’t understand why it would be, any tips/advice?

Did you do a file sync on your server?

Pretty sure they’re all synced.

[editline]23rd February 2014[/editline]


if CLIENT then
-- Path to the icon material
SWEP.Icon = "vgui/ttt/ttt_cannibalism"


Changed it around like this several times, no luck.

So after a shit-load of trouble-shooting, VMT/VTF editing, altering the shit-codes, and FastDL ass-rape, I was able to successfully fix both of the icons. Thank you for those who helped, otherwise go away.