Source SDK

Source SDK

Tidak cukup rating
Importing custom assets in Source games
Oleh Pinsplash
This guide will show you how to put your own maps, textures, models, or whatever else into any Source engine game, including "skins". This guide does NOT cover installing full mods, such as Minerva: Metastasis, or the actual creation of any content. If you have any questions, ask in the comments and I'll do my best to answer.
   
Penghargaan
Favorit
Difavoritkan
Batalkan favorit
Easy explanation (part 1)
If you're unfamiliar with modding video games or just not tech-savvy at all, this section is for you. For this section, I'm assuming that you downloaded your custom thing from a friend or off the internet. If the place you got the file from gave instructions on how to install it, you should follow those instead.

NOTE: Custom content that overrides stock content, like a custom skin of an existing gun, won't be allowed on some servers, because it can open up the possibility of cheating. This usually means ♥♥♥♥♥♥♥♥ Valve servers are a no-go. Some servers may allow some things, but not other things. Servers that don't allow custom stuff will kick you with a message mentioning VPK files or "pure" settings. In some games, the custom stuff simply won't be there if it's not allowed. Custom maps will never cause you to get kicked, unless the server is running a map with the same name, and your file is different from the server's file.

File Explorer
To put custom stuff in your game, you'll have to use a program that came with your computer when you got it. You've probably used it before: it's called File Explorer, or Finder for Mac users. You open this every time you upload something like a picture to the internet. We're going to use this to navigate to where your game's files are stored in your computer.

1. Go to your Steam library.
2. Right-click (or for Mac users, hold the "control" key down while clicking) on the game in the side bar or on its picture.
3. Click "Properties" at the bottom. A menu will pop up.
4. Click "LOCAL FILES" at the top.
5. Click "BROWSE LOCAL FILES...". This should take you to your game's files.

Root folder
1. Navigate to the folder which is an abbreviation of the game's name. I.E. for Team Fortress 2 go to the folder tf. For Left 4 Dead 1 and 2, Alien Swarm and Reactive Drop, and Portal 2, this is your "root" folder. If you're using one of those games or your download was only a map with any related files like nav and ain, skip to step 4.
2. Create a new folder called custom. To make a new folder in File Explorer, click the arrow in the top right to make it point up, click on "Home", then click "New folder". In Finder, click "File" at the top, then "New Folder".
3. Inside the custom folder, make another folder. This one can be called whatever you like. It's best to name it something related to the custom thing you downloaded. This will be your "root" folder.
4. Now that you're at the root folder, you need to navigate to a folder with a name that depends on the type of file you downloaded. If a folder of that name doesn't exist inside the root folder, create it. If you haven't already, navigate to your downloaded file in another window of File Explorer or Finder. In Microsoft Edge you can do this quickly by clicking the "Open folder" button that appears when you download something. In Safari you can do the same by clicking the magnifying glass icon in the list of downloads.
5. If you haven't already, turn on file extensions for File Explorer[www.howtogeek.com] or Finder[support.apple.com]. Once you've done this, you'll find that the downloaded file now has a period and a few letters at the end of its name. These letters tell you and the computer what kind of file, a file is.

Folder Structure
Now we have to figure out exactly what kind of file(s) you downloaded. Different kinds of files have to be put in different places to work correctly. Look in the list below for the file type of your download.
  • If the file extension is ".zip", rar, or 7z, the file is one that probably contains multiple files or folders inside it. Your computer might allow you to open this file by double-clicking on it, but if it doesn't I recommend you open it with Keka[www.keka.io] for Mac or 7zip[www.7-zip.org] for Windows. For the sake of length I won't go into how to use those programs, but you should extract the files to any place you want on your system. We will move it to the correct spot later on. Inside, there might also be a txt file with installation instructions which you should probably follow instead of this guide. After that, repeat this step.
  • If there's both vmt and vtf files, put them in the materials folder. If you received just a vmt or vtf without one or the other, and it's not working later on in the tutorial, tell your friend to include the other file too in their upload.
  • If it's a wav or mp3 file, put it in the sounds folder.
  • If it's an mdl file, put it in the models folder. In this case, there will likely be vmt and vtf files included as well. mdl files should also come with vtx and vvd files. Some will also come with phy files. Keep all of them in the same folder when moving them.
  • If it's a vpk file and your game is Left 4 Dead, Left 4 Dead 2, Alien Swarm, or Alien Swarm: Reactive Drop, it's an add-on file. See the Add-ons section below.
  • If it's a bsp file, put it in the maps folder. If you see a nav, dds, jpg, or txt file of the same name, make sure to move them along with the bsp file, as they're quite important. Ignore all of these files as they are not necessary: log, prt, vmf, and vmx.
  • If it's an ain file, put it in the graphs folder inside the maps folder.
  • If you've received only a vmf file when you expected a playable map, send your friend a link to this page.
  • If it's a txt file with "sound" in the name, put it in the scripts folder.
  • If it's a cfg file, put it in the cfg folder.
  • If it's a pcf file, put it in the particles folder. If there's a txt file with "manifest" in the name, be sure to move that file to the particles folder as well.
  • If you received both a bsp file and a vmt, vtf, wav, mp3, mdl, or pcf, send your friend a link to this page to let them know they should pack their custom content into their map, to save you the time of installing the content manually and having to read through some tutorial like this one :)
  • If you've reached this far and haven't found out what kind of file yours is, you should ask the creator how to install it, because it's not something common. I can try to help in the comments section.
  • If you have many files of different types, you need to put each type in their own folder as detailed above.
