Skip to content

Commit 8376c37

Browse files
committed
Big changes:
- pakrat->custom lua packager (VERY TESTING) from https://github.com/Metastruct/reslister - Custom compilers from https://facepunch.com/showthread.php?t=1552397 / https://github.com/THE-HAVOK/source-sdk-2013 - misc changes, fixes
1 parent 91fedeb commit 8376c37

14 files changed

+350
-40
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
/*.log
22
/user_config.cmd
3+
/VIDE
4+
/game_compiling
5+
/compilepal
6+
/bin
7+
8+
/extras/hammerlua/lua/winapiffi

LAUNCH compile.cmd

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@set VRADLDR=%VRADHDR%
66
@set TESTBUILD=0
77
@set AUTO_UPLOAD_MAP=0
8-
8+
@set ORIGFOLDER=%CD%
99
@rem Store current folder
1010
@set CMD_LC_ROOT=%~dp0
1111

@@ -15,10 +15,12 @@
1515
@title Map Batch Compiler
1616

1717

18+
@set CUSTOMCOMPILERS="%CMD_LC_ROOT%\bin"
1819

1920

20-
21-
21+
@DEL "%CUSTOMCOMPILERS%" /S /Q /F >nul
22+
@xcopy "%sourcesdk%\bin" "%CUSTOMCOMPILERS%" /k/r/e/i/s/c/h/f/o/x/y/q
23+
@xcopy "%CMD_LC_ROOT%extras\compilers" "%CUSTOMCOMPILERS%" /k/r/e/i/s/c/h/f/o/x/y/q
2224

2325
@call build_version.bat 1
2426
@cd /d "%CMD_LC_ROOT%"
@@ -32,6 +34,8 @@
3234
@call config.bat
3335
@cd /d "%CMD_LC_ROOT%"
3436

37+
@del /S /Q "%CMD_LC_ROOT%\bspzip_out.log"
38+
3539
@if "%1"=="b" @goto buildnext
3640
@if "%1"=="B" @goto buildnext
3741
@if "%1"=="r" @goto buildprev
@@ -100,7 +104,7 @@ set TESTBUILD=1
100104

101105
:docopy
102106
@set targetvmf=%mapfolder%\%mapname%.vmf
103-
COPY "%mapfolder%\%mapfile%.vmf" "%targetvmf%"
107+
@COPY "%mapfolder%\%mapfile%.vmf" "%targetvmf%"
104108
@if ERRORLEVEL 1 goto failed
105109

106110

@@ -128,16 +132,9 @@ vmfii "%targetvmf%" "%targetvmf%" --fgd "%FGDS%"
128132
:vbsp
129133
@echo ================= VBSP ====================================================
130134

131-
@set VBSPNAME=vbsp_patched.exe
132-
@%VBSPNAME% >nul 2>nul
133-
@if ERRORLEVEL 9009 goto nopatched
134-
@goto patched
135-
:nopatched
136-
@echo WARNING: vbsp_patched.exe could not be found
137-
@set VBSPNAME=vbsp.exe
138-
:patched
139135

140-
%VBSPNAME% -leaktest -low "%mapfolder%\%mapname%"
136+
137+
"%CUSTOMCOMPILERS%\vbsp.exe" -AllowDynamicPropsAsStatic -leaktest -low "%mapfolder%\%mapname%"
141138
@if ERRORLEVEL 1 goto failed
142139

143140

@@ -146,20 +143,20 @@ vmfii "%targetvmf%" "%targetvmf%" --fgd "%FGDS%"
146143
:vvis
147144
@echo ================= VVIS ====================================================
148145

149-
if not %TESTBUILD%==1 vvis.exe -low "%mapfolder%\%mapname%"
146+
if not %TESTBUILD%==1 "%CUSTOMCOMPILERS%\vvis.exe" -low "%mapfolder%\%mapname%"
150147
@if ERRORLEVEL 1 goto failed
151148

152149

153150
:vrad
154151
:vradldr
155152
@echo ================= VRAD LDR ================================================
156-
if not %TESTBUILD%==1 vrad.exe -low %VRADLDR% -ldr "%mapfolder%\%mapname%"
153+
if not %TESTBUILD%==1 "%CUSTOMCOMPILERS%\vrad.exe" -AllowDynamicPropsAsStatic -AllowDX90VTX -IgnoreModelVersions -low %VRADLDR% -ldr "%mapfolder%\%mapname%"
157154
@if ERRORLEVEL 1 goto failed
158155

159156

160157
:vradhdr
161158
@echo ================= VRAD HDR ================================================
162-
if not %TESTBUILD%==1 vrad.exe -low %VRADHDR% -noskyboxrecurse -hdr "%mapfolder%\%mapname%"
159+
if not %TESTBUILD%==1 "%CUSTOMCOMPILERS%\vrad.exe" -AllowDynamicPropsAsStatic -AllowDX90VTX -IgnoreModelVersions -low %VRADHDR% -noskyboxrecurse -hdr "%mapfolder%\%mapname%"
163160
@if ERRORLEVEL 1 goto failed
164161

165162

@@ -187,7 +184,19 @@ COPY "%mapfolder%\%mapname%.bsp" "%GameDir%\maps\%mapname%.bsp"
187184

188185
:pack
189186
@echo ================= Packing required files to map ===========================
190-
java.exe -jar pakrat.jar -auto "%mapdata%" "%GameDir%\maps\%mapname%.bsp"
187+
@cd /d "%CMD_LC_ROOT%"
188+
extras\reslister.exe "--format=bspzip" "%mapfolder%\%mapname%.vmf" "%mapdata%" "%GameDir%\maps\%mapname%.bsp.reslister"
189+
@if ERRORLEVEL 1 goto failed
190+
@cd "%mapdata%"
191+
bspzip -addlist "%GameDir%\maps\%mapname%.bsp" "%GameDir%\maps\%mapname%.bsp.reslister" "%GameDir%\maps\%mapname%.bsp.new" >> "%CMD_LC_ROOT%\bspzip_out.log"
192+
@if ERRORLEVEL 1 goto failed
193+
@cd /d "%CMD_LC_ROOT%"
194+
195+
@move "%GameDir%\maps\%mapname%.bsp.new" "%GameDir%\maps\%mapname%.bsp.newx"
196+
@if ERRORLEVEL 1 goto failed
197+
@del /Q /F "%GameDir%\maps\%mapname%.bsp"
198+
@if ERRORLEVEL 1 goto failed
199+
move "%GameDir%\maps\%mapname%.bsp.newx" "%GameDir%\maps\%mapname%.bsp"
191200
@if ERRORLEVEL 1 goto failed
192201

193202
:missingcsstf
@@ -202,17 +211,18 @@ java.exe -jar pakrat.jar -auto "%mapdata%" "%GameDir%\maps\%mapname%.bsp"
202211

203212
@cd /d "%CMD_LC_ROOT%"
204213
@call extras\gmodcommander.cmd missing "%mapname%"
205-
@if ERRORLEVEL 1 goto failed
214+
@if ERRORLEVEL 1 goto missingcsstf_fail
206215
@cd /d "%CMD_LC_ROOT%"
207216

217+
@echo Bspzipping the potentially missing
208218

209219
@cd "%GameDir%\data"
210220
bspzip -addlist "%GameDir%\maps\%mapname%.bsp" "%GameDir%\data\addlist.txt" "%GameDir%\maps\%mapname%.bsp.new" >> "%CMD_LC_ROOT%\bspzip_out.log"
211221
@if ERRORLEVEL 1 goto failed
212222

213-
@move "%GameDir%\maps\%mapname%.bsp.new" "%GameDir%\maps\%mapname%.bsp.newx"
223+
move "%GameDir%\maps\%mapname%.bsp.new" "%GameDir%\maps\%mapname%.bsp.newx"
214224
@if ERRORLEVEL 1 goto failed
215-
@del /Q /F "%GameDir%\maps\%mapname%.bsp"
225+
del /Q /F "%GameDir%\maps\%mapname%.bsp"
216226
@if ERRORLEVEL 1 goto failed
217227
move "%GameDir%\maps\%mapname%.bsp.newx" "%GameDir%\maps\%mapname%.bsp"
218228
@if ERRORLEVEL 1 goto failed
@@ -222,6 +232,8 @@ move "%GameDir%\maps\%mapname%.bsp.newx" "%GameDir%\maps\%mapname%.bsp"
222232
@del /Q /F "%GameDir%\data\addlist_src.txt"
223233

224234
@goto missingcsstf_finish
235+
:missingcsstf_fail
236+
echo ">>>>>>> !!!FAILED!!! (non fatal) "
225237
:missingcsstf_skip
226238
echo Skipping...
227239
:missingcsstf_finish
@@ -288,10 +300,10 @@ goto navmesh_end
288300
@start /low /min bzip2 -kf -9 "%GameDir%\maps\graphs\%mapname%.ain"
289301

290302
@set "filename=%GameDir%\maps\%mapname%.nav"
291-
set size=0
303+
@set size=0
292304
@for /f %%A in (%filename%) do set size=%%~zA
293-
@if %size% GTR 2048 @goto navok
294-
@echo NAVMESH GENERATION FAILED
305+
@if %size% GTR 1 @goto navok
306+
@echo "NAVMESH GENERATION FAILED. Size=%size%"
295307
@goto navcskip
296308
:navok
297309
@start /low /min bzip2 -kf -9 "%GameDir%\maps\%mapname%.nav"
@@ -356,4 +368,5 @@ bzip2 -kf -9 "%GameDir%\maps\%mapname%.nav"
356368
@goto gtfo
357369

358370
:gtfo
371+
cd "%ORIGFOLDER%"
359372
@echo.

0 commit comments

Comments
 (0)