forked from JarateKing/CleanTF2plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate.bat
More file actions
197 lines (176 loc) · 6.78 KB
/
Copy pathgenerate.bat
File metadata and controls
197 lines (176 loc) · 6.78 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
@ECHO OFF
:: VALIDITY CHECKING
:: check whether these exist
IF NOT EXIST "..\..\tf2_misc_dir.vpk" (goto :ERR_MISSING_MISC_DIR)
IF NOT EXIST "..\..\tf2_textures_dir.vpk" (goto :ERR_MISSING_TEX_DIR)
IF NOT EXIST "..\..\..\hl2\hl2_textures_dir.vpk" (goto :ERR_MISSING_HL2_DIR)
IF NOT EXIST "..\..\..\bin\vpk.exe" (goto :ERR_MISSING_VPK_EXE)
:: skip past all the error messages if they do exist
goto :NO_ERRORS
:ERR_MISSING_MISC_DIR
echo Error: unable to find tf_misc_dir.vpk. Are you sure CleanTF2plus is inside the custom folder?
goto :DONE
:ERR_MISSING_TEX_DIR
echo Error: unable to find tf_textures_dir.vpk. Are you sure CleanTF2plus is inside the custom folder?
goto :DONE
:ERR_MISSING_HL2_DIR
echo Error: unable to find hl2 vpk's. Make sure you're not using symbolic links that prevent access to the hl2 folder, and that CleanTF2plus is inside the custom folder.
goto :DONE
:ERR_MISSING_VPK_EXE
echo Error: unable to find bin/vpk.exe. Make sure you're not using symbolic links that prevent access to the bin folder, and that CleanTF2plus is inside the custom folder.
goto :DONE
:NO_ERRORS
:: DATA
:: used variables
:: these are set through questions
set "flat=0"
set "nohats=0"
set "playergibs=0"
set "shells=0"
set "weapongibs=0"
set "surfaceproperties=0"
set "soundscapes=0"
set "mtp=0"
:: obsolete variables
:: to manually enable, set to 1
set "overlay=0"
set "fullbright=0"
:: QUESTIONS
:FLAT
set /P c=would you like flat materials? Y/N/Help
if /I "%c%" EQU "Y" goto :FLAT_GEN
if /I "%c%" EQU "N" goto :NOHATS
if /I "%c%" EQU "HELP" (echo flat materials make all world textures one solid color, also known as quake textures) else (echo invalid input)
goto :FLAT
:FLAT_GEN
set /P c=would you like flat textures resized? Y/N/Help
if /I "%c%" EQU "Y" goto :FLAT_GEN_RESIZED
if /I "%c%" EQU "N" goto :FLAT_GEN_STANDARD
if /I "%c%" EQU "HELP" (echo resized flat textures appear mostly flat on sv_pure, non-resized appears as stock tf2 textures) else (echo invalid input)
goto :FLAT_GEN
:FLAT_GEN_STANDARD
set "flat=1"
goto :END
:FLAT_GEN_RESIZED
set "flat=2"
goto :END
:: GENERATION
:END
del dev\current_options.txt > nul 2> nul
if %flat% EQU 1 (
echo generating flat textures
call dev\generators\textures_flat.bat dev\lists\flat.txt "../../tf2_textures_dir.vpk"
call dev\generators\textures_flat.bat dev\lists\flat_hl2.txt "../../../hl2/hl2_textures_dir.vpk"
echo "flat textures (unresized)" >> dev\current_options.txt
echo done
)
if %flat% EQU 2 (
echo generating flat textures
call dev\generators\textures_flat.bat dev\lists\flat.txt "../../tf2_textures_dir.vpk" 1
call dev\generators\textures_flat.bat dev\lists\flat_hl2.txt "../../../hl2/hl2_textures_dir.vpk" 1
echo "flat textures (resized)" >> dev\current_options.txt
echo done
)
if %overlay% EQU 1 (
echo removing overlay materials
call dev\generators\textures_nodraw.bat dev\lists\nodraw.txt
call dev\generators\scripts_copy.bat extra_models.txt scripts
echo "no overlays" >> dev\current_options.txt
echo done
)
if %nohats% EQU 1 (
echo removing hats
call dev\generators\models_null.bat dev\lists\nohats.txt "../../../bin/vpk.exe" "../../tf2_misc_dir.vpk"
call dev\generators\remove.bat dev\lists\nohats_weapons.txt
echo "nohats" >> dev\current_options.txt
echo done
)
if %nohats% EQU 2 (
echo removing hats headsfeet
call dev\generators\models_null.bat dev\lists\nohats.txt "../../../bin/vpk.exe" "../../tf2_misc_dir.vpk"
call dev\generators\remove.bat dev\lists\nohats_headsfeet.txt
call dev\generators\remove.bat dev\lists\nohats_weapons.txt
echo "nohats headsfeet" >> dev\current_options.txt
echo done
)
if %playergibs% EQU 1 (
echo removing player gibs
call dev\generators\models_null.bat dev\lists\model_removal_gibs_player.txt "../../../bin/vpk.exe" "../../tf2_misc_dir.vpk"
echo "no player gibs" >> dev\current_options.txt
echo done
)
if %shells% EQU 1 (
echo removing shell models
call dev\generators\models_null.bat dev\lists\model_removal_shells.txt "../../../bin/vpk.exe" "../../tf2_misc_dir.vpk"
echo "no shells" >> dev\current_options.txt
echo done
)
if %weapongibs% EQU 1 (
echo removing weapon gibs
call dev\generators\models_null.bat dev\lists\model_removal_gibs_weapons.txt "../../../bin/vpk.exe" "../../tf2_misc_dir.vpk"
echo "no weapon gibs" >> dev\current_options.txt
echo done
)
if %surfaceproperties% EQU 1 (
echo adding surfaceproperties
call dev\generators\scripts_copy.bat surfaceproperties_manifest.txt scripts
call dev\generators\scripts_find_and_replace.bat surfaceproperties.txt "REPLACEME" "SolidMetal.StepLeft"
echo "empty surface properties (metal footsteps)" >> dev\current_options.txt
echo done
)
if %surfaceproperties% EQU 2 (
echo adding surfaceproperties
call dev\generators\scripts_copy.bat surfaceproperties_manifest.txt scripts
call dev\generators\scripts_find_and_replace.bat surfaceproperties.txt "REPLACEME" " "
echo "empty surface properties (no footsteps)" >> dev\current_options.txt
echo done
)
if %soundscapes% EQU 1 (
echo removing soundscapes
call dev\generators\scripts_copy.bat soundscapes_manifest.txt scripts
echo "no soundscapes" >> dev\current_options.txt
echo done
)
if %mtp% EQU 1 (
echo adding mtp.cfg
call dev\generators\scripts_copy.bat mtp.cfg cfg
echo "no pyrovision textures" >> dev\current_options.txt
echo done
)
if %fullbright% EQU 1 (
echo applying fullbright
call dev\generators\materials_fullbright.bat dev\lists\fullbright.txt "../../tf2_misc_dir.vpk"
call dev\generators\materials_fullbright.bat dev\lists\fullbright_hl2.txt "../../../hl2/hl2_misc_dir.vpk"
echo "fullbright" >> dev\current_options.txt
echo done
)
:: --- EXCLUSIONS ---
echo removing exclusions...
del "materials\metal\chicken_wire001.vtf" /Q
del "materials\metal\metalgrate013a.vtf" /Q
del "materials\glass\glasswindow_distorted001.vtf" /Q
del "materials\glass\glasswindow001a.vtf" /Q
del "materials\glass\glasswindow001b.vtf" /Q
del "materials\glass\glasswindow002a.vtf" /Q
del "materials\glass\glasswindow002b.vtf" /Q
del "materials\glass\glasswindow002c.vtf" /Q
del "materials\glass\glasswindow003a.vtf" /Q
del "materials\glass\glasswindow004a.vtf" /Q
del "materials\glass\glasswindow005a.vtf" /Q
del "materials\glass\glasswindow006_mask.vtf" /Q
del "materials\glass\glasswindow006a.vtf" /Q
del "materials\glass\glasswindow007.vtf" /Q
del "materials\metal\metalgrate011a.vtf" /Q
del "materials\metal\metalgrate011b.vtf" /Q
del "materials\moon\moonbase_grate001.vtf" /Q
del "materials\glass\glasswindow007.vtf" /Q
del "materials\soho\metalgrate001.vtf" /Q
del "materials\swamp\props\fishingnet001.vtf" /Q
del "materials\swamp\props\fishingnet002.vtf" /Q
del "materials\egypt\barbed_wire_fence_01.vtf" /Q
:: -------------------------------
:DONE
:: DELETE TGA FILES TO REDUCE VPK SIZE
del /S materials/*.tga
echo thank you for using Clean TF2+
pause