Easy explanation (part 2)
Folder Structure
You're almost done at this point! Usually, custom files will require you to make one more folder inside the one you've made for materials, models, etc. You might have to make more than one more, or none. The creator of the files should have given instructions about these extra folders somewhere. For example, if they said to put a file in root/models/player/chell, you should create a folder called player inside the models folder, and another folder called chell inside player, then put the file in chell. If the file(s) came in a zip/rar/7z file, they might have hinted at what to call the folders based on the names of the folders they put in the zip/rar/7z file. Once you've figured out precisely where the files should go...

1. Bring up both windows of File Explorer/Finder. One should be in the folder where the downloaded files currently are, and the other should be where you want to put them.
2. Click on the files and hold down on your mouse.
3. Move your mouse over to the other window and let go of the mouse.

Add-ons
To install an addon, all you should have to do is double-click it to install. If that doesn't work, follow the steps directly above, but make your destination folder addons, inside the root folder.

Did it work?
If you did everything right (and if I wrote everything right) your custom content should now be usable. Start an offline game and somehow confirm that it installed. If it's a custom gun, pull out that gun, etc.

Removing custom stuff
If you want to remove custom skins, find where they are in your game files, select them, and press the delete button. Using the custom folder will help you do this quickly.
More-technical version
This section is for those folks who have already dipped their feet in Source and shouldn't need some things explained to them.

NOTE: Custom content that overrides stock content, like a custom skin of an existing gun, won't be allowed on some servers, because it can open up the possibility of cheating. This usually means ♥♥♥♥♥♥♥♥ Valve servers are a no-go. Some servers may allow some things, but not other things. Servers that don't allow custom stuff will kick you with a message mentioning VPK files or "pure" settings. In some games, the custom stuff simply won't be there if it's not allowed. Custom maps will never cause you to get kicked, unless the server is running a map with the same name, and your file is different from the server's file.

If you're making a map which is not for a mod you're developing, you may be interested in this tutorial from tophattwaffle[www.tophattwaffle.com]. This tutorial will show you how to set up hammer so that you can keep custom assets 100% clear of stock assets by basically making a mod (but not really). This will allow you to avoid being kicked from servers due to the issues mentioned above.

Taking things out of Source games
If you want to take content from another Source game, download GCFScape[nemstools.github.io] and use it to open the VPK files in the game's files. VPK files are where most of the assets in Source games are stored. GCFScape lets you open VPK files and browse them much like another program would browse a ZIP file. Only open the vpk files with "dir" in the name, not the numbered ones. You can take files out of the VPK by dragging them.

If you've decompiled a map and found that there's missing things, then those things were packed into the map. (Packing is explained more below.) If you're decompiling with BSPSource[github.com] (which is far better than any other decompiler), you should check the "Extract embedded content" option before you click decompile. You'll then have to put the packed content somewhere on your computer, which is what the rest of this tutorial is about! You will also have to pack the content again if you release the map. Don't steal other people's work!

Sometimes assets will have issues in one Source game if they were built for another. For instance, the textures of infected in L4D1/2 will look wrong in other games because they don't have the shader called "Infected".

