Traitor Icons

Hi there, think this is the right section?

Anyway to the point, I’ve read this: http://ttt.badking.net/custom-weapon-guide. I’ve downloaded the example script and weapon ( AK47 ) aswell; and edited the path location to the icon I have in the shared.lua file. However, the icon doesn’t show and I get the purple + black. The weapon does work just to let you know.

Here’s the shared.lua file for the AK47:


						---- Example TTT custom weapon

-- First some standard GMod stuff
if SERVER then
   AddCSLuaFile( "shared.lua" )
end

if CLIENT then
   SWEP.PrintName = "AK47"
   SWEP.Slot      = 6 -- add 1 to get the slot number key

   SWEP.ViewModelFOV  = 72
   SWEP.ViewModelFlip = true
end

-- Always derive from weapon_tttbase.
SWEP.Base				= "weapon_tttbase"

--- Standard GMod values

SWEP.HoldType			= "ar2"

SWEP.Primary.Delay       = 0.08
SWEP.Primary.Recoil      = 1.9
SWEP.Primary.Automatic   = true
SWEP.Primary.Damage      = 20
SWEP.Primary.Cone        = 0.025
SWEP.Primary.Ammo        = "smg1"
SWEP.Primary.ClipSize    = 45
SWEP.Primary.ClipMax     = 90
SWEP.Primary.DefaultClip = 45
SWEP.Primary.Sound       = Sound( "Weapon_AK47.Single" )

SWEP.IronSightsPos = Vector( 6.05, -5, 2.4 )
SWEP.IronSightsAng = Vector( 2.2, -0.1, 0 )

SWEP.ViewModel  = "models/weapons/v_rif_ak47.mdl"
SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl"


--- TTT config values

-- Kind specifies the category this weapon is in. Players can only carry one of
-- each. Can be: WEAPON_... MELEE, PISTOL, HEAVY, NADE, CARRY, EQUIP1, EQUIP2 or ROLE.
-- Matching SWEP.Slot values: 0      1       2     3      4      6       7        8
SWEP.Kind = WEAPON_EQUIP1

-- If AutoSpawnable is true and SWEP.Kind is not WEAPON_EQUIP1/2, then this gun can
-- be spawned as a random weapon. Of course this AK is special equipment so it won't,
-- but for the sake of example this is explicitly set to false anyway.
SWEP.AutoSpawnable = false

-- The AmmoEnt is the ammo entity that can be picked up when carrying this gun.
SWEP.AmmoEnt = "item_ammo_smg1_ttt"

-- CanBuy is a table of ROLE_* entries like ROLE_TRAITOR and ROLE_DETECTIVE. If
-- a role is in this table, those players can buy this.
SWEP.CanBuy = { ROLE_TRAITOR }

-- InLoadoutFor is a table of ROLE_* entries that specifies which roles should
-- receive this weapon as soon as the round starts. In this case, none.
SWEP.InLoadoutFor = nil

-- If LimitedStock is true, you can only buy one per round.
SWEP.LimitedStock = false

-- If AllowDrop is false, players can't manually drop the gun with Q
SWEP.AllowDrop = true

-- If IsSilent is true, victims will not scream upon death.
SWEP.IsSilent = false

-- If NoSights is true, the weapon won't have ironsights
SWEP.NoSights = false

-- Equipment menu information is only needed on the client
if CLIENT then
   -- Path to the icon material
   SWEP.Icon = "VGUI/ttt/icon_fissure_ak47"
   -- Text shown in the equip menu
   SWEP.EquipMenuData = {
      type = "AK47",
      desc = "Very powerful, high recoil assault rifle"
   };
end

-- Tell the server that it should download our icon to clients.
if SERVER then
   -- It's important to give your icon a unique name. GMod does NOT check for
   -- file differences, it only looks at the name. This means that if you have
   -- an icon_ak47, and another server also has one, then players might see the
   -- other server's dumb icon. Avoid this by using a unique name.
   resource.AddFile("materials/VGUI/ttt/icon_fissure_ak47.png")
end


Cheers

You could try merging the resource.addfile into the other if server then. It’s always worked like that for me and I’m not sure what problem is

Didn’t work :confused:

Have you tried making your png into a vmt/vtf? I could never get .png icons to work myself

I’ve just converted the png into a vmt/vtf and edited the appropriate bits in the shared.lua file; to no success.

Put the file locally in the right place and try it out on singleplayer

This’ll allow you to see if the issue is with the icon itself or downloading it

vmt needs to refer to right location. .png doesnt work. etc

Ok, still not working.

This is my .vmt file:


"UnlitGeneric"
{
	"$basetexture" "VGUI/ttt/icon_fissure_ak47"
	"$translucent" 1
	"$vertexalpha" 1
	"$vertexcolor" 1
}

Is this right? Do I have to put: “gamemode/terrortown/content/materials/VGUI/ttt/icon_fissure_ak47” instead?

Haz

I’m pretty sure it’s a problem with the FastDL…

Try testing it by putting the files on your client and see if they appear as missing textures on your server. If yes, then it’s a problem with your icon. If no, then it’s your FastDL.