-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extract_game_files.sh
executable file
·100 lines (78 loc) · 3.44 KB
/
extract_game_files.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
#!/bin/bash
if [ ! -f DepotDownloader ]; then
wget https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_2.7.3/DepotDownloader-linux-x64.zip -O DepotDownloader-linux-x64.zip
unzip -o DepotDownloader-linux-x64.zip DepotDownloader && rm DepotDownloader-linux-x64.zip
fi
if [ ! -f Decompiler ]; then
wget https://github.com/ValveResourceFormat/ValveResourceFormat/releases/download/10.2/Decompiler-linux-x64.zip -O Decompiler-linux-x64.zip
unzip -o Decompiler-linux-x64.zip && rm Decompiler-linux-x64.zip
fi
# Download Deadlock Game files
./DepotDownloader -app 1422450 -username "$STEAM_USERNAME" -password "$STEAM_PASSWORD" || exit 1
mkdir -p depots/game
rsync -av --remove-source-files depots/*/*/game/* depots/game/
find depots/ -type d -empty -delete
# Extract Map-VPKs
maps_folder="depots/game/citadel/maps"
citadel_folder="depots/game/citadel"
for vpk_file in $(find "$maps_folder" -type f -name "*.vpk"); do
echo "Extracting $(basename vpk_file)"
# TODO: Decompile only required files
./Decompiler -i "$vpk_file" -d --threads 8 -o "$citadel_folder"
echo "Removing VPK file"
rm "$vpk_file"
done
# Extract non-chunked VPK files
for vpk_file in $(find depots -type f -name "*.vpk"); do
parent_dir=$(dirname "$vpk_file")
echo "Extracting $(basename vpk_file)"
# TODO: Decompile only required files
./Decompiler -i "$vpk_file" -d --threads 8 -o "$parent_dir"
echo "Removing VPK file"
rm "$vpk_file"
done
# Extract Steam Info
mkdir -p res
cp "$citadel_folder"/steam.inf res/
# Extract vData files
mkdir -p vdata
cp "$citadel_folder"/scripts/abilities.vdata vdata/
cp "$citadel_folder"/scripts/heroes.vdata vdata/
cp "$citadel_folder"/scripts/generic_data.vdata vdata/
# Extract localization files
mkdir -p localization
cp -r "$citadel_folder"/resource/localization/citadel_gc/* localization/
cp -r "$citadel_folder"/resource/localization/citadel_heroes/* localization/
cp -r "$citadel_folder"/resource/localization/citadel_main/* localization/
# Extract video files
mkdir -p videos
cp -r "$citadel_folder"/panorama/videos/hero_abilities videos/
for video_file in $(find videos -type f -name "*.webm"); do
video_mp4_file=$(echo "$video_file" | sed 's/.webm/_h264.mp4/')
echo "Converting $video_file to $video_mp4_file"
ffmpeg -i "$video_file" -c:v libx264 -crf 23 -y "$video_mp4_file"
done
# Extract css files
cp "$citadel_folder"/panorama/styles/objectives_map.css res/
cp "$citadel_folder"/panorama/styles/citadel_shared_colors.css res/
# Extract image files
mkdir -p images
mkdir -p images/hud
cp -r "$citadel_folder"/panorama/images/heroes images/
cp -r "$citadel_folder"/panorama/images/hud/*.png images/hud/
cp "$citadel_folder"/panorama/images/hud/hero_portraits/* images/heroes/
cp -r "$citadel_folder"/panorama/images/hud/hero_portraits images/hud/
mkdir -p images/abilities
cp -r "$citadel_folder"/panorama/images/hud/abilities images/
cp -r "$citadel_folder"/panorama/images/upgrades images/
mkdir -p images/maps
cp -r "$citadel_folder"/panorama/images/minimap/base/* images/maps/
# Extract chunked VPK files
for chunked_vpk_file in $(find depots -type f -name "*_dir.vpk"); do
parent_dir=$(dirname "$chunked_vpk_file")
echo "Extracting $(basename chunked_vpk_file)"
# TODO: Decompile only required files
./Decompiler -i "$chunked_vpk_file" -d --threads 8 -o "$parent_dir"
echo "Removing chunk files"
rm "$parent_dir/$(basename "$chunked_vpk_file" | cut -c1-5)"*
done