Skip to content

Commit

Permalink
Only support GMod x64 build tools (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
Python1320 committed Feb 24, 2020
1 parent b543d2d commit 85ca236
Show file tree
Hide file tree
Showing 39 changed files with 95 additions and 808 deletions.
2 changes: 1 addition & 1 deletion GO mapfolder.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@cd /d "%~dp0"
@call config.bat
@call common.cmd
@explorer "%mapfolder%"
2 changes: 1 addition & 1 deletion GO sourcesdk_bin.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@cd /d "%~dp0"
@call config.bat
@call common.cmd
@explorer "%sourcesdk%\bin\"
2 changes: 1 addition & 1 deletion LAUNCH commandline.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@cd /d "%~dp0"
@call config.bat
@call common.cmd
@cd /d "%~dp0"
@echo Loaded map compiler environment
@cmd
2 changes: 1 addition & 1 deletion LAUNCH compile NOW.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@cd /d "%~dp0"
@call config.bat
@call common.cmd
@cd /d "%~dp0"
@call "LAUNCH compile.cmd" b
43 changes: 19 additions & 24 deletions LAUNCH compile.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,25 @@
@set ORIGFOLDER=%CD%
@rem Store current folder
@set CMD_LC_ROOT=%~dp0
@set bspzipexe=bspzip

@cd /d "%CMD_LC_ROOT%"
@call config.bat
@call common.cmd
@cd /d "%CMD_LC_ROOT%"
@title Map Batch Compiler

@set compilers_dir=%sourcesdk%\bin

@set CUSTOMCOMPILERS="%CMD_LC_ROOT%bin"


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

@call build_version.bat 1
@call build_version.cmd 1
@cd /d "%CMD_LC_ROOT%"
@call config.bat
@call common.cmd
@cd /d "%CMD_LC_ROOT%"
@echo Version to build: %BUILD_VERSION%
@echo In: %mapfile%.vmf
@echo Out: %mapname%.bsp
@call build_version.bat -1
@call build_version.cmd -1
@cd /d "%CMD_LC_ROOT%"
@call config.bat
@call common.cmd
@cd /d "%CMD_LC_ROOT%"

@del /S /Q "%CMD_LC_ROOT%\bspzip_out.log"
Expand Down Expand Up @@ -71,16 +66,16 @@ set TESTBUILD=1

:buildnext
@cd /d "%CMD_LC_ROOT%"
@call build_version.bat 1
@call build_version.cmd 1
@cd /d "%CMD_LC_ROOT%"
@call config.bat
@call common.cmd
@cd /d "%CMD_LC_ROOT%"


@goto dobuild

:buildprev
@call build_version.bat
@call build_version.cmd
@cd /d "%CMD_LC_ROOT%"
@echo Rebuilding version %BUILD_VERSION%.
@goto dobuild
Expand Down Expand Up @@ -116,7 +111,7 @@ set TESTBUILD=1

:vmfii
@echo ================= VMF Merging =================
vmfii "%targetvmf%" "%targetvmf%" --fgd "%FGDS%"
extras\vmfii "%targetvmf%" "%targetvmf%" --fgd "%FGDS%"
@if ERRORLEVEL 1 goto failed


Expand All @@ -133,8 +128,8 @@ vmfii "%targetvmf%" "%targetvmf%" --fgd "%FGDS%"
@echo ================= VBSP ====================================================



"%CUSTOMCOMPILERS%\vbsp.exe" -AllowDynamicPropsAsStatic -leaktest -low "%mapfolder%\%mapname%"
@echo VProject %VProject%
"%compilers_dir%\vbsp.exe" -allowdynamicpropsasstatic -leaktest -low "%mapfolder%\%mapname%"
@if ERRORLEVEL 1 goto failed


Expand All @@ -143,7 +138,7 @@ vmfii "%targetvmf%" "%targetvmf%" --fgd "%FGDS%"
:vvis
@echo ================= VVIS ====================================================

if not %TESTBUILD%==1 "%CUSTOMCOMPILERS%\vvis.exe" -low "%mapfolder%\%mapname%"
if not %TESTBUILD%==1 "%compilers_dir%\vvis.exe" -low "%mapfolder%\%mapname%"
@if ERRORLEVEL 1 goto failed


Expand All @@ -153,13 +148,13 @@ if not %TESTBUILD%==1 "%CUSTOMCOMPILERS%\vvis.exe" -low "%mapfolder%\%mapname%"

:vradldr
@echo ================= VRAD LDR ================================================
if not %TESTBUILD%==1 "%CUSTOMCOMPILERS%\vrad.exe" -AllowDynamicPropsAsStatic -AllowDX90VTX -IgnoreModelVersions -low %VRADLDR% -ldr "%mapfolder%\%mapname%"
if not %TESTBUILD%==1 "%compilers_dir%\vrad.exe" -low %VRADLDR% -noskyboxrecurse -ldr "%mapfolder%\%mapname%"
@if ERRORLEVEL 1 goto failed


:vradhdr
@echo ================= VRAD HDR ================================================
if not %TESTBUILD%==1 "%CUSTOMCOMPILERS%\vrad.exe" -AllowDynamicPropsAsStatic -AllowDX90VTX -IgnoreModelVersions -low %VRADHDR% -noskyboxrecurse -hdr "%mapfolder%\%mapname%"
if not %TESTBUILD%==1 "%compilers_dir%\vrad.exe" -low %VRADHDR% -noskyboxrecurse -hdr "%mapfolder%\%mapname%"
@if ERRORLEVEL 1 goto failed


Expand Down Expand Up @@ -191,7 +186,7 @@ COPY "%mapfolder%\%mapname%.bsp" "%GameDir%\maps\%mapname%.bsp"
extras\reslister.exe "--format=bspzip" "%mapfolder%\%mapname%.vmf" "%mapdata%" "%GameDir%\maps\%mapname%.bsp.reslister"
@if ERRORLEVEL 1 goto failed
@cd "%mapdata%"
bspzip -addlist "%GameDir%\maps\%mapname%.bsp" "%GameDir%\maps\%mapname%.bsp.reslister" "%GameDir%\maps\%mapname%.bsp.new" >> "%CMD_LC_ROOT%\bspzip_out.log"
"%bspzipexe%" -addlist "%GameDir%\maps\%mapname%.bsp" "%GameDir%\maps\%mapname%.bsp.reslister" "%GameDir%\maps\%mapname%.bsp.new" >> "%CMD_LC_ROOT%\bspzip_out.log"
@if ERRORLEVEL 1 goto failed
@cd /d "%CMD_LC_ROOT%"

Expand Down Expand Up @@ -220,7 +215,7 @@ move "%GameDir%\maps\%mapname%.bsp.newx" "%GameDir%\maps\%mapname%.bsp"
@echo Bspzipping the potentially missing

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

move "%GameDir%\maps\%mapname%.bsp.new" "%GameDir%\maps\%mapname%.bsp.newx"
Expand Down Expand Up @@ -249,7 +244,7 @@ move "%GameDir%\maps\%mapname%.bsp.newx" "%GameDir%\maps\%mapname%.bsp"
@if not exist "%mapfolder%\%mapfile%.bspzip" @goto extrabspzip_skip

@cd "%mapdata%"
bspzip -addlist "%GameDir%\maps\%mapname%.bsp" "%mapfolder%\%mapfile%.bspzip" "%GameDir%\maps\%mapname%.bsp.new"
"%bspzipexe%" -addlist "%GameDir%\maps\%mapname%.bsp" "%mapfolder%\%mapfile%.bspzip" "%GameDir%\maps\%mapname%.bsp.new"
@rem >> "%CMD_LC_ROOT%\bspzip_out.log"
@if ERRORLEVEL 1 goto failed

Expand Down
2 changes: 1 addition & 1 deletion LAUNCH game.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@call config.bat
@call common.cmd
cd /D %GameExeDir%
hl2.exe -game %SteamGame% %*
2 changes: 1 addition & 1 deletion LAUNCH hammer map.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@cd /d "%~dp0"
@call config.bat
@call common.cmd

@call "LAUNCH hammer.cmd" "%mapfolder%\%mapfile%.vmf"
13 changes: 5 additions & 8 deletions LAUNCH hammer.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@cd /d "%~dp0"
@call config.bat
@call common.cmd

@echo Tweaking max draw distances...
reg ADD "HKCU\Software\Valve\Hammer\3D Views" /v BackPlane /t REG_DWORD /d 20000 /f
Expand All @@ -8,13 +8,10 @@ reg ADD "HKCU\Software\Valve\Hammer\3D Views" /v DetailDistance /t REG_DWORD /d
reg ADD "HKCU\Software\Valve\Hammer\2D Views" /v RotateConstrain /t REG_DWORD /d 1 /f
reg ADD "HKCU\Software\Valve\Hammer\Splitter" /v "DrawType0,0" /t REG_DWORD /d 9 /f

@cd /D "%sourcesdk%\bin"
@set SteamAppId=243750
@set SteamGameId=211
@set VProject=%VProject_Hammer%
@rem @set VProject=%VProject_Hammer%

@echo Project: %VProject%
@rem @echo Project: %VProject%

start hammer.exe %HammerParams% %* -dxlevel 96
start "Hammer" "%VProject_Hammer%\..\bin\hammer.exe" %HammerParams% %*

@ping 127.0.0.1 -n 3 > nul
@ping 127.0.0.1 -n 6 > nul
31 changes: 25 additions & 6 deletions LAUNCH propperall.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,29 @@
@set CMD_LC_ROOT=%~dp0

@cd /d "%CMD_LC_ROOT%"
@call config.bat
@call common.cmd
@cd /d "%CMD_LC_ROOT%"
@title Propper Batch Compiler

@set QC_STORAGE=%mapfolder%\propper
@set VBSPNAME=vbsp_propper
@call config.bat
@mkdir "%QC_STORAGE%" >nul 2>nul

@set VBSPNAME=%CMD_LC_ROOT%\extras\propper\bin\vbsp_propper.exe
@set PROPPER_TARGET=%mapdata%


@call common.cmd
@cd /d "%CMD_LC_ROOT%"

@set GameDir=%CMD_LC_ROOT%\game_compiling\garrysmod
@set GameExeDir=%CMD_LC_ROOT%\game_compiling
@set sourcesdk=%CMD_LC_ROOT%\game_compiling

@set PATH=%CMD_LC_ROOT%\extras\propper\bin;%PATH%
@%VBSPNAME% >nul 2>nul
@if ERRORLEVEL 9009 goto nofound


@goto found


Expand All @@ -25,10 +37,17 @@
@cd /d "%mapfolder%\propper"
@echo.
@for /r %%i in (*.vmf) do @(
@echo Processing %%i
@%VBSPNAME% %%i > "%%i.log"
@echo Processing %%i Log: %%i.log
%VBSPNAME% %%i 1>"%%i.log"
@if ERRORLEVEL 1 goto failed
)
@if ERRORLEVEL 1 goto failed

@echo "====== Copying files also for hammer usage ======="
ROBOCOPY "%GameDir%\materials\models\mspropp" "%PROPPER_TARGET%\materials\models\mspropp" /MOV /s /NFL /NDL /NJS /NJH /NP /is /it
ROBOCOPY "%GameDir%\models\props\metastruct" "%PROPPER_TARGET%\models\props\metastruct" /MOV /s /NFL /NDL /NJS /NJH /NP /is /it



@goto win


Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,3 @@ game_hammer/gameinfo.txt:

tf2_misc is a folder where tf_misc has been extracted with GCFScape and from materials folder the "backpack" folder has been removed. Something else may need to be removed in the future.




Metastruct specific
-----
The map files are in read-only mode.
This is to prevent unmergeable changes. To make it writeable again, lock it.
After doing your changes, commit them and unlock the file again.
You can read more about this in the svn book, section "Locking" (you should already know this !!):
http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.advanced.locking
File renamed without changes.
15 changes: 9 additions & 6 deletions config.bat → common.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

@call user_config.cmd

@call "%~d0%~p0\build_version.bat"
@call "%~d0%~p0\build_version.cmd"

@rem input vmf
@set mapfile=metastruct_3
Expand Down Expand Up @@ -62,18 +62,21 @@
@set FGDS=%sourcesdk%\bin\base.fgd,%sourcesdk%\bin\halflife2.fgd,%mapfolder%\metastruct.fgd

@rem REQUIRED configuration folder, needs gameinfo.txt at least
@set VProject=%~d0%~p0
@set VProject_Hammer=%VProject%game_hammer
@set VProject=%VProject%game_compiling
@set toolkit_root=%~d0%~p0
@set VProject_Hammer=%toolkit_root%\game_hammer\garrysmod
@set VProject=%toolkit_root%\game_compiling\garrysmod
@set compilers_dir=%toolkit_root%\game_compiling\bin\win64

@IF EXIST "%VProject_Hammer%"\gameinfo.txt @GOTO VProject_Hammer_fixskip

@IF EXIST "%VProject_Hammer%\gameinfo.txt" @GOTO VProject_Hammer_fixskip
@set VProject_Hammer=%VProject%
@echo Missing %VProject_Hammer%\gameinfo.txt
:VProject_Hammer_fixskip


@call user_config.cmd


@rem Where garrysmod locates
@set GameDir=%SteamPath%\steamapps\common\GarrysMod\garrysmod
@set GameExeDir=%SteamPath%\steamapps\common\GarrysMod
Expand Down Expand Up @@ -105,7 +108,7 @@
@IF NOT EXIST "%TESTPATH%" @GOTO fail
@set TESTPATH=%GameExeDir%\bin
@IF NOT EXIST "%TESTPATH%" @GOTO fail
@set TESTPATH=%GameDir%\bin
@set TESTPATH=%GameDir%\addons
@IF NOT EXIST "%TESTPATH%" @GOTO fail
@set TESTPATH=%GameDir%\maps
@IF NOT EXIST "%TESTPATH%" @GOTO fail
Expand Down
Loading

0 comments on commit 85ca236

Please sign in to comment.