Author Topic: Pointshop - Adding Trails  (Read 19268 times)

0 Members and 1 Guest are viewing this topic.

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Pointshop - Adding Trails
« on: April 19, 2014, 05:27:16 PM »
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: [Select]
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
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.



Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Pointshop - Adding Trails
« Reply #1 on: April 19, 2014, 08:53:09 PM »

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Pointshop - Adding Trails
« Reply #2 on: April 19, 2014, 09:12:34 PM »
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
« Last Edit: April 20, 2014, 08:39:44 PM by Zmaster »

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Pointshop - Adding Trails
« Reply #3 on: May 17, 2014, 06:34:13 PM »
It's been 21 days. :P Does anybody know how to fix this?

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Pointshop - Adding Trails
« Reply #4 on: May 17, 2014, 08:13:47 PM »
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.

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Pointshop - Adding Trails
« Reply #5 on: May 18, 2014, 09:16:53 PM »
Did you put the textures in the correct place?

MyAddonName/materials/UniqueFolderName/

If you don't want the unique folder then go ahead and put it in /materials.
Do note that if you do that, you may have conflicting textures if you get textures of the same name from another server since the texture names are generic.
Out of the Garry's Mod business.

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Pointshop - Adding Trails
« Reply #6 on: May 25, 2014, 06:29:59 PM »
Sorry for the wait. I've been busy for the past few days. :)

"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."
The clients definitely download the file.
And I'm sure the code is pointing to the right location.

"MyAddonName/materials/UniqueFolderName/"
Yea, that's where the files are

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Pointshop - Adding Trails
« Reply #7 on: May 25, 2014, 10:38:46 PM »
And I'm sure the code is pointing to the right location.

"MyAddonName/materials/UniqueFolderName/"
Yea, that's where the files are

If you're code is pointing to that path, then that is likely your problem.
See my response to someone regarding downloading files.
http://forums.ulyssesmod.net/index.php/topic,7260.msg36572.html#msg36572
Though the question was different, the answer is the same.
Don't include the addon folder name in the path of your code.
Use the 'real' virtual path,
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Pointshop - Adding Trails
« Reply #8 on: May 26, 2014, 12:27:54 AM »
If you place things into an addon folder, you must use its contents like they were installed directly into the root, instead of the addons folder and from there.
Out of the Garry's Mod business.

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Pointshop - Adding Trails
« Reply #9 on: May 26, 2014, 10:01:00 AM »
Alright, since having my own addon for the textures is more complicated, I decided to just move the files to the materials folder and name it something that's probably not going to be used by anyone else. (ZmaSaw.vmt and ZmaSaw.vtf)

I changed the paths in the files to the new path of the files. (materials/ZmaSaw)

JamminR, the paths are the right way, now, according to what you said in that thread.
Neku, you basically said the same thing as JamminR, but more condensed. Same thing with you. It's the right location now.

Still shows the missing texture when I equip the trail igname.

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Pointshop - Adding Trails
« Reply #10 on: May 26, 2014, 02:51:04 PM »
Well, are you using the correct vmt setup?
Out of the Garry's Mod business.

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Pointshop - Adding Trails
« Reply #11 on: May 26, 2014, 04:31:47 PM »
Well, are you using the correct vmt setup?

Code: [Select]
"UnlitGeneric"
{
        "$basetexture" "materials/ZmaSaw"
        "$vertexalpha" 1
        "$vertexcolor" 1
}

Is that right?

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Pointshop - Adding Trails
« Reply #12 on: May 26, 2014, 11:56:20 PM »
Is Zmasaw a folder or the texture?
Out of the Garry's Mod business.

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Pointshop - Adding Trails
« Reply #13 on: May 27, 2014, 03:18:21 PM »
ZmaSaw is the the name of the two texture files
(.vmt and .vtf)

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Pointshop - Adding Trails
« Reply #14 on: May 27, 2014, 11:26:05 PM »
Hm, I'm quite stumped on this one.
Out of the Garry's Mod business.