home *** CD-ROM | disk | FTP | other *** search
/ CD Action 6 A / cdactioncoverdisc / quakemap / qm.bat < prev    next >
DOS Batch File  |  1996-10-06  |  2KB  |  111 lines

  1. @echo off
  2. echo  *************************************
  3. echo *** QuakeMap Batch for DOS run-time ***
  4. echo  *************************************
  5. echo.
  6.  
  7. rem ***  Quake root directory is set here : ***
  8. set QUAKE=\QUAKE
  9. set TOOLDIR=.
  10.  
  11. if "%1"=="" goto Info
  12.  
  13. :Loop
  14. if "%1"=="" goto Stop
  15. if "%1"=="/b" goto Rebuild
  16. if "%1"=="/k" goto RebuildQuick
  17. if "%1"=="/1" goto QBSP
  18. if "%1"=="/2" goto VIS
  19. if "%1"=="/3" goto LIGHT
  20. if "%1"=="/q" goto Run
  21. goto Info
  22.  
  23. :Rebuild
  24. shift
  25. cd %QUAKE%\QMapExec\maps
  26. if not exist %TOOLDIR%\QBSP.EXE goto BuildError
  27. if not exist %TOOLDIR%\VIS.EXE goto BuildError
  28. if not exist %TOOLDIR%\LIGHT.EXE goto BuildError
  29. %TOOLDIR%\QBSP %1
  30. if not exist %1.bsp goto QBSPError
  31. %TOOLDIR%\VIS %1
  32. %TOOLDIR%\LIGHT %1
  33. shift
  34. goto Loop
  35.  
  36. :RebuildQuick
  37. shift
  38. cd %QUAKE%\QMapExec\maps
  39. if not exist %TOOLDIR%\QBSP.EXE goto BuildError
  40. if not exist %TOOLDIR%\LIGHT.EXE goto BuildError
  41. %TOOLDIR%\QBSP %1
  42. if not exist %1.bsp goto QBSPError
  43. %TOOLDIR%\LIGHT %1
  44. shift
  45. goto Loop
  46.  
  47. :QBSP
  48. shift
  49. cd %QUAKE%\QMapExec\maps
  50. if not exist %TOOLDIR%\QBSP.EXE goto BuildError
  51. %TOOLDIR%\QBSP %1
  52. if not exist %1.bsp goto QBSPError
  53. shift
  54. goto Loop
  55.  
  56. :VIS
  57. shift
  58. cd %QUAKE%\QMapExec\maps
  59. if not exist %TOOLDIR%\VIS.EXE goto BuildError
  60. %TOOLDIR%\VIS %1
  61. shift
  62. goto Loop
  63.  
  64. :LIGHT
  65. shift
  66. cd %QUAKE%\QMapExec\maps
  67. if not exist %TOOLDIR%\LIGHT.EXE goto BuildError
  68. %TOOLDIR%\LIGHT %1
  69. shift
  70. goto Loop
  71.  
  72. :QBSPError
  73. echo.
  74. echo -----------------------------------------------------------------------------
  75. echo QBSP failed.  Press any key to return to QuakeMap...
  76. pause > nul
  77. goto Stop
  78.  
  79. :BuildError
  80. echo.
  81. echo Build error : you should copy QBSP.EXE, VIS.EXE and LIGHT.EXE in QuakeMap
  82. echo directory. These three files are required to build levels. They can be found
  83. echo at any Quake-related ftp server (including ftp.cdrom.com/pub/idgames2).
  84. echo.
  85. pause
  86. goto Stop
  87.  
  88. :Run
  89. cd %QUAKE%
  90. if not exist QMapExec\*.* md QMapExec
  91. echo exec default.cfg > QMapExec\quake.rc
  92. echo exec config.cfg >> QMapExec\quake.rc
  93. echo exec autoexec.cfg >> QMapExec\quake.rc
  94. echo exec qmapexec.cfg >> QMapExec\quake.rc
  95. echo stuffcmds >> QMapExec\quake.rc
  96. if exist QMapExec\config.cfg del QMapExec\config.cfg
  97.  
  98. Quake -game QMapExec %2 %3 %4 %5 %6 %7 %8 %9
  99.  
  100. goto Stop
  101.  
  102. :Info
  103. echo.
  104. echo This batch may not be run directly now. Reserved for future use.
  105. echo.
  106.  
  107. :Stop
  108. cd %TOOLDIR%
  109. set TOOLDIR=
  110. set QUAKE=
  111.