.bat file haulting after LEAK


(Valhue2) #1

Ok after reading up on a few posts that had .bat files, i finally created my very own .bat file (crom copy/paste of others files w/o permission :bash: ). Now when i run it and the map say … has a leak… for instance (not that my maps would though :cool: ) … hehe… anyway on to the .bat file


@echo off
set bsp_var= -meta -threads 1 -leaktest
set vis_var= -vis -saveprt
set light_var= -light -filter -thresh 0.2 -super 2 -samples 2
set q_path=c:/Quake3
set map_path=c:/Quake3/baseq3/maps/%1.map
set q3map_path=c:/Quake3/q3map2.exe
set gen_options= -fs_basepath %q_path% -v
::run the Bsp process
%q3map_path% %bsp_var% %gen_options% %map_path%
::wait for leak check, there should be a better way of doing this, but it works
Echo Is there a Leak?
pause
::run Vis process
%q3map_path% %vis_var% %gen_options% %map_path%
::lets light this sucker up
%q3map_path% %light_var% %gen_options% %map_path%
pause

now if you notice my comments about the ‘leak check’ and about a better way of doing this… i read somewhere about there being an ‘If Exist’ command but i also read about it not working in WinXP… is there a way of haulting the process if the compiler detects the .lin file or is it the .prt file… anyway thats my problem.

One more thing, is it at all possible to have q3 run after the compile process is completed? err… I can get Q3 to run after its done, but it just opens up to the main menu… i want to start inside my map.

IF this is the wrong place to post this, ill gladly move it to a more suitable location, since the .bat file communicates w/ q3map2, my first thought was to post this here

V^2


(Hewster) #2

dunno about the if command in XP, but

If I have a leak, I do just a bsp in radiant, so I can trace the error :slight_smile:
Once the map is leak free I use q3maptooz to do my compiles:
http://planetquake.com/hro/

forum thread:
http://www.quake3world.com/ubb/Forum6/HTML/022697.html?

It IMO is an excellent compiler frontend :slight_smile:

if you wana run the map after compile using a .bat file, simply add:
“PATH TO quake3.exe” +set sv_pure 0 +map yourmap

Hewster


(Emon) #3

cd c:\your\quake3\path
quake3.exe +devmap %1 (or whichever parameter is your map filename)

You need to change to the directory or tell Windows to use that directory as the working directory, otherwise Q3 will barf on you. I can’t recall how to do that as of this moment, though.


(Valhue2) #4

Ill try the cd c:… quake3.exe … When I did that, it did open up the q3 main menu, even though I did have +sv_pure 0 +devmap %1…

Ill try that line now.

On another note: Incase you dont know how ‘%1’ works, basically my understanding is this: the %1 is the first thing entered after the shortcut command. If you create a shortcut to your ‘Compile.bat’ file, right click on the shortcut, scroll to properties and find the line in the Properties dialog where it says “TARGET: C:\your_q3_dir\your_bat.bat”. After this line, add in your map name: “TARGET: C:\your_q3_dir\your_bat.bat my_first_map”. Now when your .bat file runs, when it comes across a %1, it will add in ‘my_first_map’… Now i havent tried a %2 or higher, for a second word after the initial call to your .bat file… but it may work… allowing you to specify things such as parameters or different game types… I use it in that way because its far quicker for me to change a line in the shortcut vrs. finding my .bat file, opening up a tex pad changing lines of code and resaving…

Try it

V^2