@REM Speed Completely Beyond Belief batch file
@ECHO off
@REM Check for the BBelief directory
cd ..
ECHO Speed Completely Beyond Belief
ECHO by the Quake done Quick team
ECHO (http://PlanetQuake.com/QdQ/)
IF NOT EXIST bbelief\scbb.bat ECHO You need to call your Beyond Belief directory "bbelief" to use this batch file.
IF NOT EXIST bbelief\scbb.bat GOTO END
cd bbelief

@REM Initialisation
IF EXIST *.tab del *.tab
IF EXIST put_back.bat CALL put_back
IF EXIST initpack.cfg del initpack.cfg
ECHO @ECHO off > put_back.bat
ECHO ECHO Returning paks to library >> put_back.bat
ECHO temp1 16 > initpack.cfg
IF EXIST scbb.pak GOTO WHICHQUAKE

:noscbb
ECHO I could not find the the pak containing the speed runs! (scbb.pak)
GOTO END

:WHICHQUAKE
IF EXIST ..\glquake.exe IF EXIST ..\quake.exe IF EXIST ..\winquake.exe GOTO GQW
IF EXIST ..\glquake.exe IF EXIST ..\quake.exe GOTO GQ
IF EXIST ..\glquake.exe IF EXIST ..\winquake.exe GOTO GW
IF EXIST ..\glquake.exe GOTO GLQUAKE
IF EXIST ..\quake.exe IF EXIST ..\winquake.exe GOTO QW
IF EXIST ..\quake.exe GOTO QUAKE
IF EXIST ..\winquake.exe GOTO WINQUAKE
ECHO Failed to find any of GLQuake, WinQuake and Quake.
GOTO END

:GQW
CHOICE /C:GQW "Run using GLQuake.exe, Quake.exe or WinQuake.exe "
IF errorlevel 3 GOTO WINQUAKE
IF errorlevel 2 GOTO QUAKE
IF errorlevel 1 GOTO GLQUAKE
GOTO END

:GQ
CHOICE /C:GQ "Run using GLQuake.exe or Quake.exe "
IF errorlevel 2 GOTO QUAKE
IF errorlevel 1 GOTO GLQUAKE
GOTO END

:GW
CHOICE /C:GW "Run using GLQuake.exe or WinQuake.exe "
IF errorlevel 2 GOTO WINQUAKE
IF errorlevel 1 GOTO GLQUAKE
GOTO END

:QW
CHOICE /C:QW "Run using Quake.exe or WinQuake.exe? "
IF errorlevel 2 GOTO WINQUAKE
IF errorlevel 1 GOTO QUAKE
GOTO END

:GLQUAKE
ECHO ' ' > glquake.tab
ECHO ' ' > glorwinq.tab
ECHO temp1 48 > initpack.cfg
ECHO r_wateralpha 0.3 >> initpack.cfg
GOTO COUNTPAKS

:WINQUAKE
ECHO ' ' > winquake.tab
ECHO ' ' > glorwinq.tab
GOTO COUNTPAKS

:QUAKE
ECHO ' ' > quake.tab
GOTO COUNTPAKS

:COUNTPAKS
IF NOT EXIST ..\id1\pak0.pak GOTO COUNTBB
CALL counter
IF NOT EXIST ..\id1\pak1.pak GOTO COUNTBB
CALL counter
IF NOT EXIST ..\id1\pak2.pak GOTO COUNTBB
CALL counter
IF NOT EXIST ..\id1\pak3.pak GOTO COUNTBB
CALL counter
IF NOT EXIST ..\id1\pak4.pak GOTO COUNTBB
CALL counter
IF NOT EXIST ..\id1\pak5.pak GOTO COUNTBB
CALL counter
IF NOT EXIST ..\id1\pak6.pak GOTO COUNTBB
CALL counter
IF NOT EXIST ..\id1\pak7.pak GOTO COUNTBB
CALL counter
IF NOT EXIST ..\id1\pak8.pak GOTO COUNTBB
CALL counter

:COUNTBB

IF NOT EXIST pak0.pak GOTO CHECK
CALL counter
IF NOT EXIST pak1.pak GOTO CHECK
CALL counter
IF NOT EXIST pak2.pak GOTO CHECK
CALL counter
IF NOT EXIST pak3.pak GOTO CHECK
CALL counter
IF NOT EXIST pak4.pak GOTO CHECK
CALL counter
IF NOT EXIST pak5.pak GOTO CHECK
CALL counter
IF NOT EXIST pak6.pak GOTO CHECK
CALL counter
IF NOT EXIST pak7.pak GOTO CHECK
CALL counter
IF NOT EXIST pak8.pak GOTO CHECK
CALL counter

:CHECK
IF EXIST 9.tab IF EXIST glorwinq.tab GOTO PROBLEM
CALL move_pak scbb
IF EXIST 9.tab IF EXIST glorwinq.tab GOTO PROBLEM

:OPTIONSBB
IF NOT EXIST sbbrun.pak IF NOT EXIST sbbmovie.pak GOTO OPTIONLITE
IF EXIST sbbrun.pak IF NOT EXIST sbbmovie.pak goto FPONLY
IF NOT EXIST sbbrun.pak IF EXIST sbbmovie.pak GOTO CMONLY
CHOICE /C:FRN Use first-person SBB, refilmed SBB or none of those
IF errorlevel 3 GOTO OPTIONLITE
IF errorlevel 2 GOTO CMINSTALL
GOTO FPINSTALL

:FPONLY
CHOICE Do you want to use the first-person SBB pak
IF errorlevel 2 GOTO OPTIONLITE
:FPINSTALL
CALL move_pak sbbrun
IF EXIST 9.tab IF EXIST glorwinq.tab GOTO PROBLEM
ECHO registered 2 >> initpack.cfg
GOTO OPTIONLITE

:CMONLY
CHOICE Do you want to use the refilmed SBB pak
IF errorlevel 2 GOTO OPTIONLITE
:CMINSTALL
CALL move_pak sbbmovie
IF EXIST 9.tab IF EXIST glorwinq.tab GOTO PROBLEM
ECHO registered 2 >> initpack.cfg

:OPTIONLITE
IF NOT EXIST sbblite.pak GOTO RUN
CHOICE Do you want to use the SBBlite pak
IF errorlevel 2 GOTO RUN
CALL move_pak sbblite
IF EXIST 9.tab IF EXIST glorwinq.tab GOTO PROBLEM
ECHO ambient_fade 200 >> initpack.cfg

:RUN
cd ..
IF EXIST bbelief\quake.tab GOTO RUNQUAKE
IF EXIST bbelief\winquake.tab GOTO RUNWINQUAKE
IF EXIST bbelief\glquake.tab GOTO RUNGLQUAKE

:RUNGLQUAKE
ECHO Starting GLQuake on SCBB
glquake -game bbelief -zone 512 -listen 10 %1 %2 %3 %4 %5 %6 %7 %8 %9
PAUSE
GOTO HAVERUN

:RUNWINQUAKE
ECHO Starting WinQuake on SCBB
winquake -game bbelief -zone 512 -listen 10 %1 %2 %3 %4 %5 %6 %7 %8 %9
PAUSE
GOTO HAVERUN

:RUNQUAKE
ECHO Starting DOS Quake on SCBB
quake -game bbelief -winmem 16 -zone 512 -listen 10 %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO HAVERUN

:PROBLEM
ECHO You are trying to run GLQuake or WinQuake with more than the maximum
ECHO number of *.pak files allowed. These versions of Quake will only work if
ECHO you use no more than eight *.pak files altogether in your id1\
ECHO and bbelief\ directories.
ECHO ----
ECHO There are four ways you may be able to solve this problem:
ECHO 1. If you have some unnecessary *.paks for such things as a crosshair
ECHO    in your id1\ or bbelief\ directories, move them out temporarily.
ECHO    Files such as id1\pak2.pak and upwards are probably suitable candidates.
ECHO 2. Each speed-run package (SCBB, SBB, SBBlite) uses one *.pak file.
ECHO    Try selecting less of them simultaneously.
ECHO 3. Run using normal Quake, not WinQuake or GLQuake. This version can
ECHO    handle any number of *.pak files.
ECHO 4. (For the Quake techie only.) Unpak the paks, or repak several small
ECHO    paks into one larger one, using a tool such as QPed or AdQuEdit.
ECHO ----
ECHO Sorry for the inconvenience. Hope one of these ideas helps!
ECHO ----
GOTO END

:HAVERUN
CLS
ECHO Speed Completely Beyond Belief 1999

:END
IF EXIST bbelief\scbb.bat cd bbelief
IF EXIST put_back.bat CALL put_back
IF EXIST put_back.bat del put_back.bat
IF EXIST initpack.cfg del initpack.cfg
IF EXIST *.tab del *.tab

