# .bat(ch) files, questions/info?

Discussion in 'Mapping Questions & Discussion' started by Cerulean, Sep 17, 2008.

1. ### CeruleanL3: Member

Messages:
112
Positive Ratings:
59
I just discovered the power of batch files... including adding extra lines to the compile process in hammer.

Now, hammer adds all of my custom files from a text file into my bsp.... but only the ones that I know I've added, and added to a text file:

bspzip.exe... -addlist $bspdir\$file.bsp path\to\customlist.txt $bspdir\$file.bsp

But, does anyone have anything to say about bspzip vs pakrat (and/or pakrat auto features)??? I'm curious...

And outside of Hammer...

bz2.bat... path/to/bzip2.exe -z -k path/to/teamfo~1/tf/maps/%1.bsp

Copied this to my system32 folder... all I have to do is open a run prompt and type bz2 mapname. I love it. I've added more to this bat to copy the bsp to my srcds map folder, and the bz2 to the srcds map folder and www map folder.

Some questions I have...

Is it possible to batch buildcubemaps? (I'm trying to go from hammer to dedicated server testing in as few steps as possible)

What other cool things can I do with batch files? (and save time searching steam folders for files to copy/open/etc)

And... useful batch files for the executables hiding in the sourcesdk bin?

Last edited: Sep 17, 2008
2. ### nossieL3: Member

Messages:
107
Positive Ratings:
4
ok first off i dont know much about batch files but all i know is that basically they do commands instantly instead of you doing them. so you can practiclly get it to type a essay if u wanted to... (dno why u would tho lolz) u can get it to search the computer excute files at certain times (not sure tho). the buildcubemaps probably wont be able to be done as i think u actually have to be ingame to build them. not too sure tho
and yes u can run executables in the sourcesdk bin

try searching on google to see what else you can do

3. ### ApomL6: Sharp Member

Messages:
366
Positive Ratings:
62
One tip I can give you is to not put your file in the System32 folder - because, well, it's really not a system file. Put it in your sourcesdk/bin folder instead.

I understand that the reason why you did it is because you wanted to run your program without having to type the whole C:\ program files\etc. thing. The proper way to do this is to go to your windows control panel > system > advanced, click on environment variables, find PATH in the list of system variables, and add your sourcesdk/bin folder to the list of folders that's already here (it's semicolon-separated).

• Thanks x 1
4. ### CeruleanL3: Member

Messages:
112
Positive Ratings:
59
Thanks for the PATH info...

I just took the .bat's out of my system32 folder and put them all in a batch folder with my other mapping tools. (and added that folder to the Path)

5. ### ApomL6: Sharp Member

Messages:
366
Positive Ratings:
62
Glad I could help. Also, those commands you call in hammer with your "build" button could actually be called directly from a batch file (vbsp, vvis and vrad all are executable files).

6. ### aaA Boojum SnarkToraipoddodezain Mazahabado

Messages:
4,769
Positive Ratings:
5,535
I use this to compile. You may find it of interest... possibly. For me at least, it's way faster than compiling with hammer when dealing with smaller maps, because hammer seems to actually wait for the slow UI update of all the stuff the compilers report.

Also, cubemaps are built off the rendering engine, so there's no way to do that through the compilers.

7. ### BrandishedL5: Dapper Member

Messages:
234
Positive Ratings:
298
You can do a bunch of stuff with batch files, I listed a few things here. You can't build cubemaps via batch files (as far as I know) as the process uses the HL2 (source) engine to do so.

You can supposedly compile the map without using Hammer, I haven't tried this myself, but saw this in an email from the hlmappers mailing list a while back, Steam would probably have to be running for this to work: