Welcome, Guest. Please login or register.
Did you miss your activation email?
November 21, 2024, 11:36:56 PM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Help with custom weapon icons?
Pages: [1]
Author Topic: Help with custom weapon icons?  (Read 5932 times)
SpaceCat
Poster

Posts: 10


« on: August 20, 2011, 01:54:39 PM »

Basicly, I didnt make the custom weapons on my server. I looked through them and everything seemed in good order; all icons there right paths and so fourth but, when joining my server you have to constantly download the vmt and vtf files as if my fast dl isnt working when it is.

Since I had almost all my icons already, I decided to delete everything and try downloading everything from the server on connect.

So basicly non of our custom weapon icons work and I have no idea why.
« Last Edit: August 20, 2011, 03:38:29 PM by SpaceCat »
Predator
Poster

Posts: 66


« Reply #1 on: August 20, 2011, 04:09:05 PM »

Also you need to add the icons to your fast dl , But i think you already did it So..

You need to make it sure to works fine...

in the shared file

if SERVER then
  resource.AddFile("materials/VGUI/ttt/icon_ak47.vmt")
end



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

  -- Text shown in the equip menu
  SWEP.EquipMenuData = {
      type = "Weapon",
      desc = "멋진 공산당 사람들의 총입니다."
  };
end


A Whole script http://pastebin.com/6sEmYJqn

Your shared lua file had to have it And replace the materials file with correct direction

Such as




\orangebox\garrysmod\materials\vgui\ttt

Lastly, Check Vmt file out.



Mostly, That's always the way.
« Last Edit: August 20, 2011, 04:13:59 PM by Predator »
SpaceCat
Poster

Posts: 10


« Reply #2 on: August 20, 2011, 06:02:45 PM »

Everything is as you put it, still every time I join my server I have to download all the materials and when im in non of them work.

If the map changes or I rejoin I have to download it again, and it doesnt work :|
Predator
Poster

Posts: 66


« Reply #3 on: August 20, 2011, 06:23:12 PM »

I think i know the solution.

http://www.gamefront.com/files/20697842/download.lua

Put this thing to \orangebox\garrysmod\lua\autorun\server

Then should be work.
SpaceCat
Poster

Posts: 10


« Reply #4 on: August 20, 2011, 06:58:13 PM »

Thanks a WHOLE bunch! That fixed the problem, and all my icons are working a charm!
Predator
Poster

Posts: 66


« Reply #5 on: August 21, 2011, 03:42:32 AM »

:D glad to hear that

anyway you can add the direction if you want to add something to download stuff,,


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.."/*")) do
resource.AddFile(dir.."/"..v)
end
end


AddDir("materials/VGUI/ttt")




add line the AddDir("your folder")

So it would be



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.."/*")) do
resource.AddFile(dir.."/"..v)
end
end


AddDir("materials/VGUI/ttt")
AddDir("materials/troll")
AddDir("models/hats")
AddDir("sound/ttt")



SpaceCat
Poster

Posts: 10


« Reply #6 on: August 21, 2011, 03:31:14 PM »

Erh it seemed to stop working, I deleted my garrysmod folder to test it, it downloads everything normally except vgui and gui.
Predator
Poster

Posts: 66


« Reply #7 on: August 21, 2011, 03:47:18 PM »

Well,, Then you need to add this sutff directly.

Open the lua file resources.lua (orangebox\garrysmod\gamemodes\terrortown\gamemode)

And Add the line resource.AddFile("materials/VGUI/ttt/icon_awp.vmt") <-- this is a example(So you need to change your direction..)




If it is not works. I don't know what i have to do.. because my english is really not good so dont know how to explain the solution,,
SpaceCat
Poster

Posts: 10


« Reply #8 on: August 21, 2011, 09:27:51 PM »

I will try this tonight when my server is less populated and post the results.
SovietX
Poster

Posts: 52



« Reply #9 on: August 21, 2011, 11:09:33 PM »

You don't need to do Resource.addfile for .vmt's they auto forcedownload. however the vmt's need to be in the correct folder usually (Materials/vgui/ttt) if you don't have vgui or ttt you should create them. Also if you have a fastdl you need to put them in there. as (Materials/vgui/ttt) good luck

Be the best by any means necessary
SpaceCat
Poster

Posts: 10


« Reply #10 on: August 24, 2011, 05:48:55 PM »

Figured it out in the end.... AddDir("materials/VGUI/ttt") was not working because the VGUI was in caps. So AddDir("materials/vgui/ttt") was the awnser for me.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Help with custom weapon icons? « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.009 seconds with 17 queries.