Garry’s Mod – How to add custom materials

Garry’s Mod – How to add custom materials 51 - steamlists.com
Garry’s Mod – How to add custom materials 51 - steamlists.com
This guide aims to show you how to add simple materials from your computer into Garry’s Mod so that you can use it

 

Things you will need

 

Tools

Here is a list of tools that you will be using over this tutorial:

 

Addons

You will need two addons from the workshop:
Extended Spawnmenu (by Rubat)
https://steamcommunity.com/sharedfiles/filedetails/?id=104603291
Sub Material Tool (by Kawoosh64)
https://steamcommunity.com/sharedfiles/filedetails/?id=405793043

STEP 1 : Getting your materials

Alright, now you have your tools and you are ready to start adding your materials. However, what if you don’t know what the material you are trying to edit looks like? For this there are two methods

USING GCFSCAPE (IN-GAME MATERIALS ONLY)

If the model you are trying to add a custom texture to is from Garry’s Mod or another Source game, you are going to need to use GCFScape to access the materials.
For the sake of example, we are going to use this Water Barrel’s texture from Team Fortress 2.
Garry's Mod - How to add custom materials

1. Open GCFScape

Garry's Mod - How to add custom materials

2. Click on the file on the taskbar

Garry's Mod - How to add custom materials

3. Once here, select the game folder you want to use.

For this example, we will go to the Team Fortress 2 Directory
Garry's Mod - How to add custom materials
In the event your version doesn’t open to your Games folder in steam, go to the following directory: C:\Program Files (x86)\Steam\steamapps\common

Evey game has a folder that is name after it, in our case, it’s called “tf”. It should be self explanatory. For Half-Life 2 and its episodes, they are all located in the same folder.
Garry's Mod - How to add custom materials

4. In the “tf” folder, you should find some files which are known as Valve Pack Files, or VPKs.

These files are where the game ressources is stored.
For textures in TF2 and Half Life series, they are split into two; a .VMT file in the “_misc” files, and a .VTF in the “_textures” files. The VMT file is not really required for our experiment, as we can always make a new one.
For CSGO, all the data is stored in one big VPK, so this isn’t something to worry about.
Also, if you want to examine the other VPKs, make sure to always pick the one ending in “_dir”.
Garry's Mod - How to add custom materials

5. Click the “tf2_textures_dir” file and open it.

Garry's Mod - How to add custom materials

6. Let’s say we are looking to edit the water barrel from earlier. Open up the search box by pressing “CTRL + F” and type “barrel”.

It’s important to note that some textures can be difficult to find from their names. Just keep looking!
Garry's Mod - How to add custom materials

7. You can open the current VTF files with VTFEdit to view to see if it is the one you want

Garry's Mod - How to add custom materials

8. Once you have chosen your material, you can extract it to a folder on your computer.

From experience, it is best to export it as a .PNG file
Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

GETTING MATERIALS FROM ADDONS

Say your custom material isn’t from a Source game but from an addon. In a new Garry’s Mod update this year, many addons are now locate in a new location(*). For this to work, I advise having two folders open.

1. Open up to your Garry’s Mod bin fodler

C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\bin
Garry's Mod - How to add custom materials

2. In another folder window, navigate to the following directory

C:\Program Files (x86)\Steam\steamapps\workshop\content\4000
Garry's Mod - How to add custom materials

3. There should be quite a lot of files here, making it pretty hard to know what is what.

Use the search bar and type in any keywords from your addon. In my case, we will be using one of my models called Meta Runner Tari, so search for “tari”
Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

4. Once you have located you .gma file, drag it over into the other window over gmad.exe

The windows terminal should open up and a folder with the same name as the .gma file should appear
Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

5. Navigate to the “materials” folder of the folder and find the material you are looking for.

For us, we are going to use “meta_screen1”
Make sure to open the .VTF file. For now, the .VMT files do not matter
Garry's Mod - How to add custom materials

6. Open the .VTF file with VTFEdit

Garry's Mod - How to add custom materials

7. Export the material to a folder on your computer as a .png file

Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

(*) ADDITIONAL NOTE

Some addons still remain in the “addons” folder located in the “garrysmod” folder. The procedure works the same as described above; select your addon, drag it over “gmad.exe” and a folder should appear

STEP 2 : Editing your material

