-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathgenerate.sh
executable file
·311 lines (278 loc) · 8.51 KB
/
generate.sh
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
#!/bin/bash
# VALIDITY CHECKING
# check wether these exist
if ! test -f "../../tf2_misc_dir.vpk"; then
echo Error: unable to find tf_misc_dir.vpk. Are you sure CleanTF2plus is inside the custom folder?
exit 1
fi
if ! test -f "../../tf2_textures_dir.vpk"; then
echo Error: unable to find tf_textures_dir.vpk. Are you sure CleanTF2plus is inside the custom folder?
exit 1
fi
if ! test -f "../../../hl2/hl2_textures_dir.vpk"; then
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.
exit 1
fi
if ! test -f "../../../bin/vpk_linux32"; then
echo Error: unable to find bin/vpk_linux32. Make sure you\'re not using symbolic links that prevent access to the bin folder, and that CleanTF2plus is inside the custom folder.
exit 1
fi
# DATA
# used variables
# these are set through questions
flat=0
nohats=0
playergibs=0
shells=0
weapongibs=0
surfaceproperties=0
soundscapes=0
mtp=0
# obsolete variables
# to manually enable, set to 1 (Not implemented on Linux)
#overlay=0
#fullbright=0
# QUESTIONS
MTP()
{
echo would you like to add mtp.cfg? Y/N/HELP
read choice
if [ $choice == "Y" ]; then
mtp=1
elif [ $choice == "N" ]; then
echo
elif [ $choice == "HELP" ]; then
echo this sets which maps are affected by pyrovision
MTP
else
echo invalid input
MTP
fi
}
SOUNDSCAPES()
{
echo would you like to remove soundscapes? Y/N/HELP
read choice
if [ $choice == "Y" ]; then
soundscapes=1
MTP
elif [ $choice == "N" ]; then
MTP
elif [ $choice == "HELP" ]; then
echo this removes many world sounds from maps
SOUNDSCAPES
else
echo invalid input
SOUNDSCAPES
fi
}
SURFACEPROPERTIES()
{
echo would you like to add surfaceproperties? Y/N/HELP
read choice
if [ $choice == "Y" ]; then
surfaceproperties=2
SOUNDSCAPES
elif [ $choice == "N" ]; then
SOUNDSCAPES
elif [ $choice == "HELP" ]; then
echo this removes bullet impacts and gets rid of footstep sounds
SURFACEPROPERTIES
else
echo invalid input
SURFACEPROPERTIES
fi
}
WEAPONGIBS()
{
echo would you like to remove weapon gibs? Y/N/HELP
read choice
if [ $choice == "Y" ]; then
weapongibs=1
SURFACEPROPERTIES
elif [ $choice == "N" ]; then
SURFACEPROPERTIES
elif [ $choice == "HELP" ]; then
echo this removes some gibs from certain projectiles
WEAPONGIBS
else
echo invalid input
WEAPONGIBS
fi
}
SHELLS()
{
echo would you like to remove shells from guns? Y/N/HELP
read choice
if [ $choice == "Y" ]; then
shells=1
WEAPONGIBS
elif [ $choice == "N" ]; then
WEAPONGIBS
elif [ $choice == "HELP" ]; then
echo this removes the shells that are ejected from some guns
SHELLS
else
echo invalid input
SHELLS
fi
}
PLAYERGIBS()
{
echo would you like to remove player gibs? Y/N/HELP
read choice
if [ $choice == "Y" ]; then
playergibs=1
SHELLS
elif [ $choice == "N" ]; then
SHELLS
elif [ $choice == "HELP" ]; then
echo this removes the flying body parts when people explode
PLAYERGIBS
else
echo invalid input
PLAYERGIBS
fi
}
NOHATS_GEN()
{
echo would you like to keep heads and feet? Y/N/HELP
read choice
if [ $choice == "Y" ]; then
nohats=2
elif [ $choice == "N" ]; then
nohats=1
elif [ $choice == "HELP" ]; then
echo this keeps cosmetics that replace parts of the body so they aren\'t invisible
NOHATS_GEN
else
echo invalid input
NOHATS_GEN
fi
}
NOHATS()
{
echo would you like to remove hats? Y/N/HELP
read choice
if [ $choice == "Y" ]; then
NOHATS_GEN
PLAYERGIBS
elif [ $choice == "N" ]; then
PLAYERGIBS
elif [ $choice == "HELP" ]; then
echo this removes all hats and cosmetics from players
NOHATS
else
echo invalid input
NOHATS
fi
}
FLAT_GEN()
{
echo would you like flat textures resized? Y/N/HELP
read choice
if [ $choice == "Y" ]; then
flat=2
elif [ $choice == "N" ]; then
flat=1
elif [ $choice == "HELP" ]; then
echo resized flat textures appear mostly flat on sv_pure, non-resized appears as stock tf2 textures
FLAT_GEN
else
echo invalid input
FLAT_GEN
fi
}
FLAT()
{
echo would you like flat materials? Y/N/HELP
read choice
if [ $choice == "Y" ]; then
FLAT_GEN
NOHATS
elif [ $choice == "N" ]; then
NOHATS
elif [ $choice == "HELP" ]; then
echo flat materials make all world textures one solid color, also known as quake textures
FLAT
else
echo invalid input
FLAT
fi
}
FLAT
# GENERATION
rm dev/current_options.txt > /dev/null 2>&1
if [ $flat == 1 ]; then
echo generating flat textures
dev/generators/textures_flat.sh dev/lists/linux/flat.txt "../../tf2_textures_dir.vpk"
dev/generators/textures_flat.sh dev/lists/linux/flat_hl2.txt "../../../hl2/hl2_textures_dir.vpk"
echo flat textures \(unresized\) >> dev/current_options.txt
echo done
elif [ $flat == 2 ]; then
echo generating flat textures
dev/generators/textures_flat.sh dev/lists/linux/flat.txt "../../tf2_textures_dir.vpk" 1
dev/generators/textures_flat.sh dev/lists/linux/flat_hl2.txt "../../../hl2/hl2_textures_dir.vpk" 1
echo flat textures \(resized\) >> dev/current_options.txt
echo done
fi
if [ $nohats == 1 ]; then
echo removing hats
dev/generators/models_null.sh dev/lists/linux/nohats.txt "dev/linux/vpk.sh" "../../tf2_misc_dir.vpk"
dev/generators/remove.sh dev/lists/linux/nohats_weapons.txt
echo nohats >> dev/current_options.txt
echo done
elif [ $nohats == 2 ]; then
echo removing hats headsfeet
dev/generators/models_null.sh dev/lists/linux/nohats.txt "dev/linux/vpk.sh" "../../tf2_misc_dir.vpk"
dev/generators/remove.sh dev/lists/linux/nohats_headsfeet.txt
dev/generators/remove.sh dev/lists/linux/nohats_weapons.txt
echo nohats headsfeet >> dev/current_options.txt
echo done
fi
if [ $playergibs == 1 ]; then
echo removing player gibs
dev/generators/models_null.sh dev/lists/linux/model_removal_gibs_player.txt "dev/linux/vpk.sh" "../../tf2_misc_dir.vpk"
echo no player gibs >> dev/current_options.txt
echo done
fi
if [ $shells == 1 ]; then
echo removing shell models
dev/generators/models_null.sh dev/lists/linux/model_removal_shells.txt "dev/linux/vpk.sh" "../../tf2_misc_dir.vpk"
echo no shells >> dev/current_options.txt
echo done
fi
if [ $weapongibs == 1 ]; then
echo removing weapon gibs
dev/generators/models_null.sh dev/lists/linux/model_removal_gibs_weapons.txt "dev/linux/vpk.sh" "../../tf2_misc_dir.vpk"
echo no weapon gibs >> dev/current_options.txt
echo done
fi
if [ $surfaceproperties == 1 ]; then
echo adding surfaceproperties
dev/generators/scripts_copy.sh surfaceproperties_manifest.txt scripts
dev/generators/scripts_find_and_replace.sh surfaceproperties.txt "REPLACEME" "SolidMetal.StepLeft"
echo empty surface properties \(metal footseteps\) >> dev/current_options.txt
echo done
elif [ $surfaceproperties == 2 ]; then
echo adding surfaceproperties
dev/generators/scripts_copy.sh surfaceproperties_manifest.txt scripts
dev/generators/scripts_find_and_replace.sh surfaceproperties.txt "REPLACEME" " "
echo empty surface properties \(no footseteps\) >> dev/current_options.txt
echo done
fi
if [ $soundscapes == 1 ]; then
echo removing soundscapes
dev/generators/scripts_copy.sh soundscapes_manifest.txt scripts
echo no soundscapes >> dev/current_options.txt
echo done
fi
if [ $mtp == 1 ]; then
echo adding mtp.cfg
dev/generators/scripts_copy.sh mtp.cfg cfg
echo no pyrovision textures >> dev/current_options.txt
echo done
fi
# DELETE TGA FILES TO REDUCE VPK SIZE
find materials/ -name "*.tga" -type f -delete
echo thank you for using Clean TF2+