Snarkpit Articles


So you've just made your killer map. It rocks, and you want everybody to play it. However, you used a bunch of custom resources for your map, such as a new skybox and new ambient sounds. If a server has these files, and is running the map, and people connect to play - if they dl the map from the server they will not dl all the necessary files, only the bsp, txt and the overview.

Such has been the bane of custom mappers for quite some time - wadincluding was created to partially alleviate the problem, but it's just not enough. What a .res (resource) file does is tell the server to send players all the other files to. It is a text-based list of the pathnames of necessary files, and can be edited in Notepad by hand. But this is rather inefficient - there is a program called RESGen that can look at a .bsp and create a .res file with every necessary resource listed, no work needed. This tutorial will explain how to use RESGen.

  • First off - you're gonna need to dl RESGen. http://www.unitedadmins.com/resgen.php is the website, click on the link for the program, not the source. Unzip the file to wherever you want. For sake of argument, I will be placing it with my compiling tools in C:zhlt

  • Make sure you have a compiled map that you would like to create a .res file for. In my case, I will be making one for my HLDM map Vernon, which is located at C:SierraHalf-LifevalvemapsVernon.bsp
  • Go ahead and run the RESGen.exe, just to see what it does. You will notice it opens up in a window, spews out a lot of random text, and ends with an error and a press any key to exit



Gee... that's imformative. How do I use this ridiculous program? Well, like Zoner's compile tools, it runs in a DOS prompt. While there are dozens of downloadable programs that will help you run the compile tools in Windows, so far as I have seen, there isn't a single one for RESGen. What we're going to do is create a small file, known as a batch file, that can be used to give the computer commands, and run RESGen for you. A batch file is any text file with valid DOS commands that ends in .bat. So let's create the batch file.

  • First, open up Notepad. Goto Start Menu -> All Programs -> Accessories -> Notepad. This is a simple program that can open any file and read it as text.
  • Now, you need to tell the computer where RESGen is so that it can run it. Your first line will start with remembering from earlier in the tutorial)

    C:zhltRESGen.exe


  • RESGen, like the compiling tools, knows what to do from commandlines that follow the program pathname. There are a lot of possible commmandlines for RESGen, luckily you only really need one. -f [map] will tell RESGen to create a res file for the listed map. In other words, you should write

    C:zhltRESGen.exe -f C:SierraHalf-LifevalvemapsVernon.bsp


  • That's it! That's all you need! You must save the batch file now, though. To do this, go to Save As..., set the drop down box to Text Documents, and name the file resgen.bat


    This ending in .bat is very important because it tells the computer this is not just a plain textfile, it is a batch file. I recommend saving the file to the desktop to start off, so it is easily reachable.

  • Look at the file on your desktop. The icon should be: and not: If it looks like the second picture, you need to check the extension of the file and make sure it is .bat and not .txt


If you're still with me, you're done! I know that was wordy, but it's really not too much work, just a lot of explanation. Now, time to run RESGen on my map! All I need to do is double-click on resgen.bat and this should happen:


Obviously, you'll want to use RESGen for more than one map. All you need to do to change which map it will create the file for is right-click on resgen.bat and choose Edit from the menu. Edit the map pathname and hit Save and you are done. Nothing to it.


Post ReplyView Topic
Discussion
0 starsPosted by fokker on Mon Jul 19th 2004 at 8:46pm

Very nice tut. Touches all the bases and leaves me asking no questions.
0 starsPosted by Paladin[NL] on Wed Jul 14th 2004 at 2:34pm

Handy, thnx for sharing
Post ReplyView Topic