This section is the fun part, as you get to do what you want with your material. Make sure when editing that you stay within the resolution of the image, otherwise it will not appear properly once we import it back into Gmod.
For this, you use whatever 2D image manipulation program you have, whether it be Photoshop or MS Paint, as long as it gets the job done. I personally use GIMP.

Here are my two custom materials:

The Water Barrel
Garry's Mod - How to add custom materials

The Screen
Garry's Mod - How to add custom materials

TIP : Consider keeping a backup of both your image and the original texture just in case you need to make edits later. You can see this with the water barrel, where “WATER” is turned upside down. In VTFEdit, it’s impossible to be sure which way is up. It can only be accomplished through trial and error

STEP 3 : Getting your material in game

Now you have an edited material and are ready to put it into the game. First off, I would advise that you create a folder called “custom” in your materials directory in the Garry’s Mod folder. This will be useful for quickly locating and managing your materials later.

1. Start off by moving your edited image to the custom folder in your Garry’s Mod directory

Garry's Mod - How to add custom materials

2. Once there, open up VTFEdit

Garry's Mod - How to add custom materials

3. Select import and locate your image

Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

You will encounter this screen when loading in. Do not worry about it, as long as the settings look like mine, just click OK.
Garry's Mod - How to add custom materials

4. Once imported, save your image as whatever you like, but remember the file name!

Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

5. Open up Notepad++ (or whatever text editor you have)

Garry's Mod - How to add custom materials

Creating a .VMT file

A .VMT file goes together with a .VTF file, for neither one can really work without the other. While the VTF file contains the material, the VMT contains the information that it transmits to the game.
For us, we don’t need to worry too much about the specifics of the a .VMT file. For beginners, simply paste this code into your text editor:

“VertexlitGeneric”
{
“$basetexture” “custom/[YOURFILENAME]”
“$nocull” “1”
}
Garry's Mod - How to add custom materials
Replace [YOURFILENAME] with the name of your file from earlier, do not add the .vtf at the end!.
Garry's Mod - How to add custom materials
However, if your model has a bit of transparency to it, such as my screen, add this line beneath “$nocull”:
“$translucent” “1”
Garry's Mod - How to add custom materials
If you want to know more about the different options when it comes to a .VMT file, consider visiting the Valve Developer Wiki

Back to the material

 

6. Once you have finished your code, save your file as a .vmt file.

This can be achieved by selecting the “File type” in the same window and setting to “All file types”. Then type the name of your material in and add a “.vmt” to the end of it. It is very important that you do not forget the .vmt at the end!
Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

STEP 4 : Using your material in game

Once you have made it here, you should have a .VMF file and a .VMT file, both with the same name, in your custom folder, located in the games materials directory.
For this part, we are going to make use of the addons mentioned earlier:
Extended Spawnmenu (by Rubat)
https://steamcommunity.com/sharedfiles/filedetails/?id=104603291
Sub Material Tool (by Kawoosh64)
https://steamcommunity.com/sharedfiles/filedetails/?id=405793043

1. Launch Garry’s Mod and start up a new map

Garry's Mod - How to add custom materials

2. Once loaded in, select your model you want to apply the custom material to

Garry's Mod - How to add custom materials

3. Expand the materials tab in your Spawn Menu

Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

4. Go to Games >>> Garry’s Mod >>> custom

Garry's Mod - How to add custom materials

5. Right click on your material and select “Copy to clipboard”

Garry's Mod - How to add custom materials

6. Go to the Sub Material Tool and hit “Ctrl + V” in the box

Garry's Mod - How to add custom materials

7. Spawn your model and select the part you want to change

Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

8. Apply Material

Garry's Mod - How to add custom materials

Garry's Mod - How to add custom materials

End of document

Garry's Mod - How to add custom materials - End of document
You’ve made it to the end of the guide, which means you either skipped through to the end and now don’t understand anything that’s going on, or you have successfully managed to add you materials into Garry’s Mod.

I hope this guide helps you in your futur projects. Feel free to comment if you don’t understand and I will get back to you as soon as possible.

Written by MrTheWizard

I hope you enjoy the Guide we share about Garry’s Mod – How to add custom materials; if you think we forget to add or we should add more information, please let us know via commenting below! See you soon!


Be the first to comment

Leave a Reply

Your email address will not be published.


*