resource files - how to make them quickly knoid Junior Member Posts: 36 Threads: 3 Joined: Dec 2004 Reputation: 0 12-25-2004, 08:13 AM (This post was last modified: 12-25-2004, 08:25 AM by knoid.) [ 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: 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. 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. 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: 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: 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: 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. 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 knoid Junior Member Posts: 36 Threads: 3 Joined: Dec 2004 Reputation: 0 12-25-2004, 08:16 AM [ part two -knoid ] Turning a directory list into a proper .res file Now we have a list of every custom texture, sound and model that came with the map. While this is all very nice, it's not particularly useful to us in it's current form. For your SRCDS server to interpret it properly, we have to add a few things. Firstly, add the following at the very top of the file: Code: "resources" { At the bottom, add a single closing curly bracket: Finally, we need to add quotes to the beginning and end of each line. We also need to add a "file" to each line. The quickest and simplest way to do this is to use our handy-dandy Find/Replace tool again . In the Find box, type: materials In Replace, type: "materials Now hit "Replace All", and you should end up with a quote at the beginning of each line. If there are any custom files in models\ or sounds\ then you will need to do a Find/Replace for those in the same manner as for materials\. To add the quote and "file" at the end of each line, you will need to do a Find/Replace for each extension type (e.g. .vmt, .vtf, .wav etc). This means that you will need to do at least 2 Find/Replace steps (for .vmt and .vtf), possibly more if the map comes with custom sounds or models. For each extension type, you need to do a "Replace All" with the following: Find: ext Replace: ext" "file" I am substituting .ext for the actual extension here, but I hope you get the point. As an example, for .vtf you would do: and for .vmt: Committing the resources to memory For your SRCDS server to see the resource file it needs to be saved with a .res extension - so go to File -> Save and save the file as "mapname.res": Make sure you set "Save as Type" to "All files" or your file will probably be saved as "mapname.res.txt" - this is not a good thing, as it will be overlooked by your server. Copy or upload the .res file to the maps\ directory on your server and you should be good to go - you will now be able to download custom maps and all their resources properly. knoid || Admin, joe.to gaming community tf2.joe.to - challenge maps tf4.joe.to - custom maps ®ain Junior Member Posts: 15 Threads: 0 Joined: Dec 2004 Reputation: 0 12-25-2004, 09:00 AM nice tutorial, i wanted to do a .lst file for de_rats, its now easy, thank you knoid Junior Member Posts: 36 Threads: 3 Joined: Dec 2004 Reputation: 0 12-25-2004, 03:45 PM You're welcome . Thanks for the kind words. knoid || Admin, joe.to gaming community tf2.joe.to - challenge maps tf4.joe.to - custom maps HnyBear Newbie Posts: 2 Threads: 1 Joined: Dec 2004 Reputation: 0 01-12-2005, 06:24 AM I have something easier than all that. That is a lot to do. This program will automatically create them for you. Attached Files   ResGen.zip (Size: 601.55 KB / Downloads: 182) cableguy Newbie Posts: 3 Threads: 1 Joined: Jan 2005 Reputation: 0 01-19-2005, 01:31 PM Any way to include URL's in .res files? de4gl3r Newbie Posts: 2 Threads: 0 Joined: Jan 2005 Reputation: 0   01-24-2005, 12:52 AM [font=Courier][color=navy]I'm really having an issue with ping.... first off, I created my server. Now i get a connection problem once i join a team, then my ping rockets sky high to an outrageous 500+!!! Someone please help!!!! wisey Newbie Posts: 1 Threads: 0 Joined: Feb 2005 Reputation: 0 02-16-2005, 03:45 AM I have a question or 2 in your tutorial post you use \ in the resgen app it uses / so which do i use? also what are the files in the downloadlists folder for eg mapname.lst is this the same as a .res file? is .res windows and .lst linux? or do i create both files. on looking at the files they both seem very alike in structure. Ive got 2 servers running linux and im having trouble getting stuff from materials to be d/led from the server when players d/l the map. thanks in advance Wisey. « Next Oldest | Next Newest »