General > Developers Corner
Pointshop - Adding Trails
Zmaster:
I've been trying to add the image at the bottom of this post as a trail on my pointshop, however, I've been having some trouble.
I have the code for the item itself in the pointshop folder. It's path: C:\GMOD\garrysmod\addons\pointshop-master\lua\items\trails\trail01.lua
The code in that file:
--- Code: ---ITEM.Name = 'Saw'
ITEM.Price = 500
ITEM.Material = 'trails/Trail01.vmt'
function ITEM:OnEquip(ply, modifications)
ply.Trail01 = util.SpriteTrail(ply, 0, modifications.color, false, 15, 1, 4, 0.125, self.Material)
end
function ITEM:OnHolster(ply)
SafeRemoveEntity(ply.Saw)
end
function ITEM:Modify(modifications)
PS:ShowColorChooser(self, modifications)
end
function ITEM:OnModify(ply, modifications)
SafeRemoveEntity(ply.Saw)
self:OnEquip(ply, modifications)
end
--- End code ---
The only reason I was able to get that code was because of copying and pasting from other sites. :P
When I'm ingame, the "Saw" trail option does appear, but it shows the error texture.
I put the "Trail01.vmt" and "Trail01.vtf" files in it's own addon folder, since I wasn't sure where to put it. I named the addons folder "ZsAddons" and all that's in it is the "info.txt" file and the materials folder. Inside the materials folder is a folder named trails, and inside of the trails folder is the VMF and VTF files.
I was hoping someone here could help me get the textures to download for clients when they join the server so that they would have the texture and be able to see it.
MrPresident:
resource.AddFile
http://wiki.garrysmod.com/page/resource/AddFile
Zmaster:
Edit:
Today I started up my server and was running around. Now when I walk a trail does show up, but it shows the purple and black checkerboard texture (Missing Texture) instead of the image.
Go to this link to see what I'm talking about ---> http://puu.sh/8grOR.jpg
Zmaster:
It's been 21 days. :P Does anybody know how to fix this?
MrPresident:
It could be a number of things.
You can't really expect anyone to know how to fix your issue when you just come on here and say:
"I have a missing texture, can you fix it?"
You might start by making sure that the texture is being sent to the clients and that your code points to the right location for the texture.
Navigation
[0] Message Index
[#] Next page
Go to full version