-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathArgs.py
51 lines (43 loc) · 2.2 KB
/
Args.py
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
import argparse
import platform
import GameManager
dolphin_path = ''
if platform.system() == "Darwin":
dolphin_path = "/Users/human/Library/Application Support/Slippi Launcher/netplay/Slippi Dolphin.app"
elif platform.system() == "Windows":
dolphin_path = "C:/Users/human/AppData/Roaming/Slippi Launcher/netplay/"
elif platform.system() == "Linux":
dolphin_path = "/home/human/.config/Slippi Launcher/netplay/squashfs-root/usr/bin"
print(dolphin_path)
def check_port(value):
ivalue = int(value)
if ivalue < 1 or ivalue > 4:
raise argparse.ArgumentTypeError("%s is an invalid controller port. \
Must be 1, 2, 3, or 4." % value)
return ivalue
def get_args():
parser = argparse.ArgumentParser(description='Example of libmelee in action')
parser.add_argument('--port', '-p', type=check_port,
help='The controller port (1-4) your AI will play on',
default=1)
parser.add_argument('--opponent', '-o', type=check_port,
help='The controller port (1-4) the opponent will play on',
default=2)
parser.add_argument('--debug', '-d', action='store_true',
help='Debug mode. Creates a CSV of all game states')
parser.add_argument('--address', '-a', default="127.0.0.1",
help='IP address of Slippi/Wii')
parser.add_argument('--dolphin_executable_path', '-e',
help='The directory where dolphin is',
default=dolphin_path)
parser.add_argument('--connect_code', '-t', default="",
help='Direct connect code to connect to in Slippi Online')
parser.add_argument('--iso', default='SSBM.iso', type=str,
help='Path to melee iso.')
parser.add_argument('--model_path', default='model/dqn', type=str)
parser.add_argument('--load_from', default=-1, type=int)
parser.add_argument('--compete', default=False, action='store_true')
parser.add_argument('--cpu_level', default=0, type=int)
parser.add_argument('--wandb', default=False, action='store_true')
args: GameManager.Args = parser.parse_args()
return args