[ I had to split this into 2 posts as apparently my tutorial includes too many images. Yay. I wouldn't even care but I'm hosting the images so I figure I should be able to post as many as I bloody well want to :-). -knoid ]
Scope
This tutorial is aimed at Windows users. If you have a Linux server you can still create resource files using the method given in this tutorial but you will need to use a Linux-compatible text editor such as NoteTab Light to edit the .res file - text files from Notepad give Linux fits
.
Linux users can use the base method outlined here but the console commands will be different - I believe something like "find > mapname.txt" should do the trick once you've cd'd to the relevant directory.
Introduction
Running custom maps can be a pain on a Source server as the majority of customs come with millions of small resource files but without a resource file to enable proper downloading from the server/webserver.
Here, then, is a short tutorial to show you how to put together a resource file in the shortest possible amount of time. It should take you much longer to read this tutorial than to actually make the files
.
The basic format of a resource file is:
It's fairly simple, but rather tedious to put together by hand unless you know a few short workarounds.
Creating a list of the custom files
First off, unzip the map and all it's associated files into a clean directory that's outside of your server directory - e.g c:\downloads\mapname.
Now, open a DOS box (Start -> Accessories -> Command Prompt) and type in the following commands:
Replace "\path\to\map" with the path that you unzipped the map to. If you have trouble figuring out the path, open windows explorer and browse to the directory - you can then grab the full path from the 'address' box.
![[Image: res2.jpg]](http://www.knoid.com/restut/res2.jpg)
The first command gets you to the location of the map files on your HD. The second command creates a text file called mapname.txt (or any other name you specify) with the name and location of every file and directory contained inside \path\to\map.
![[Image: res3.jpg]](http://www.knoid.com/restut/res3.jpg)
After you run those two commands, you should see a text file (mapname.txt) in your \path\to\map. Double-click on it to open the file in Notepad - if everything went to plan, you should see something like this:
![[Image: res4.jpg]](http://www.knoid.com/restut/res4.jpg)
Removing unnecessary info
The next thing we need to do is remove all spurious information from the file. This is done in two steps:
1. remove the unnecessary path info from each line, and
2. remove the unnecessary entries at the top of the file.
Both steps are done using the Find/Replace tool:
![[Image: res5.jpg]](http://www.knoid.com/restut/res5.jpg)
For step one, you need to enter the \path\to\map that we found above in the "Find" box, and leave the "Replace" box blank:
![[Image: res6.jpg]](http://www.knoid.com/restut/res6.jpg)
Now hit "Replace All", and every instance of \path\to\map will be replaced with nothing. Resource files use path names relative to the mod directory (e.g. 'cstrike' or 'hl2mp') - if we didn't remove the \path\to\map then the resource file would be completely useless.
For step two, highlight every line that doesn't have a proper filename. We can also remove lines for things like README.txt and the map.bsp file - we're only interested in stuff inside the materials\, models\ and sound\ directories.
![[Image: res7.jpg]](http://www.knoid.com/restut/res7.jpg)
Hit the 'Del' key to remove the highlighted lines.
Scope
This tutorial is aimed at Windows users. If you have a Linux server you can still create resource files using the method given in this tutorial but you will need to use a Linux-compatible text editor such as NoteTab Light to edit the .res file - text files from Notepad give Linux fits

Linux users can use the base method outlined here but the console commands will be different - I believe something like "find > mapname.txt" should do the trick once you've cd'd to the relevant directory.
Introduction
Running custom maps can be a pain on a Source server as the majority of customs come with millions of small resource files but without a resource file to enable proper downloading from the server/webserver.
Here, then, is a short tutorial to show you how to put together a resource file in the shortest possible amount of time. It should take you much longer to read this tutorial than to actually make the files

The basic format of a resource file is:
Code:
"resources"
{
"path\to\resource.ext" "file"
.
.
.
"path\to\resource.ext" "file"
}
It's fairly simple, but rather tedious to put together by hand unless you know a few short workarounds.
Creating a list of the custom files
First off, unzip the map and all it's associated files into a clean directory that's outside of your server directory - e.g c:\downloads\mapname.
Now, open a DOS box (Start -> Accessories -> Command Prompt) and type in the following commands:
Code:
cd \path\to\map
dir /s /b >mapname.txt
Replace "\path\to\map" with the path that you unzipped the map to. If you have trouble figuring out the path, open windows explorer and browse to the directory - you can then grab the full path from the 'address' box.
![[Image: res2.jpg]](http://www.knoid.com/restut/res2.jpg)
The first command gets you to the location of the map files on your HD. The second command creates a text file called mapname.txt (or any other name you specify) with the name and location of every file and directory contained inside \path\to\map.
![[Image: res3.jpg]](http://www.knoid.com/restut/res3.jpg)
After you run those two commands, you should see a text file (mapname.txt) in your \path\to\map. Double-click on it to open the file in Notepad - if everything went to plan, you should see something like this:
![[Image: res4.jpg]](http://www.knoid.com/restut/res4.jpg)
Removing unnecessary info
The next thing we need to do is remove all spurious information from the file. This is done in two steps:
1. remove the unnecessary path info from each line, and
2. remove the unnecessary entries at the top of the file.
Both steps are done using the Find/Replace tool:
![[Image: res5.jpg]](http://www.knoid.com/restut/res5.jpg)
For step one, you need to enter the \path\to\map that we found above in the "Find" box, and leave the "Replace" box blank:
![[Image: res6.jpg]](http://www.knoid.com/restut/res6.jpg)
Now hit "Replace All", and every instance of \path\to\map will be replaced with nothing. Resource files use path names relative to the mod directory (e.g. 'cstrike' or 'hl2mp') - if we didn't remove the \path\to\map then the resource file would be completely useless.
For step two, highlight every line that doesn't have a proper filename. We can also remove lines for things like README.txt and the map.bsp file - we're only interested in stuff inside the materials\, models\ and sound\ directories.
![[Image: res7.jpg]](http://www.knoid.com/restut/res7.jpg)
Hit the 'Del' key to remove the highlighted lines.
knoid || Admin, joe.to gaming community
tf2.joe.to - challenge maps
tf4.joe.to - custom maps
tf2.joe.to - challenge maps
tf4.joe.to - custom maps