View unanswered posts | View active topics It is currently Thu Sep 20, 2018 6:40 pm



Reply to topic  [ 5 posts ] 
 Magic Compile Batch 
Author Message

Joined: Thu May 09, 2013 12:18 pm
Posts: 87
Location: Spain
Post Magic Compile Batch
This script could be useful to those who rather using a console better than logging to files or use gtk console. You must modify the variable %q3tk_mapname% to target map to compile, and it must be placed on baseq3/maps folder to run. Make sure you configure drive and path variables correctly too.

Attachment:
makemap.zip [890 Bytes]
Downloaded 383 times


Code:
@echo off

echo Setting environment vars
set q3tk_mapname=%1%
if "%1%" == "" set q3tk_mapname=smktourney2
set q3tk_drv=H
set q3tk_root=%q3tk_drv%:\games\q3
set q3tk_bsp="%q3tk_root%\NetRadiant
set q3tk_maps=%q3tk_root%\baseq3\maps
set q3tk_mapfile=%q3tk_maps%\%q3tk_mapname%.map
set q3tk_bspfile=%q3tk_maps%\%q3tk_mapname%.bsp
set q3tk_aasfile=%q3tk_maps%\%q3tk_mapname%.aas
set q3tk_automatic=0


echo Choose comilation mode
echo  A - Automated
echo  I - Interactive
echo  R - Just run the game
choice /C AIR /M "Please choose"
if %ERRORLEVEL% == 2 goto q3tk_skipauto
set q3tk_automatic=1
if %ERRORLEVEL% == 3 goto q3tk_runengine

:q3tk_skipauto
echo Navigating upon working directory...
%q3tk_drv%:
cd %q3tk_bsp%
echo Compiling "%q3tk_mapfile%"...

if %q3tk_automatic% == 1 goto q3tk_autobsp
color 0f
choice /C YN /M "Wanna compile bsp?"
if %ERRORLEVEL% == 2 goto q3tk_viscompile

:q3tk_autobsp
color 0a
echo -------------------------------------------------------
echo                                                     BSP
echo -------------------------------------------------------
q3map2.exe -meta "%q3tk_mapfile%" -threads 4

:q3tk_viscompile
if %q3tk_automatic% == 1 goto q3tk_autovis
color 0f
choice /C YN /M "Wanna compile visibility?"
if %ERRORLEVEL% == 2 goto q3tk_radcompile

:q3tk_autovis
color 0b
echo -------------------------------------------------------
echo                                                     VIS
echo -------------------------------------------------------
q3map2.exe -vis -saveprt -threads 4 "%q3tk_mapfile%"

:q3tk_radcompile
if %q3tk_automatic% == 1 goto q3tk_autorad
color 0f
choice /C YN /M "Wanna compile radiosity?"
if %ERRORLEVEL% == 2 goto q3tk_aascompile

:q3tk_autorad
color 0c
echo -------------------------------------------------------
echo                                                     RAD
echo -------------------------------------------------------
q3map2.exe -light -fast -super 2 -filter -bounce 8 -threads 4 "%q3tk_mapfile%"

:q3tk_aascompile
if %q3tk_automatic% == 1 goto q3tk_autoaas
color 0f
choice /C YN /M "Wanna compile aas bot routes?"
if %ERRORLEVEL% == 2 goto q3tk_runengine

:q3tk_autoaas
color 0d
echo -------------------------------------------------------
echo                                                     AAS
echo -------------------------------------------------------
bspc.exe -forcesidesvisible -optimize -threads 4  -bsp2aas "%q3tk_mapfile%"

:q3tk_runengine
if %q3tk_automatic% == 1 goto q3tk_automap
color 0f
choice /C YN /M "Wanna run the map?"
if %ERRORLEVEL% == 2 goto q3tk_end

:q3tk_automap
color 0e
echo Launching engine...
cd %q3tk_root%

echo quake3.exe +sv_cheats 1 +g_gametype 3 +sv_pure 0 +devmap "%q3tk_mapname%"
quake3.exe +sv_cheats 1 +g_gametype 3 +sv_pure 0 +devmap "%q3tk_mapname%"

:q3tk_end

_________________
Work fast. Pray faster.


Last edited by smiker on Sat Sep 07, 2013 3:45 pm, edited 3 times in total.



Fri Sep 06, 2013 5:17 pm
Profile WWW

Joined: Thu May 09, 2013 12:18 pm
Posts: 87
Location: Spain
Post Re: Magic Compile Batch
This script can:

    Automate map loading, to be able to load the quickest way your maps (Just press R after loading the script)

    Compile only certain stages on the compilation chain (Like computing reachability, if you just changed the items on last BSP compilation)

    Compile (With aas route generation included in the compilation commands) a map without having to worry about nothing, not freezing the editor when compiling, not overloading Radiant's console with redundant information, and running the game when finished but leaving the script window open to be able to check full console output.

