/
Quake Mission Pack 5 (dopa).sh
108 lines (96 loc) · 5.15 KB
/
Quake Mission Pack 5 (dopa).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
#!/bin/bash
# +------------------------------------------------------------------------------------+
# | Launch Quake with addons hipnotic, rogue, dopa and other packs rel. 07/09/17 |
# | Prerequisites: |
# | 1. Registered Version of QUAKE in v.1.06 or 1.08 |
# | 2. Mission Pack 1 - Scourge of Armagon aka hipnotic |
# | 3. Mission Pack 2 - Dissolution of Eternity aka rogue |
# | 4. Episode 5 - Dimension of the Past (20th years anniversary of QUAKE) |
# | 5. Raspberry Pie with RetroPie and libretro-tyrquake installed |
# | 6. Working zip! If not type "sudo apt install zip" |
# | |
# | Episode 5 - Dimension of the Past is released for free at |
# | https://cdn.bethsoft.com/quake/dopa.rar |
# +------------------------------------------------------------------------------------+
# | |
# | Why: |
# | I wasn't able to run HIPNOTIC and ROGUE as descriped in the wiki |
# | |
# | How to: |
# | In your base folder ~/RetroPie/roms/quake/id1/ are two files pak0.pak and pak1.pak |
# | these are the base files for QUAKE. |
# | |
# | Now, against the wiki recommendation copy all pak file to base files of quake. |
# | Rename hipnotic/pak0.pak to hipnotic.pak and copy to base files of quake/id1/ |
# | Rename rogue/pak0.pak to rogue.pak and copy to quake/id1/ |
# | Rename dopa/pak2.pak to dopa.pak and copy to quake/id1/ |
# | |
# | Check settings in Synopsis! |
# | Check if path locations is correct |
# | Check if pakfile settings load correct edition! |
# | Check if save settings are correct setted (that stores your savegames!) |
# +------------------------------------------------------------------------------------+
# | |
# | One year anniversary of being RetroPie forum member! |
# | !!old but not outdated!! |
# | |
# +------------------------------------------------------------------------------------+
# | v1.1: Cleaned up code, Now we can handle names with space within 07/10/17 |
# | v1.1a: Removed some small typing mistakes 07/12/17 |
# | v1.2: save variable is abolished, names will be autogenerated now 07/15/17 |
# +------------------------------------------------------------------------------------+
# ------------------------------- Settings area ----------------------------------------
# Synopsis - Douple Check pathes and settings
#
# path variable should not end with slash!
# pak1.pak loads full version of Quake
# dopa.pak loads Episode 5
# hipnotic.pak loads Mission Pack 1
# rogue.pak loads Mission Pack 2
#------------
path="/home/pi/RetroPie/roms/ports/quake/id1"
pakfile="dopa.pak"
#
# save variable is autogenerated by pakfilename, you can change if you don't like
#------------
save="savegames_${pakfile%.*}.zip"
# --------------------------------------------------------------------------------------
#
# Check presence of pak2.pak (forced reboot or annother error)
# Prevents game file gettig deleted - fail save feature
#------------
if [ -e "${path}/pak2.pak" ]; then
echo "Error! pak2.pak present! Please resolve problem and rename file!"
echo "I've done NO changes to current media!"
sleep 10
exit
fi
#
# Is file definated really available?
#------------
if ! [ -e "${path}/$pakfile" ]; then
echo "Error! ${path}/$pakfile not found!"
echo "Please resolve problem in script or install file!"
sleep 10
exit
fi
#
# Extracting gamessaves
# if pak1.pak is loaded then exclude move command
#------------
unzip -qq -o "${path}/$save" -d "$path"
if [ "${pakfile,,}" != "pak1.pak" ]; then
mv "${path}/$pakfile" "${path}/pak2.pak"
fi
#
# Start the dance!
#------------
"/opt/retropie/supplementary/runcommand/runcommand.sh" 0 _PORT_ "quake" "${path}/pak0.pak"
#
# Archiving gamessaves
# if pak1.pak is loaded then exclude move command
#------------
cd "$path" && zip -mj "$save" *.sav
if [ "${pakfile,,}" != "pak1.pak" ]; then
mv "${path}/pak2.pak" "${path}/$pakfile"
fi