-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_smac.sh
75 lines (57 loc) · 1.62 KB
/
install_smac.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
#!/bin/bash
# Install SC2 and add the custom (smac + smacv2) maps
sudo apt install unzip
cd "$HOME"
export SC2PATH="$HOME/StarCraftII"
echo 'SC2PATH is set to '$SC2PATH
LOCAL_PATH="${HOME}/MAPG"
# Function to print usage information
print_usage() {
echo "Usage: $0 [LOCAL|REMOTE]"
}
if [ $# -ne 1 ]; then
echo "Error: METHOD is required."
print_usage
exit 1
fi
USER_METHOD=$1
if [[ "$USER_METHOD" != "LOCAL" && "$USER_METHOD" != "REMOTE" ]]; then
echo "Error: METHOD must be either LOCAL or REMOTE."
print_usage
exit 1
fi
if [[ -d "$LOCAL_PATH" && "$USER_METHOD" == "LOCAL" ]]; then
METHOD="LOCAL"
else
METHOD="REMOTE"
fi
echo "Selected METHOD: $METHOD"
if [ ! -d $SC2PATH ]; then
echo 'StarCraftII is not installed. Installing now ...';
if [[ "$METHOD" == "LOCAL" ]]; then
unzip -P iagreetotheeula ${LOCAL_PATH}/SC2.4.10.zip
else
wget http://blzdistsc2-a.akamaihd.net/Linux/SC2.4.10.zip
unzip -P iagreetotheeula SC2.4.10.zip
rm -rf SC2.4.10.zip
fi
else
echo 'StarCraftII is already installed.'
fi
echo 'Adding SMAC maps.'
MAP_DIR="$SC2PATH/Maps/"
echo 'MAP_DIR is set to '$MAP_DIR
if [ ! -d $MAP_DIR ]; then
mkdir -p $MAP_DIR
fi
if [[ "$METHOD" == "LOCAL" ]]; then
unzip ${LOCAL_PATH}/SMAC_Maps.zip
else
wget https://github.com/oxwhirl/smacv2/releases/download/maps/SMAC_Maps.zip
unzip SMAC_Maps.zip
fi
mkdir -p "$MAP_DIR/SMAC_Maps"
mv *.SC2Map "$MAP_DIR/SMAC_Maps"
echo 'StarCraft II and SMAC are installed.'
# install smac_pettingzoo
pip install git+https://github.com/xihuai18/SMAC-PettingZoo.git