PointShop: Add materials/models for an item.

I recently added an addon that comes with some new PointShop hats, specifically, this one: https://github.com/Kefta/tf2-pointshop-hats

But it doesn’t have any materials/models to add to the server. So, if someone doesn’t have TF2 installed, a bunch of hats are ERRORs on their head. My server already has CS:S and TF2 content installed, but it seems a lot of TF2 hats are missing from it (if there’s any to begin with).

How would I add the materials/models to my server so people download it when joining the server to avoid ERRORs?

Well, just like when you play on the a server that requires CSGO content. No matter how hard you try, you still just have to link the player the website to download the source content, there is no need for downloading the game.

Just search up cs cheater and youll find all content.
Download, any map, textures, from most source games aka TF2 & CSGO for Garrysmod.

Why not just send any joining clients a script that checks

IsMounted to see if they have TF2, and if not, spams a huge warning with a link to download TF2?

TF2’s free anyway, so you don’t really need to link to cs cheater

It’s also a pretty large game (around 17 GB, IIRC).

Anyway, I’d prefer there not be a ~17 GB barrier-to-entry. People may not have the bandwidth or whatever for one. If my network gets more popular, I could always branch out to more specific servers, so thanks for the info!

However, would there be anyway to extract a hats materials/models and do a workshop upload thing with it?

The hat in question is the Max’s Severed Head. That’s all I really want, has nostalgic value :stuck_out_tongue:

If not, all good, just wondering.

All the files for valve games are shoved into VPK files, as are the ones for TF2 (including the models and all that). You can open these files and extract stuff using GCFScape, a very useful tool in my opinion.

From memory, the TF2 files are in Steam/SteamApps/Common/Team Fortress 2/tf, so if you get GCFScape and extract the hat from whatever VPK it’s in from there then it should work. By the way, the thing about VPK files is that there’s usually a lot that have a number after them and then one that has something like ‘_dir’ after it instead. It’s the _dir one you’ll want to open since it usually contains all the numbered ones bunched together

The workshop bit might be a pain though, I think there’s a restriction against uploading content from other games, but since TF2 is free in the first place it probably isn’t that bad

I’m thinking I’ll set it to ‘friends only’ to avoid those kinds of issues.

One more thing, do you know how I’d add the model to the workshop so it works? Or a link on how?

For example, with the snowman hat from PointShop, the model line look like this:

How would I have to upload the model so I could point to the path of it?

Closest Google search was for player models, but those were already on the workshop so it doesn’t tell help me much :stuck_out_tongue:

[editline]10th September 2016[/editline]

Alright, I think I found a possible solution to my last question.

That addon seems to include a structure for .vmt files (hat models). I think I should be able to just replace them with the hats I want instead and edit the existing .lua files to match.

I’ll come back with my findings for future Googlers.

I’m not sure how much of a solution this is for you but I simply replaced the model if the user didn’t have TF2 mounted:

ITEM.Name = 'Anger'
ITEM.Price = 124000
ITEM.SubCategory = "TF2 Hats"
local HatModel = 'models/player/items/sniper/c_bet_brinkhood.mdl'
ITEM.Attachment = 'eyes'
if file.Exists( HatModel, "GAME") then
	ITEM.Model = HatModel
else ITEM.Model = 'models/props/de_tides/Vending_turtle.mdl' end

function ITEM:OnEquip(ply, modifications)

function ITEM:OnHolster(ply)

function ITEM:ModifyClientsideModel(ply, model, pos, ang)
	pos = pos + (ang:Forward() * -3.75) + (ang:Up() * -2)
    model:SetModelScale(1, 0)

	return model, pos, ang

That’s an awesome workaround, thanks so much!

Currently trying to replace the files of a different addon. But if I fail, I’ll definitely use this!

update 2: kept going to the wrong path (root/materials instead of root/models). But hey, the workaround was helpful in the meantime :v


After extensive looking, I finally found a workaround to “extracting” .mdl files from TF2!

For those interested, here’s how:

A new window will open. From this new window, click “File” then hover over “Recent Models” and you will see a path to the .mdl you just viewed.

TFMV seems to save a .mdl each time you load one into HLMV. So rinse and repeat for each one you want. It will simultaneously save two .vtx files (for dx80 and dx90), one .mdl file, one .phy file, one .sw.vtx file and one .vvd file.

You could just get the models from the vpks in /tf/ using GCFScape. It’d probably be faster in the long run.

A workaround? Doesn’t GCFScape work for you?

Yeah… was really confused why I was only finding .VTF/M files. Turns out I was going to the texture path instead of the model path from tf2_misc_dir.vpk

I kept going to:
instead of:

TFMV is super useful for finding the path for .VTF and .VTM files, though, when I can’t figure out what a hat’s file name is :v