I thought it was worth to share.

_________________
Work fast. Pray faster.


Sun Sep 08, 2013 12:05 pm
Profile WWW

Joined: Sun Oct 28, 2012 3:40 am
Posts: 32
Post Re: Magic Compile Batch
Here's my quick packaging batch. I left all the other options out since it was heavily personalized.

It should be fairly easy to adapt to someone else setup :

To change :
USERFOLDER
MAP
Quake 3 Base Path / Quake Live Base Path if different

Require :
quakelivedec.exe
list.txt containing the path of the folder to add in the package (maps, textures, scripts, etc)

Code:
"C:\Program Files\WinRAR\WinRAR.exe" a "%~dp0MAP.zip" @"list.txt"
DEL /F "D:\Software\Games\Steam\steamapps\common\quake 3 arena\baseq3\MAP.pk3"
COPY MAP.zip "D:\Software\Games\Steam\steamapps\common\quake 3 arena\baseq3"
REN "D:\Software\Games\Steam\steamapps\common\quake 3 arena\baseq3\MAP.zip" "MAP.pk3"


quakelivedec MAP.zip MAP.pk3

DEL /F "C:\Users\USERFOLDER\AppData\LocalLow\id Software\quakelive\baseq3\MAP.pk3"

COPY MAP.pk3 "C:\Users\USERFOLDER\AppData\LocalLow\id Software\quakelive\baseq3"


ATTRIB +R "C:\Users\USERFOLDER\AppData\LocalLow\id Software\quakelive\baseq3\MAP.pk3"

DEL /F MAP.pk3
DEL /F MAP.zip



Oh well, it might require a lots of change to make it work on your machine, but once it is done, it make everything a breeze. You can also add the compiling process in there.

It will allow you to test both Quake Live and Quake 3 without messing with the file transfers, encrypting etc.


Wed Sep 11, 2013 2:01 am
Profile

Joined: Thu May 09, 2013 12:18 pm
Posts: 87
Location: Spain
Post Re: Magic Compile Batch
Cool. Gonna modify it a bit to hold some env vars :P
:) Thanks for sharing!

_________________
Work fast. Pray faster.


Wed Sep 11, 2013 10:38 am
Profile WWW

