.bat file that when completed will run your map in Q3


(Valhue2) #1

Ok… so i lied, there is one more thing you need to do, which is to create a shortcut. Im still working with the folks over at computing.net to see if it is indeed capable of running an .exe with variables inside a .bat file. This is what i have created:


@echo off

REM The the name of your map will substitute the %1
REM as long as you add the name of your map to the properties
REM section of this .bat file. [More on this in the next comments]

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_dir=c:/Quake3/baseq3/maps
SET map_path=c:/Quake3/baseq3/maps/%1.map
SET q3map2_path=c:/Quake3/q3map2_256/q3map2.exe
SET gen_options= -fs_basepath %q_path% -v

REM The following SET is to the shortcut that you must
REM create and place in your Q3 directory, this is so
REM that the Quake3 will run your map after the compile
REM is complete, as long as no LEAKS are found.
REM To create the shortcut, right click on your Quake3.exe
REM and choose CREATE SHORTCUT.
REM This will place a shortcut to your Quake3.exe in your
REM Quake3 folder. Rename this shortcut to something like
REM 'run_mapname'. The next step is to right click on the 
REM shortcut and go to PROPERTIES, where it says TARGET,
REM add +sv_pure 0 +devmap %1 after it. It should look like
REM '[your_drive]:\[Your_q3folder]\quake3.exe +sv_pure 0 +devmap %1'

SET run_shortcut=START %q_path%/play_[mapname (or whatever)]

REM run Bsp process
%q3map2_path% %bsp_var% %gen_options% %map_path%
IF EXIST %map_dir%/%1.LIN GOTO End

REM run Vis process
%q3map2_path% %vis_var% %gen_options% %map_path%

REM run light process
%q3map2_path% %light_var% %gen_options% %map_path%
%run_shortcut%
Exit
:End
pause

The comments explain a bit about the meaning behind %1, and how to create a shortcut if you dont already know how. Other then that, just copy the text, and save as .bat… Make sure you change the Paths to your programs because they might differ from mine.

Please note that this runs fine w/in Win XP and should cross platform mighty nicely.

V^2


(Valhue2) #2

Ok, iv been working on this for quite some time, and have figured out how you can start Q3 in your map (instead of that cheesy workaround in the first post. Copy this text and Save As a .bat file into your Q3 folder, Make sure you change the compiler options as you see fit:


@echo off

REM The the name of your map will substitute the %1
REM as long as you add the name of your map to the properties
REM section of this .bat file (right click > properties). 
REM [I have given you the ability to add up to 9 different 
REM lines _AFTER_ your mapname.
REM
REM Example: +sv_pure 0 +devmap mymap. There are 4 bits of data;
REM '+sv_pure' is one, '0' is another, ect.] As long as the name
REM of your map is the first bit of information after '.bat'
REM then your map will run just fine. I havent tested to see
REM if there can be more then 9 bits of information stored.
REM If you need more bits, just keep adding %10 %11 %12.. so on
REM _AFTER_ %9, %1 _NEEDS_ to stay at the very end as that is 
REM your map file. Its a bit complicated but it works, one file
REM to compile your map, and run it in Q3, no having to check to
REM see if its done or not.

SET bsp_var= -meta -threads 1 -leaktest
SET vis_var= -vis -saveprt
SET light_var= -light -patchshadows -filter -thresh 0.2 -super 2 -samples 2
SET q_path=c:/Quake3
SET q_exe=%q_path%/quake3.exe
SET map_dir=c:/Quake3/baseq3/maps
SET map_path=c:/Quake3/baseq3/maps/%1.map
SET q3map2_path=c:/Quake3/q3map2_256/q3map2.exe
SET gen_options= -fs_basepath %q_path% -v

REM run Bsp process
%q3map2_path% %bsp_var% %gen_options% %map_path%
IF EXIST %map_dir%/%1.LIN GOTO End

REM run Vis process
%q3map2_path% %vis_var% %gen_options% %map_path%

REM run light process
%q3map2_path% %light_var% %gen_options% %map_path%
START %q_exe% %2 %3 %4 %5 %6 %7 %8 %9 %1
pause
Exit
:End
pause

I can finally put this project to rest. Use if ya want.

V^2