Jump to content

Stranded

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by Stranded

  1. Sal, If you open them in vi, you can strip out the cr-lf combo by hitting : and then typing in %s/{ctrl-v}{ctrl-m}//g{return} Then hit : again and type in wq! to save and exit. Edit: If you open the file on a linux machine and see a bunch of ^M at the end of the file, then you have the cr-lf combo windows uses that linux doesn't.
  2. You should also remember that linux is case sensitive for filenames. Rule out a case or file permission issue first.
  3. I see some threads about not having multiple quicksaves, and how they would be helpful. In this thread: http://forum.kerbalspaceprogram.com/threads/55258-A-real-save-feature%21%21%21%21%21%21%21%21%21%21%21 I mentioned that it would take a simple script on a linux machine to copy over the quicksave files. Here is what I have come up with so far. I can't attach files to I will just post out the script. This script searches your home subdir for any quicksave.sfs files, notes the parent subdir, date and time, and stores them in a folder under your home subdir called ~/kspsaves. Note, I put this in a variable so that you can change the stored location if you want. You will end up with files like this in the kspsaves subdir: -rw-rw-r-- 1 stranded stranded 16662 Nov 4 10:59 quicksavelog.txt -rw-rw-r-- 1 stranded stranded 108868 Nov 4 10:59 quicksave.sfs.Demo.2013_1104-10:59:19 A couple of things to note. The first thing the script does is grep for KSP.x86. If Kerbal Space Program isn't running, then don't waste time. Then if KSP is running, then I have the script do a loop looking for all of the quicksave.sfs files, and they get a unique name in the kspsaves subdir. Now I also do a check using md5sums to keep from having duplicate files taking up space. If a file that is going to be copied over already has a matching file, the temporarily copied file is removed (ie: not copied). Your original quicksave.sfs file is never touched. I also set my cron up to do this search and copy every 10 minutes (see example at the bottom). You can set this to run at any interval you want. The theory here is that when you make a particular quicksave that you might want to go to note the date and time. Now if you want it copied over before the cron job rolls around, feel free to just run the script at anytime and your quicksave wil be copied over. I placed the saveKSP.sh script in my home subdir just to make it easy. This is my saveKSP.sh script: #!/bin/bash # This script will find any Kerbal Space Program quicksave file and copy it # to a kspsaves subdir that it creates in your home subdir. # Once a file is found, it is copied and timestamped like so: # quicksave.sfs.{parent dir}.YEAR_MMDD-HH:MM:SS # # Written by Stranded - 11/04/2013 #If you want to store the files in a different subdir, here's where you can specify SAVEDIR=~/kspsaves # Set the loglevel to 0 for low, or 1 for higher logging. This will make the quicksavelog.txt # file larger though. Hint, I set up a cron job to clear this file out monthly, and also # wrote this so the script doesn't log when Kerbal Space Program isn't running LOGLEVEL=0 # First, check and see if our save subdir exists. If it doesn’t, then create it. if [ ! -d $SAVEDIR ]; then mkdir $SAVEDIR fi # Making a log file to store output if [ ! -f $SAVEDIR/quicksavelog.txt ]; then touch $SAVEDIR/quicksavelog.txt fi # If Kerbal Space Program is running then we search for the quicksave file # and then back it up. Since both the 32 and 64 bit versions start with KSP.x86 we can # grep for that and get either version. if ps -ef | grep KSP.x86 | grep -v grep >/dev/null then #Note the beginning of the loop in the log if [ $LOGLEVEL -eq 1 ]; then echo "" >>$SAVEDIR/quicksavelog.txt echo "Beginning saveKSP.sh loop at `date +"%Y_%m%d-%H:%M:%S"`">>$SAVEDIR/quicksavelog.txt fi #In the case of more than one quicksave file, this will loop through all files found for FOUNDFILE in `find ~ -name quicksave.sfs -print` do # Store the parent dir in a variable PARENTDIR=`echo $FOUNDFILE | awk -F"/" {'print $(NF-1)'}` # Create the new filename based on the parent dir, date and time. FILETOSAVE="$SAVEDIR/quicksave.sfs.$PARENTDIR.`date +"%Y_%m%d-%H:%M:%S"`" # This is our very non glamorous temp file name TEMPSAVE="$SAVEDIR/tempsave.sfs" # Copy the found quicksave.sfs file and copy it as a temp file to the kspsaves subdir. cp $FOUNDFILE $TEMPSAVE # Lets check and see if the file is the same as the last saved file. FILEMD5=`md5sum $TEMPSAVE | cut -d ' ' -f 1` # Time to loop through the md5sums.txt file and see if this file already exists if md5sum $SAVEDIR/quicksave* | cut -d ' ' -f 1 | grep $FILEMD5 >/dev/null then # A file with the same Md5 exists so don't save it. rm $TEMPSAVE echo "File $FILETOSAVE has a checksum $FILEMD5 that already exists - removing." >> $SAVEDIR/quicksavelog.txt else # The file is orginal # Now that we have tested to see if it exists, save the file and the md5sum mv $TEMPSAVE $FILETOSAVE echo "File $FILETOSAVE checksum $FILEMD5 saved." >> $SAVEDIR/quicksavelog.txt fi done # End of loop, making note in the log file. if [ $LOGLEVEL -eq 1 ]; then echo "Ending saveKSP.sh loop at `date +"%Y_%m%d-%H:%M:%S"`">>$SAVEDIR/quicksavelog.txt fi fi END of saveKSP.sh script From there, I have the script run in a crontab entry every 10 minutes as follows: 0,10,20,30,40,50 * * * * ~/saveKSP.sh 1>/dev/null 2>/dev/null I also decided to put in a monthly cron entry to clear out the log file: 0 0 1 * * >~/kspsaves/quicksavelog.txt 1>/dev/null 2>/dev/null
  4. If you are on a linux system, you could make a crontab entry to make a copy of this file to another subdir, and then time stamp it on a regular basis. Then mark the time of a quicksave you want to go back to, copy it back in and quickload it.
  5. I can understand that. But it's funny how I take some of these simulations seriously. For instance I remember once sitting at my computer screen for hours during a cross country flight simulation just to say I did it. I could have easily warped ahead, but didn't want to ruin the experience for myself, boredom and all. In fact when I got my first guy into orbit and had a four day orbit I considered setting the alarm on my phone and letting the simulation run real time. I know it sounds goofy, but I think it's pretty cool. My wife gives me that 'I think I married an insane person' look when I tell her I am thinking about leaving it running full time just because I can. In the end I decided to warp ahead, and of course ran out of fuel just seconds before the de-orbit burn was completed, getting me in this mess. Funny thing is, I can't just leave these two out orbiting at warp speed to catch up with each other since one end of the orbit is so close, the program runs the warp back down to 1x as I get close. Makes it tricky to time when you can't watch it just go around a couple of times at 10000x.
  6. All good ideas. I am going to keep trying to save Ronbo then. I am still amazed at not only the realism of the program, but how well it's put together. It really makes you think back to the early days of the space program and those guys were calculating this with slide rules. It's just mind boggling when you really think about it, and then try and put something like simple orbit burn into action. I have always been fascinated with space and KSP really nails it. I spent hours the other night designing this rescue craft, and am pretty darn proud that I could get it into a similar orbit with enough fuel to get my guy home if I can get the timing right. To speak to the physics programmed in the game, I am noticing that with my rescue craft, when it comes back closer to the earth, the apoapsis is being reduced by the close periapsis, but at a different rate than the other guy in just the capsule. Thanks for all of the suggestions. I will keep at it.
  7. Well I think Ronbo might just have to take one for the team here. It's an elliptical orbit with the periapsis around 50km and the apoapsis around 12,000km. So with the speed swings it's really tough to time this out. I did get the orbit on the same plane, and I am guessing I could just let them spin around and fiddle with the orbit of my rescue craft long enough but ... So does anyone know if the demo game save can be pulled into the purchased version or are the versions too far apart now? That might make up my mind to just stop this exercise sooner.
  8. Thanks for the welcome. It's actually Ronbo. I am playing the demo version at the moment so my tools are limited, but to me that's part of the challenge. I have a ship that I can get into orbit and I actually placed two extra capsules along with their own boosters alongside the main capsule with my rescuer onboard. My plan is to meet up with Ronbo, get close enough to get him out of his current capsule, and then into one of the spare capsules and then set it up to make a deorbit burn. Then separate the spare capsules and everyone lands happy. It's amazing how much time it takes just to try some little change and fully test to see if it will even work. But it's rewarding when it does.
  9. Hey everyone. New guy here and well I have to say I am hooked. I picked up the demo and managed to get one of the Kerbins stuck in a very elliptical orbit. Of course since he was my first guy in orbit I feel like I owe it to him to send a rescue ship. Took me a long time to build it using the demo only but I have a ship with a couple of extra capsules and the fuel to rescue my guy. Now I just need the spare time to map out the mission. I will of course pick up the full version here soon, but am enjoying the challenge of getting my guy back home.
×
×
  • Create New...