VERC: Mapfile Backup Application Last edited 5 years ago2019-04-21 12:28:10 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.

Version 2.0 (25/11/02)

The Mapfile Backup utility was created in response to a need voiced by the community. What was this need? SAVE OUR MAPS! :) A long running request by the community was that automatic map backups be supported. Although not time based (it'd be handy to have the backup run every 10 minutes, sure), this is the next best thing as it will create a backup of your map files each time you compile.

Instructions

The actual location of the mapbackup.exe file on the hard drive is irrelevant. Hence, it should be unzipped to a convenient location (eg. beside ZHLT).

The Expert compile mode under Worldcraft or Hammer should then be modified, so that this executable is called with the name of the mapfile before CSG. By default, an incremental backup will be created of your mapfile (mapname0000.map, mapname0001.map, etc) in the same directory everytime you compile.

You can change the default behavior by specifying the appropriate switches described below:
-ext extension    Force a specific extension for all backup files
-dir              Place backups of all files inside \filename\
-out path         Force a specific backup path (negates -ext and -dir)
-max #            Specify a maximum number of backup files to create
-e, -d, -o and -m are also accepted

Notes:

Examples

The examples below use the $path$file parameters used in the editor's advanced compile mode. If you were to use this utility in a batch file, you would use the actual path and name of the mapfile there.

Example : If I wanted to incrementally backup my map and rmf file every compile. I could use the following Expert compile mode command:
mapbackup.exe $path\$file
Example : If I wanted to backup only the .rmf, within its own folder, and have 30 incremental backup files at one time. I could use the following Expert compile mode command:
mapbackup.exe $path\$file.rmf -d -m 30
Example : I want to backup my map file and my 3rd hull file (mapname.p2) in their own directory, with a maximum of 50 backup files. I couuld use the following Expert compile mode command:
mapbackup.exe $path\$file.map $path\$file.p2 -m 50 -d

Troubleshooting

Below are some common questions that may arise.

What are ZHLT, that were mentioned above, and where can I find them?
ZHLT stands for Zoner's Half-Life Tools. These are modified versions of the original map compile tools (qcsg.exe, qbsp2.exe, vis.exe, and qrad.exe). Zoner's versions (hlcsg.exe, hlbsp.exe, hlvis.exe, and hlrad.exe) of the tools are very much improved, even aside from the more consistent naming. They add more versatility to the compile process and several new features, and they're no different to use than the original tools. They also feature several fixes to bugs that have been in the tools since the days of Quake.

ZHLT can be found here -- Zoner's Half-Life Tools - Custom Build 1.7
Didn't Merl do some customization of ZHLT?
He certainly did! Read more about them here:

Zoner's Half-Life Tools - Custom Build 1.7
Do I have to use this utility through Worldcraft/Hammer?
Not at all! You can easily use this utility in a batch file or manually (well, if you really wanted to...). The examples above show parameters to use while in the editor. $path and $file are variables for use in the advanced compile mode. In a batch file, these would be replaced with the actual path and filename of the map.
How do I add the mapbackup.exe tool to Hammer?
To add mapbackup.exe as a command, click on the Cmds button in the advanced compile dialog and select executable, then browse to and select the mapbackup.exe file. Add everything after "mapbackup.exe" into the "Parameters" field.

Download

Below is the latest version of this application.
This article was originally published on the Valve Editing Resource Collective (VERC).
TWHL only archives articles from defunct websites. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.

Comments

You must log in to post a comment. You can login or register a new account.