-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.bat
134 lines (124 loc) · 3.3 KB
/
setup.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
@echo off
setlocal enabledelayedexpansion
FOR /f "tokens=1,2*" %%E in ('reg query "HKEY_CURRENT_USER\Software\Valve\Steam"') DO (
IF "%%E"=="SteamPath" (
set SteamPath=%%G
)
)
IF "%SteamPath%"=="" (
echo Not able to determine Steam install path. Make sure you have Steam installed
pause
exit /B
)
IF "%sourcesdk%"=="" (
echo SourceSDK environment variable is not set. Run Source SDK once before executing this script
pause
exit /B
)
for /F "usebackq tokens=*" %%L in ("%SteamPath%\steamapps\libraryfolders.vdf") do (
for /F "tokens=1*" %%A in ("%%L") do (
if "%%B" NEQ "" (
if "%%~A" EQU "path" (
set "CurPath=%%~B"
set "CurPath=!CurPath:\\=\!"
)
:: 253530 is the FF appid
if "%%~A" EQU "253530" (
set "GameDir=!CurPath!/steamapps/common/Fortress Forever"
)
)
)
)
IF "%GameDir%"=="" (
echo "%SteamPath%\steamapps\libraryfolders.vdf" does not contain FF's appid. Make sure Fortress Forever is installed
pause
exit /B
)
set ModDir=%GameDir%/FortressForever
IF NOT EXIST "%GameDir%" (
echo "%GameDir%" does not exist. Make sure Fortress Forever is installed
pause
exit /B
)
set Ep1BinDir=%sourcesdk%\bin\ep1\bin
set ConfigFile=%Ep1BinDir%\GameConfig.txt
set SchemeDir=%Ep1BinDir%\resource
set SchemeFile=%SchemeDir%\SourceScheme.res
set GameInfoDir=%GameDir%/sdk
set GameInfoFile=%GameInfoDir%/gameinfo.txt
echo(
echo Writing "%ConfigFile%"...
(
echo "Configs"
echo {
echo "SDKVersion" "2"
echo "Games"
echo {
echo "Fortress Forever"
echo {
echo "GameDir" "%GameDir%/sdk"
echo "hammer"
echo {
echo "GameData0" "%ModDir%/fortressforever.fgd"
echo "TextureFormat" "5"
echo "MapFormat" "4"
echo "DefaultTextureScale" "0.250000"
echo "DefaultLightmapScale" "16"
echo "GameExe" "%GameDir%/hl2.exe"
echo "DefaultSolidEntity" "func_detail"
echo "DefaultPointEntity" "info_ff_script"
echo "BSP" "%Ep1BinDir%\vbsp.exe"
echo "Vis" "%Ep1BinDir%\vvis.exe"
echo "Light" "%Ep1BinDir%\vrad.exe"
echo "GameExeDir" "%GameDir%"
echo "MapDir" "%ModDir%/mapsrc"
echo "BSPDir" "%ModDir%/maps"
echo "CordonTexture" "tools\toolsskybox"
echo "MaterialExcludeCount" "0"
echo }
echo }
echo }
echo }
) >"%ConfigFile%"
echo -^> Done
IF NOT EXIST "%GameInfoDir%" mkdir "%GameInfoDir%"
echo(
echo Writing "%GameInfoFile%"...
(
echo "GameInfo"
echo {
echo game "Fortress Forever"
echo title "Fortress Forever"
echo name "Fortress Forever"
echo type multiplayer_only
echo(
echo FileSystem
echo {
echo SteamAppId 215
echo ToolsAppId 211
echo SearchPaths
echo {
echo Game ^|gameinfo_path^|..\FortressForever
echo Game ^|gameinfo_path^|..\hl2
echo Game ^|gameinfo_path^|..\platform
echo }
echo }
echo }
) > "%GameInfoFile%"
echo -^> Done
:: Need a SourceScheme.res in bin/ep1/bin/resource so that Hammer doesn't throw
:: a 'Failed to load the default scheme file' error
:: The contents of this scheme file are unimportant; it can be totally blank
echo(
echo Writing "%SchemeFile%"...
IF NOT EXIST "%SchemeFile%" (
IF NOT EXIST "%SchemeDir%" mkdir "%SchemeDir%"
echo( >"%SchemeFile%"
echo -^> Done
) ELSE (
echo -^> File already exists
)
echo(
echo Source SDK setup completed successfully.
echo(
pause