Two (hopefully simple) questions regarding SWEP models and textures

At the moment, I’m trying to port FPSBanana CSS skins into TFA’s SWEP base. It’s been fairly easy so far, I’ve even managed to learn how to get the sound scripts to work.

Some of the models I’m using have 2k and 4k textures that are fairly large downloads on the server. What’s the best way to downscale a VTF file? Exporting it, downscaling it, then re-importing it created some weird reflective and lighting issues with it. Most likely from the bump map and (reflection map? Surface map? Not sure what it’s called) losing detail from the down-conversion. It could have also been the dithering settings on my image editor, I’m not sure.

What’s the best file format to export/import from VTF Edit? Is there a better way to directly downscale a VTF than exporting/importing it? Is there other data in the VTF that also needs to be identical when re-imported? As far as I’m aware, the VTF only contains the image, while the VMT has all the textures actual info, but I’m probably wrong.

The second question I have is about crotch guns. Guns aren’t going to the players hands, which I read was related to the weapons world models not having the correct bones assigned to them, thus the weapon not knowing where to go. I used to use FA:S2’s weapon base a lot, and it used a workaround by using a normal gun model, not drawing it, then parenting the custom weapons world model to the default model. Before doing this, I just wanted to know if there was an easier way to “cheat” having to decompile the world model and assigning bones with lua without needing to run the extra calculations that a parenting-based system would need.

Thanks for at least taking the time to read my stupid questions.

You must pay attention to things like compression algorithm used in the original texture when you export and reimport the textures.

Also things like texture flags, mipmaps, etc.

Best format afaik is .tga for this.

The compression algorithm was what fucked me up, I think.

What’s the difference between environment maps, animated textures, and volume textures? I’m not really sure how to tell which one mine is.

Exporting as TGA in VTFEdit leaves me with a blank, transparent image. I’m not sure if that’s just my version of VTFEdit being broken or what, but exporting as BMP into my image editor then exporting a TGA from that seemed to work, though.

You lose the alpha channel when you export to .bmp, that’s why .tga is better. You may think it’s just empty, but if you’d look at each channel separately, you will see that its not empty.

As Rubat said, tga works great. However, there’s an even easier way; you can get the VTF plugin for Paint.NET and directly open/save VTF files.

Yep, use SWEP.Offset, like this:

SWEP.Offset = {
	Pos = {
		Up = 0,
		Right = 0,
		Forward = 0
	Ang = {
		Up = -1,
		Right = -2,
		Forward = 178
	Scale = 1

Play with the angles until it’s right.

Sorry for the late reply.

The PDN plugin helped, sort of, but I’m still having weird issues when exporting when it comes to the transparency layers and stuff. I’ve given up on that and just decided to make due with the textures and leaving them as the original creator intended.

The second bit of that is really helpful, it helped me find some other little configuration stuff you have in your base. I had hard-coded a version of VMAng and VMPos before I even noticed you already had one in there, so fuck me for being cheeky and not asking you instead. I guess I just assumed they were stupid questions.

I’m having a lot of fun playing around with your base. I had been using a modified version of FA:S2 for like two years before I finally decided to drop it and pick up a new one. I’m working on a gamemode, and I’m not really sure where I’d be if I didn’t have access to your base. You’re a cool guy.