[Not Mod] FTL Checkpoint for Mac

Distribute and discuss mods that are functional. Moderator - Grognak
snarke
Posts: 12
Joined: Tue Dec 04, 2012 12:30 am

[Not Mod] FTL Checkpoint for Mac

Postby snarke » Tue Dec 04, 2012 11:52 pm

Well, despite a lack of rabid interest, I still ended up building my personal FTL checkpoint script into an actual Mac app.

FTL Checkpoint
UltraMantis
Posts: 2141
Joined: Thu Sep 20, 2012 3:17 pm

Re: [Not Mod] FTL Checkpoint for Mac

Postby UltraMantis » Wed Dec 05, 2012 1:12 am

Cheers for doing this. I guess the lack of interest is due to a majority of people having accepted that FTL doesn't want to have a save/reload option. But thanks for the effort. Some folks will sing you praises i'm sure. :D
Report spam using the handy Report Button Mod.
Attackid
Posts: 13
Joined: Mon Oct 01, 2012 11:27 am

Re: [Not Mod] FTL Checkpoint for Mac

Postby Attackid » Wed Dec 05, 2012 11:13 am

Sounds amazing
possible for a windows version?
snarke
Posts: 12
Joined: Tue Dec 04, 2012 12:30 am

Re: [Not Mod] FTL Checkpoint for Mac

Postby snarke » Thu Dec 06, 2012 1:54 am

It's possible, but not by me, I'm afraid. I don't have a Windows machine and have no idea how to program an app for it. However, I did include a fair number of comments in the code itself, and since it's made with Ruby, the 'source code' is still there in the app itself, so somebody with Windows could download it, unzip it, and should be able to extract the important bits if they wanted to try to make a windows version.
s0ulman
Posts: 4
Joined: Sun Dec 02, 2012 4:52 am

Re: [Not Mod] FTL Checkpoint for Mac

Postby s0ulman » Fri Dec 07, 2012 1:13 am

I'm really interested in this but also a Windows gamer and, unfortunately, not much of a coder.

At the moment I'm just using the manual quick save method (save and quit and backup continue.sav) when I need save, which is usually when I'm trying to unlock a ship.
I agree with the devs death is part of the fun, but if I left it to statistics I'd probably get bored of playing FTL before I unlock most of the ships :) And one of the things I love about the game is mastering new ships!
snarke
Posts: 12
Joined: Tue Dec 04, 2012 12:30 am

Re: [Not Mod] FTL Checkpoint for Mac

Postby snarke » Fri Dec 07, 2012 4:37 am

I understand. I just used it to unlock the Crystal ship, and even with it, I had to rewind and replay four or five times just to get it to give me the pod in the first place.

Unfortunately, even my old command line script leverages a lot of tricks that I'm pretty sure are OSX-specific.

Code: Select all

#!/usr/bin/ruby
require 'pathname'
Savefilehome = Pathname.new('~/Library/Application Support/FasterThanLight').expand_path


That's the Mac's location for the continue.sav file. You obviously know what the Windows equivalent of that is.

Code: Select all

sf = Savefilehome.children.select{|f| f.basename.to_s.match(/^continue/)}
if  sf.detect{|f| f.basename.to_s.match(/^continue.sav$/)} then
   # save a copy of the current save file
   savestack = sf.sort{|a,b| a.mtime <=> b.mtime}
   if savestack.size > 1 then
      mostrecent = savestack[-2]
      nextsave = mostrecent.basename(mostrecent.extname).to_s.match(/^(continue)(.+)/)[2].next
   else
      nextsave = "1"
   end   
   command = "cp '#{Savefilehome.to_s}/continue.sav' '#{Savefilehome.to_s}/continue#{nextsave}.sav' "
else
   # restore from the most recent save
   mostrecent = sf.sort{|a,b| a.mtime <=> b.mtime}.last
   command = "cp '#{mostrecent.to_s}' '#{Savefilehome.to_s}/continue.sav'"
end

`#{command}`


The "cp" command is unix-speak for "copy."

Code: Select all

`osascript -e 'tell app "FTL" to run'`


And there you got me. The osascript command runs what's in the quotes as an AppleScript fragment, and in this case, it finds FTL wherever it happens to be on the drive, and launches it. As far as I know, on Windows you'd have to hard-code a hard path.

And, of course, the whole thing's written in Ruby, which AFAIK doesn't even come built-in to Windows like it does with OSX.
briangocher
Posts: 1
Joined: Mon Dec 17, 2012 12:29 pm

Re: [Not Mod] FTL Checkpoint for Mac

Postby briangocher » Mon Dec 17, 2012 2:17 pm

I love that you made this. I won't lie, I haven't gotten it to work, but that's my ignorance. Maybe I could ask you if its meant to work on an instance of FTL managed by Steam for OSX? I'm using OS 10.8.2
snarke
Posts: 12
Joined: Tue Dec 04, 2012 12:30 am

Re: [Not Mod] FTL Checkpoint for Mac

Postby snarke » Wed Dec 26, 2012 10:41 am

Did you download the compiled app from my web site? If so, what happens when you use it? Unless the Steam version is putting the continue.sav file in some other location than the standalone, it ought to work just as well.
snarke
Posts: 12
Joined: Tue Dec 04, 2012 12:30 am

Re: [Not Mod] FTL Checkpoint for Mac

Postby snarke » Fri Jan 04, 2013 11:35 pm

I have released version 2.0. It now indicates if there's a game in progress, or if it's going to start you from your last checkpoint, and there are some more cute noises when you select various buttons. It's really more like a 1.05 version, but I think it's silly to do second-decimal-point increments when I think it's very unlikely I'll ever need to count any higher than 4 even if I only use integers. {chuckle}
Namssorg
Posts: 1
Joined: Sun Jan 06, 2013 3:58 am

Re: [Not Mod] FTL Checkpoint for Mac

Postby Namssorg » Sun Jan 06, 2013 4:00 am

Has anyone confirmed this working with the mac version through Steam? I've downloaded a few times, and when I launch FTL Checkpoint, nothing seems to happen. Saw someone else was having an issue too.