Models will likely not work correctly without doing some prior work. Download Crowbar, click on the "Decompile" tab. For "MDL input", browse to the .mdl file you want to use. If you open the dropdown menu you can also tell it to decompile every model in a folder (and subfolders) as well. Make sure you've extracted the MDL's related files and put them in the same folder as the MDL. They should have identical names but with a different extension such as VVD. For "Output to", you can specify any folder you want. This folder is where the un-compiled model files will be stored. All of the checkboxes should be fine as their defaults. Now hit the "Decompile" button below the checkboxes.

Now go to the "Compile" tab. For "QC input", browse to the QC file that Crowbar made after decompiling. It should have the same name as the MDL. Make sure that files related to the QC, such as SMD's, are in the same folder as the QC, or if Crowbar put them in new folders, make sure the folders are in the same folder as the QC. For "Game that has the model compiler", select the game you want to import the model to. You can change "Output to" if you want. The top option in its dropdown menu will automatically decide the output folder based on "Game that has the model compiler". Now hit "Compile". Hopefully everything worked. Just like with maps, decompiling and compiling models could have many possible issues arise and I can't cover them all here.

Root folder
Maybe once or twice on VDC you've heard somebody use the words "root folder" or "mod folder". This is the folder where the game's actual content is stored, so for Half-Life 2 it's hl2, for Team Fortress 2 it's tf and so on.

If your game is TF2, DODS, CSS, Portal 1, or any of the Half-Life 2 games, navigate to the custom folder inside the mod folder. If it doesn't exist, make it. Now inside custom make a new folder. You can call it whatever you want, preferably something related to the custom assets like "myplayermodel". This new folder will serve as your root folder. When you want to add/create new custom stuff, you can create another folder inside custom to keep it separate from your other custom things.

For Portal 2, you want to find a folder called portal2_dlc3 inside Portal 2. If it doesn't exist, make it. If it does exist, you can make a dlc4 to keep your custom things separated. Inside your dlc3 folder, make another one called pak01_dir. This is your root folder.

Folder Structure
Inside the root folder, make another folder named for the type of asset(s) you're adding, so for VMTs and VTFs, materials. For models, models, and so on. In the "Folder Structure" section above there is a full list of where to put things if you need it.

Now from here, the folders you need to make depend the content. If you're making your own assets, you can name the next folder(s) down however you want. If you're adding something made by somebody else, you'll have to make the folder structure match whatever it's set up to use, which might be determined by something in the game's code (a custom sentences.txt for example) or by a line in the file (like $basetexture in a VMT). If the asset(s) came in an archive file with a built in folder structure, you can likely just drag everything in the archive's root folder over to your own root folder. Smart people will give you some kind of instruction for this step.

So now you should have the custom content ready to go. If you have a custom texture named newwall.vtf, the file path should look something like this:
Half-Life 2/hl2/custom/mynewtexture/materials/concrete/newwall.vtf

For Portal 2 you have to do one last step. Open up Portal 2/bin/ (not Portal 2/portal2/bin/) in another window, and drag your root folder (pak01_dir) onto vpk.exe. This will create a vpk file in portal2_dlc3. The next time you open the game it will probably have a different loading screen which won't ever go away. Keep waiting. The lights in the bottom right should turn orange when it's finished. At this point you can close Portal 2 with task manager and open it as normal again.

Packing
If you're making a map, or set of maps (NOT a mod), you need to embed your custom stuff into your map file(s), otherwise when other people play, they won't see or hear your custom things! Be warned, while most common things likes sounds, models, textures, and particles can be packed into a map, some less usual types of content might not be packable.

I recommend this tutorial: https://www.youtube.com/watch?v=8_OWul0E4dY&t=95s
1 Komentar
Paws Up 19 Feb @ 5:46pm 
I just had a match against this child, and literally 3 seconds into the match the living garbage tries to kick me for using voicelines. Team votes no.

I put this pathetic kids actions and jealousy aside, and this kid later on into the match trolls and downs me. It gets promptly kicked by me, and then the kid blocked my main steam account. Literally LMFAO at this degenerate.

So this little beta male baby was upset and jealous it couldn't do what I could, with the voicelines, so it tries to kick me out of pure jealousy.

When that fails, even after I put its pathetic, childish actions behind me and play, it teamkills later on.


And you're a little degenerate that runs a YT channel and tries to act like you're professional?

Meanwhile you troll on source games, ruining them for others, for no good reason.

Literally hilarious. I have the video clip of the match (it trolling) and a video of its profile showing it blocked my main over IT trolling me and then being kicked.