Garry's Mod Wiki

Finding Where Content Is From

Intro

This article will explain how to fairly easily determine where a piece of content is coming from, i.e where precisely it is stored on your computer.

This can be useful to identify misbehaving addons and get rid of them.

whereis

This is the magic console command that can find where any game file is on your computer, including which addon exactly it comes from.

The developer console can be opened via ⇧ shift+escape or the tilde key `.

The usage format is as follows:

wheres local/path/to/file.extension

Here's an example:

whereis sound\garrysmod\ui_hover.wav

This will display where the default main menu button hover sound is located on your PC, for example:

C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\garrysmod.vpk\sound\garrysmod\ui_hover.wav

If an addon overwrites this sound, it will tell you what addon overwrites the file, like so:

'Modern Menu Sounds' - C:\Program Files (x86)\Steam\steamapps\workshop\content\4000\2086293752/menu_sounds.gma

The tricky part is to find the file path to give it. Below are some methods to find out the file paths for different content types.

Do not include quotation marks in the file path given to whereis.

Which slashes (/ or \) are used is not important, they can be mixed.

Models

Models usually start with models/ folder. There are many different places a model path can be acquired, but the easier is to simply find the model in your spawnmenu in Sandbox (q by default) and right click on the spawnicon and press Copy to clipboard:

image.png

This will copy the full path of the model to your clipboard, so the next step would just be to paste it to the whereis command:

whereis models/props_c17/lampShade001a.mdl

And voila, you now know where the model is located.

Other options

You can dump the entire list of loaded models using listmodels console command.

Materials and Textures

Textures and materials usually start with materials/ folder. For these two, there's an easy way: mat_texture_list 1. Entering this command will open a panel listing all currently visible textures.

Clicking on any of the textures will bring up a new panel with details about the texture, and the list of materials that use the texture.

The important part is the "Where Is" button in the top right corner of a texture sub-panel:

image.png

Simply click this button and then open your console, it should already contain the output of whereis for the texture itself, as well as every material that uses it, like so:

C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\sourceengine\hl2_textures.vpk\materials\building_template\building_template007b.vtf C:\Program Files (x86)\Steam\steamapps\common\garrysmod\garrysmod\maps\gm_construct.bsp\materials\maps\gm_construct\building_template\building_template007b_-2304_-2702_1408.vmt C:\Program Files (x86)\Steam\steamapps\common\garrysmod\garrysmod\maps\gm_construct.bsp\materials\maps\gm_construct\building_template\building_template007b_1280_-1600_-64.vmt C:\Program Files (x86)\Steam\steamapps\common\garrysmod\garrysmod\maps\gm_construct.bsp\materials\maps\gm_construct\building_template\building_template007b_832_-448_-96.vmt

mat_crosshair

Alternative way to get the material you are looking at is to use the mat_crosshair console command. This will not work for models, but will work for map materials.

You will need to prepend materials/ and appent .vmt to the path from the concommand's output:

] mat_crosshair hit material "glass/glasswindow005a_darkerbroken" ] whereis materials/glass/glasswindow005a_darkerbroken.vmt C:\Program Files (x86)\Steam\steamapps\common\team fortress 2\tf\maps\zi_blazehattan.bsp\materials\glass\glasswindow005a_darkerbroken.vmt

Other options

You can dump the entire list of currently loaded textures via mat_dumptextures console command, and the list of currently loaded materials via mat_dumpmaterials. The lists will be huge and may not be entirely useful, but they are there.

Sounds

For sounds there are 2 options. Sound paths usually start with sound/. Notice that it's "sound", not "sounds".

snd_showstart

Enter developer 1; sv_cheats 1 into the console for snd_showstart to display anything.

After that enter snd_showstart 1, and it will display every sound once, when it is starting to play, like so:

(CGMOD_Player:common/wpn_moveselect.wav) DynamicSound common\wpn_moveselect.wav : src 1 : channel 3 : 0 dB : vol 0.32 : time 380.488 (CGMOD_Player:common/wpn_select.wav) DynamicSound common\wpn_select.wav : src 1 : channel 3 : 0 dB : vol 0.32 : time 380.635 (CGMOD_Player:common/wpn_hudoff.wav) DynamicSound common\wpn_hudoff.wav : src 1 : channel 3 : 0 dB : vol 0.32 : time 380.635 (CGMOD_Player:)weapons/smg1/smg1_fire1.wav) DynamicSound )weapons\smg1\smg1_fire1.wav : src 1 : channel 1 : 140 dB : vol 0.54 : time 380.850 (CWorld:physics/surfaces/sand_impact_bullet3.wav) DynamicSound physics\surfaces\sand_impact_bullet3.wav : src 0 : channel 0 : 75 dB : vol 0.70 : time 380.850 (CGMOD_Player:)weapons/smg1/smg1_fire1.wav) DynamicSound )weapons\smg1\smg1_fire1.wav : src 1 : channel 1 : 140 dB : vol 0.54 : time 380.923 (CWorld:physics/surfaces/sand_impact_bullet2.wav) DynamicSound physics\surfaces\sand_impact_bullet2.wav : src 0 : channel 0 : 75 dB : vol 0.70 : time 380.923 (CGMOD_Player:)weapons/smg1/smg1_fire1.wav) DynamicSound )weapons\smg1\smg1_fire1.wav : src 1 : channel 1 : 140 dB : vol 0.54 : time 380.997 (CWorld:physics/surfaces/sand_impact_bullet1.wav) DynamicSound physics\surfaces\sand_impact_bullet1.wav : src 0 : channel 0 : 75 dB : vol 0.70 : time 380.997

Once you see a sound path that looks relevant to your issue, copy it and add sound/ to the beginning, and paste the path into the whereis command, for example for the sound )weapons\smg1\smg1_fire1.wav, you'd enter the following:

whereis sound/weapons\smg1\smg1_fire1.wav

Notice that we do not include the first symbol ) - that is one of several special symbols that change how the sound is played, and are not relevant to this article, so we simply skip them.

snd_show

The other option is snd_show 1. This will display all currently played sounds in the top right corner of the screen, when playing on a map, like so:

image.png

This method also requires sv_cheats, and the downside to this method is that you cannot easily copy the sound file path.

Otherwise the following steps are similar to the previous method, you'd just have to retype the path manually.