http://www.urbanterror.info/support/156-batch-compile-scripts/
 Login | Register 
  urt_home downloads support news HD | members groups servers forums    Follow on external_facebookexternal_twitterexternal_youtubeexternal_rss_feed  
printer


Level design

Batch Compile Scripts

Currently the only way to do a complete map compile of BSP, VIS, Light, Surface sounds and Bots is with a batch script. The best way to start a batch script is to copy the command lines from q3map2toolz, after you've finished tweaking the settings, into a .bat file; then add the surface sounds between the light and bot compiles.

noteNote: The bot compile (aas) must be run after the surface sounds have been imported.

If you've already made a surface file (see this tutorial), then you only need to import the surface back into the map. I do this in three steps:

1.Set the drive to the drive with my mapping install. (G drive for me) You may not need this if everything is on the c: drive.
g:
2.Change to the map directory:
cd g:gamesurbanterrorq3ut4maps
3.Import the surfaces:
bsp -si %map%.bsp null_c22.surface


Example Batch Script

full screen DOS code
 
@echo off
set map=null_c22
echo Compiling: %map%
start "BSP: %map%" /low /B /wait "G:GamesutilsQ3map2q3map2_fs_20gFS_q3map_Radbump_2a.exe" -meta -fs_basepath "G:GamesUrbanTerror" -fs_game q3ut4 "G:GamesUrbanTerrorq3ut4maps%map%.map"
start "VIS: %map%" /low /B /wait "G:GamesutilsQ3map2q3map2_fs_20gFS_q3map_Radbump_2a.exe" -vis -saveprt -fs_basepath "G:GamesUrbanTerror" -fs_game q3ut4 "G:GamesUrbanTerrorq3ut4maps%map%.bsp"
start "RAD: %map%" /low /B /wait "G:GamesutilsQ3map2q3map2_fs_20gFS_q3map_Radbump_2a.exe" -light -bounce 9 -fast -patchshadows -samples 2 -radbump -shade -fs_basepath "G:GamesUrbanTerror" -fs_game q3ut4 "G:GamesUrbanTerrorq3ut4maps%map%.bsp"
g:
cd g:gamesurbanterrorq3ut4maps
bsp -si %map%.bsp null_c22.surface
start "BSPC: Compiling %map%.aas" /low /B /wait "G:Gamesquake3Toolsbspc.exe" -forcesidesvisible -optimize -bsp2aas "G:GamesUrbanTerrorq3ut4maps%map%.bsp"
 

The Start Command

The start command allows you to start a program with a custom cpu priority; here I start all the compiles on low priority, using the /low option.

The /wait option tells the batch script to wait for that command to finish before executing the next line.

The /B option instructs the program being launched to not run in a new window.

Region Compiles

If you often do region compiles (File->Save Region) for quick tests of small areas and want to add the ability to switch between a full compile and region compile in your batch file, swap out the 'set map=xxxx' line for all this:
full screen DOS code
 
set map1=ut4_mandolin
set map2=mando_region
ECHO.
ECHO 1. FULL Compile
ECHO 2. REGION Compile
ECHO.
set choice=
set /p choice=Choose a number:
if '%choice%'=='2' goto REGION
set map=%map1%
goto START
:REGION
set map=%map2%
:START

Complete Cascade Example

full screen DOS code
 
@echo off
 
set map1=ut4_cascade
set map2=casc_region
 
ECHO.
ECHO 1. FULL Compile
ECHO 2. REGION Compile
ECHO 3. EDIT Batch Script
ECHO.
set choice=
set /p choice=Choose a number:
if '%choice%'=='3' goto EDIT
if '%choice%'=='2' goto REGION
set map=%map1%
goto START
:REGION
set map=%map2%
goto START
:EDIT
start notepad "null_crate RADBUMP.bat"
goto ENDSCRIPT
:START
echo.
echo Compiling: %map%
echo.
 
time /T
echo STARTING BSP:
start "BSP: %map%" /low /B /wait "G:GamesutilsQ3map2q3map2_fs_20gq3map2_fs_20g.exe" -meta -fs_basepath "G:GamesUrbanTerror" -fs_game q3ut4 "G:GamesUrbanTerrorq3ut4maps%map%.map" >> %map%_BSP.txt
 
time /T
echo STARTING VIS:
start "VIS: %map%" /low /B /wait "G:GamesutilsQ3map2q3map2_fs_20gq3map2_fs_20g.exe" -vis -saveprt -fs_basepath "G:GamesUrbanTerror" -fs_game q3ut4 "G:GamesUrbanTerrorq3ut4maps%map%.bsp" >> %map%_VIS.txt
 
time /T
echo STARTING RAD:
start "RAD: %map%" /low /B /wait "G:GamesutilsQ3map2q3map2_fs_20gFS_q3map_Radbump_2a.exe" -light -bounce 9 -fast -patchshadows -samples 2 -radbump -shade -fs_basepath "G:GamesUrbanTerror" -fs_game q3ut4 "G:GamesUrbanTerrorq3ut4maps%map%.bsp" >> %map%_RAD.txt
 
g:
 
cd gamesurbanterrorq3ut4maps
 
bsp -si %map%.bsp null_c22.surface
 
echo start "BSPC: Compiling %map%.aas" /low /wait "G:Gamesquake3Toolsbspc.exe" -forcesidesvisible -optimize -bsp2aas "G:GamesUrbanTerrorq3ut4maps%map%.bsp"
 
:ENDSCRIPT
 


level_none by - By FS NulL  -  Sunday, 29 May 2011  -  Last edit Wednesday, 08 June 2011  -  viewed by 166 members and 4321 visitors


Copyright © 2012 FrozenSand / 0870760 B.C. Ltd  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of 0870760 B.C. Ltd