Joined: Thu May 09, 2013 12:18 pm
Posts: 87
Location: Spain
Post Re: Magic Compile Batch
New version, now accepts 2 optional parameters, first is the map to be compiled (only the name) and the mod which will be made the map for.
New Features:
·Pack in pk3 (you must copy 7zip on radiant's base directory, a bit dirty, but everything should work fine.
·Automatically insert levelshot, arena and txt when placed on map directory, everything inside the final pk3.
·Better compile tweaks

Code:
@echo off
echo ----------------------------------------------------
echo Map-O-Matic - djsmiker@gmail.com
echo ----------------------------------------------------

rem Get map name, or fall back to preset map name
set q3tk_mapname=%1%
if "%1%" == "" set q3tk_mapname=nsndm2a
echo Map name is %q3tk_mapname%

set q3tk_modname=%2%
if "%2%" == "" set q3tk_modname=defrag
echo Mod name is %q3tk_modname%

rem Set vars to default values
set q3tk_threads=4
set q3tk_drv=H
set q3tk_root=%q3tk_drv%:\games\q3
set q3tk_bsp="%q3tk_root%\Radiant
set q3tk_maps=%q3tk_root%\baseq3\maps
set q3tk_mapfile=%q3tk_maps%\%q3tk_mapname%.map
set q3tk_bspfile=%q3tk_maps%\%q3tk_mapname%.bsp
set q3tk_aasfile=%q3tk_maps%\%q3tk_mapname%.aas
set q3tk_prtfile=%q3tk_maps%\%q3tk_mapname%.prt
set q3tk_srffile=%q3tk_maps%\%q3tk_mapname%.srf
set q3tk_pk3file=%q3tk_root%\baseq3\%q3tk_mapname%

set q3tk_savfile=%q3tk_maps%\%q3tk_mapname%.autosave.map
set q3tk_bakfile=%q3tk_maps%\%q3tk_mapname%.bak
set q3tk_bakcmd=move %q3tk_bakfile% %q3tk_maps%\backup\%q3tk_mapname%.map
set q3tk_savcmd=move %q3tk_savfile% %q3tk_maps%\autosave\%q3tk_mapname%.map

set q3tk_pktemp=%q3tk_maps%\%1%_pk3
set q3tk_readme=%q3tk_maps%\%1%.txt
set q3tk_arena=%q3tk_maps%\%1%.arena
set q3tk_shader=%q3tk_maps%\%1%.shader
set q3tk_levelshot=%q3tk_maps%\%1%.jpg
set q3tk_radparams_quick=-light -fast -dirty -dirtdepth 32 -patchshadows -optimize -threads %q3tk_threads% -shade -samples 4 -filter -fs_basepath %q3tk_root% "%q3tk_mapfile%"
set q3tk_radparams_fast=-light -fast -dirty -dirtdepth 128 -patchshadows -optimize -threads %q3tk_threads% -filter -super 2 -bounce 8 -fs_basepath %q3tk_root% "%q3tk_mapfile%"
set q3tk_radparams_full=-light -dirty -dirtdepth 128 -patchshadows -optimize -threads %q3tk_threads% -samples 4 -bounce 16 -shade -fs_basepath %q3tk_root% "%q3tk_mapfile%"

set q3tk_bspcmd=q3map2.exe -v -meta "%q3tk_mapfile%" -threads 4
set q3tk_viscmd=q3map2.exe -v -vis -saveprt -threads 4 "%q3tk_mapfile%"
set q3tk_radcmd=q3map2.exe -v -light -super 2 -filter -bounce 8 -threads 4 "%q3tk_mapfile%"
set q3tk_aascmd=bspc.exe -optimize -threads 4  -bsp2aas "%q3tk_mapfile%"
set q3tk_pakcmd=%q3tk_bsp%\7z.exe" a %q3tk_pk3file%.zip %q3tk_pktemp%\*
set q3tk_runcmd=quake3.x64.exe +set fs_game %q3tk_modname% +set df_promode 1 +sv_cheats 1 +g_gametype 3 +sv_pure 0 +devmap "%q3tk_mapname%"

echo Navigating upon working directory...
%q3tk_drv%:
cd %q3tk_bsp%

echo -------------------------------------------------------
echo                                 Choose compilation mode
echo -------------------------------------------------------
echo  A - Automated Build
echo  I - Interactive Build
echo  R - Load and Run %q3tk_mapname%
echo  P - Pack %q3tk_mapname%
echo  C - Clean %q3tk_mapname%'s temporary files
choice /C AIRPC /M "Please choose"
set q3tk_mode=%ERRORLEVEL%

if %q3tk_mode% == 1 goto q3tk_automatic
if %q3tk_mode% == 3 goto q3tk_runenginerun
if %q3tk_mode% == 4 goto q3tk_pak
if %q3tk_mode% == 5 goto q3tk_clean

echo Compiling "%q3tk_mapfile%"...

color 0f
choice /C YN /M "Wanna compile bsp?"
if %ERRORLEVEL% == 2 goto q3tk_viscompile

color 0a
echo -------------------------------------------------------
echo                                                     BSP
echo -------------------------------------------------------
%q3tk_bspcmd%

:q3tk_viscompile
color 0f
choice /C YN /M "Wanna compile visibility?"
if %ERRORLEVEL% == 2 goto q3tk_radcompile

color 0b
echo -------------------------------------------------------
echo                                                     VIS
echo -------------------------------------------------------
%q3tk_viscmd%

type %q3tk_root%\vis.log

:q3tk_radcompile
color 0f
choice /C YN /M "Wanna compile radiosity?"
if %ERRORLEVEL% == 2 goto q3tk_aascompile

color 0c
echo -------------------------------------------------------
echo                                                     RAD
echo -------------------------------------------------------
%q3tk_radcmd%

:q3tk_aascompile
color 0f
choice /C YN /M "Wanna compile aas bot routes?"
if %ERRORLEVEL% == 2 goto q3tk_runengine

color 0d
echo -------------------------------------------------------
echo                                                     AAS
echo -------------------------------------------------------
%q3tk_aascmd%

:q3tk_runengine
color 0f
choice /C YN /M "Wanna run the map?"
if %ERRORLEVEL% == 2 goto q3tk_end

:q3tk_runenginerun
color 0e
echo Launching engine...
cd %q3tk_root%

echo quake3.exe +sv_cheats 1 +g_gametype 3 +sv_pure 0 +devmap "%q3tk_mapname%"
%q3tk_runcmd%
goto q3tk_end

rem -----------------------------------------------------------------------------
rem Subroutines
rem -----------------------------------------------------------------------------

rem AUTOMATIC COMPILATION
:q3tk_automatic
echo -------------------------------------------------------
echo                                          AUTOMATED MODE
echo -------------------------------------------------------
echo Select automated mode
echo  Q - Quickest
echo  F - Fast
echo  R - Release
choice /C QFR /M "Selection 
set q3tk_auto_mode=%ERRORLEVEL%
if %q3tk_auto_mode%==1 set q3tk_viscmd=q3map2.exe -vis -saveprt -threads %q3tk_threads% "%q3tk_mapfile%"
if %q3tk_auto_mode%==1 set q3tk_radcmd=q3map2.exe %q3tk_radparams_quick%
if %q3tk_auto_mode%==1 set q3tk_aascmd=echo No routes will be generated since compiling in quickest mode.
if %q3tk_auto_mode%==2 set q3tk_viscmd=q3map2.exe -vis -saveprt -threads %q3tk_threads% "%q3tk_mapfile%"
if %q3tk_auto_mode%==2 set q3tk_radcmd=q3map2.exe %q3tk_radparams_fast%
if %q3tk_auto_mode%==2 set q3tk_aascmd=bspc.exe -forcesidesvisible -optimize -threads 4  -bsp2aas "%q3tk_mapfile%"
if %q3tk_auto_mode%==3 set q3tk_viscmd=q3map2.exe -vis -saveprt -threads %q3tk_threads% "%q3tk_mapfile%"
if %q3tk_auto_mode%==3 set q3tk_radcmd=q3map2.exe %q3tk_radparams_full%
if %q3tk_auto_mode%==3 set q3tk_aascmd=bspc.exe -optimize -threads %q3tk_threads%  -bsp2aas "%q3tk_mapfile%"

%q3tk_bspcmd%
%q3tk_viscmd%
%q3tk_radcmd%
%q3tk_aascmd%
rem goto q3tk_run
goto q3tk_pak

:q3tk_pak

echo Cleaning Up existing PK3...
rmdir /S /Q %q3tk_pktemp%
if exist "%q3tk_pk3file%.pk3" erase %q3tk_pk3file%.pk3

echo Creating PK3 temporary folders...
md %q3tk_pktemp%
md %q3tk_pktemp%\maps
md %q3tk_pktemp%\scripts
md %q3tk_pktemp%\levelshots
md %q3tk_pktemp%\textures
md %q3tk_pktemp%\sounds

echo Copying map files...
copy %q3tk_bspfile% %q3tk_pktemp%\maps
copy %q3tk_mapfile% %q3tk_pktemp%\maps

echo Copying bot routes...
if exist     "%q3tk_aasfile%" goto aas_true
if not exist "%q3tk_aasfile%" goto aas_false

:aas_false
echo WARNING: No AAS File was found. PK3 should not be released!!!
goto skipaas

:aas_true
copy %q3tk_aasfile% %q3tk_pktemp%\maps
goto skipaas

:skipaas

echo Gathering texture files...
echo q3tk.exe -gathertga %q3tk_mapfile% %q3tk_pktemp%\textures
echo This functionality is still not implemented.
:skiptextures

echo Gathering sound files...
echo q3tk.exe -gatherwav %q3tk_mapfile% %q3tk_pktemp%\sounds
echo This functionality is still not implemented.
:skiptextures

if not exist %q3tk_readme% goto skipreadme
echo Copying readme file...
copy %q3tk_readme% %q3tk_pktemp%\%1%.txt
:skipreadme

if not exist %q3tk_arena% goto skiparena
echo Copying arena file...
copy %q3tk_arena% %q3tk_pktemp%\scripts\%1%.arena
:skiparena

if not exist %q3tk_shader% goto skipshader
echo Copying shader file...
copy %q3tk_shader% %q3tk_pktemp%\scripts\%1%.shader
:skipshader

if not exist %q3tk_levelshot% goto paknow
echo Copying levelshot...
copy %q3tk_levelshot% %q3tk_pktemp%\levelshots\%1%.jpg

:paknow
echo Packing files...
%q3tk_pakcmd%

echo Cleaning up temporary folders...
move %q3tk_pk3file%.zip %q3tk_pk3file%.pk3
rmdir /S /Q %q3tk_pktemp%

:q3tk_run

pause
cd %q3tk_root%
%q3tk_runcmd%
rem goto q3tk_end

:q3tk_clean
erase %q3tk_aasfile%
erase %q3tk_bspfile%
erase %q3tk_prtfile%
erase %q3tk_srffile%

echo Searching for %q3tk_bakfile%...
if not exist %q3tk_bakfile% goto exitbackup
%q3tk_bakcmd%
:exitbackup

echo Searching for %q3tk_savfile%...
if not exist %q3tk_savfile% goto exitautosave
%q3tk_savcmd%
:exitautosave

:q3tk_end
pause


_________________
Work fast. Pray faster.


Mon Oct 07, 2013 5:00 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.