Re Boa: Hmn, it looks like that isn't working.
Code: Select all
SyntaxError: invalid syntax
Morrions-Mac:~ Andrew$ python /Users/Andrew/Library/Application\ Support/Steam/SteamApps/common/FTL\ Faster\ Than\ Light/FTL.app/Contents/main.py
File "/Users/Andrew/Library/Application Support/Steam/SteamApps/common/FTL Faster Than Light/FTL.app/Contents/main.py", line 438
dir_mods = ~/Documents/FTL mods
^
SyntaxError: invalid syntax
Maybe there's a way to make it a relative path (can you do that in python?) and direct to "/mods"? I don't know if that would mess up any of the rest of main.py, though.
for reference, here's the whole portion of that bit of code (with the replacement):
Code: Select all
elif platform.system() == "Darwin":
steam = msgbox.askyesno(progname, "Did you purchase FTL through Steam?")
if steam == True:
dir_res = os.path.join(os.environ['HOME'], 'Library/Application Support/Steam/SteamApps/common/FTL Faster Than Light/FTL.app/Contents/Resources')
if steam == False or steam == None:
if not os.path.isfile(os.path.join(dir_root, "MacOS", "FTL")):
msgbox.showerror(progname, "Grognak's Mod Manager must be located directly above the MacOS folder in FTL.dat")
sys.exit(0)
dir_res = os.path.join(dir_root, 'Resources')
os.chdir(dir_root)
dir_mods = ~/Documents/FTL mods
dir_mods = os.path.expanduser(dir_mods)
if not os.path.exists(dir_mods):
os.makedirs(dir_mods)
copy(os.path.join(dir_root, "mods/Beginning Scrap Advantage.ftl"), dir_mods)
msgbox.showinfo(progname, "A folder has been created in " + dir_mods + ". Please place any FTL mods there.")
else:
msgbox.showwarning(progname, "Unsupported platform; unexpected behavior may occur.")
EDIT: Mwuahahaha! I have mastered the powers of python! No, not really. But I did change "~/Documents/FTL mods" to "os.path.join(dir_root, 'mods')", which seems to have worked! I got through the steam bool, and then the GUI opened up! Hooray!
I'm guessing that "dir_root" is the way of making the .py file you're running the root (so it can have a relative filepath), and then 'mods' is the folder (I think it's case-sensitive). Would 'mods/subfolder' then go to a folder/file inside mods?
So, the final/edited code for that section:
Code: Select all
elif platform.system() == "Darwin":
steam = msgbox.askyesno(progname, "Did you purchase FTL through Steam?")
if steam == True:
dir_res = os.path.join(os.environ['HOME'], 'Library/Application Support/Steam/SteamApps/common/FTL Faster Than Light/FTL.app/Contents/Resources')
if steam == False or steam == None:
if not os.path.isfile(os.path.join(dir_root, "MacOS", "FTL")):
msgbox.showerror(progname, "Grognak's Mod Manager must be located directly above the MacOS folder in FTL.dat")
sys.exit(0)
dir_res = os.path.join(dir_root, 'Resources')
os.chdir(dir_root)
dir_mods = os.path.join(dir_root, 'mods')
dir_mods = os.path.expanduser(dir_mods)
if not os.path.exists(dir_mods):
os.makedirs(dir_mods)
copy(os.path.join(dir_root, "mods/Beginning Scrap Advantage.ftl"), dir_mods)
msgbox.showinfo(progname, "A folder has been created in " + dir_mods + ". Please place any FTL mods there.")
I'm sorry to have solved the final piece without your input, but I thank you for helping get to this. I definitely wouldn't have figured it out if you hadn't shown me where to look, boa ^^.
@Grognak: I really would like to know why main.py couldn't find the ini file, though - perhaps I put it in the wrong location? I hope I haven't offended you by changing main.py with boa's help - I definitely respect your code, but I just really wanted to use it to play/mod FTL with, and couldn't wait for you to come in with an official answer XD =)
for reference, this was with v1.4, not the latest files from github/src.