Jump to content

Extracting ship(s) from SFS


Recommended Posts

I didn't want to make a whole thread for this, but I couldn't find any existing ones for it.

Anyway.

I made a nice crew shuttle and launched it, but I neglected to save it as a distinct ship file because I wanted to make sure it worked first. It did. And then I went and built and launched something else, forgetting that I hadn't saved a copy of the shuttle. So now I have the shuttle in space, but not saved as a craft file.

I tried copying and pasting the corresponding block from my save, but the editor failed to read it and claimed it had no parts.

Is there any way to save my ship? Including a mod or external program? I really don't want to go through building it all over again.

Link to comment
Share on other sites

Rescuing ships from save files by hand is possible but rather difficult. Unfortunately you can't just copy and paste the section from the persistent.sfs. I've done it for smaller ships, but if your ship is complex it will take a long time.

I'm not sure if there are any mods that can do it...

Why not just save it and delete it if it doesn't work?

Also, why not just edit the design until something works instead of starting over?

Because he doesn't have the save file but wants it. The ship was launched and is not only in his save file.

Check what you have as the 'autosaved ship', if you haven't built other stuff since, your creation should be there.

He said he built and launched another ship. So his autosave has been rewritten.

The only other easy option is if you happened to save it as "Untitled Space Craft"

Link to comment
Share on other sites

I overwrote the autosaved ship when I launched something else. Similar deal with my "Untitled Space Craft" and "WIP". I've rescued other ships from there before, but this time it won't do me any good.

Thanks for the suggestions; lemme know if anyone digs up a mod for this or anything! In the meantime I'll just assume the ship is lost and start making a better one... :\

Link to comment
Share on other sites

  • 1 year later...

Hi all! I realize this thread is a bit old, but a recent request for this functionality has prompted me to build a tool.

I'm almost done, but there are some properties that need translation from the .sfs (VESSEL node) to the .craft file, and I'm having trouble figuring that out.

If anyone has input, please post here or contact me - thanks in advance!

Link to comment
Share on other sites

no point keeping useful info out of the public eye. So what do you need? I hand edit my SFS all the time for so many different things, I'm also familiar with the craft file format.

The part tree, as represented by link and attN/srfN in the .craft file is apparently done differently in the .sfs file. That's my biggest hurdle at this point.

Some values are easy to transform (position = pos, rotation = rot, etc.), but others are more mysterious (attPos, attPos0, etc.), and some are outright missing (istg, dstg, etc.). EDIT: It varies with the part.

Since I already have a .cfg node parser and part database handy, the rest is/was/should be pretty easy. I have a good bit of experience parsing .craft files, but not so much with .sfs.

If someone could point me to a quick summary that cuts to the chase and gets me up to speed, that would be awesome, otherwise I've got some reading to do. I will likely need to read through the existing code as well as the related threads here to catch up on what's already been done.

I will post a link to my web-based tool once I have a testable version to upload - prolly later today.

Edited by Ezriilc
Link to comment
Share on other sites

Update: I now have a .craft file that can be loaded by the KSP editor, but it is bugged in a way that borks the editor - only the root part shows, and the player cannot take or move it.

I think I have the basic part tree figured out via the "parent" property, with parts indexed by the order they appear in the .sfs file (first is root).

The pos, attPos, rot, attRot properties exist in .craft files, but don't seem to have easily translated counterparts in the .sfs. There may be some math that can figure them, but I don't see it.

I'm not surprised that it doesn't work yet, but I think I'm close.

Link to comment
Share on other sites

The last ship launched is auto-saved under "Auto-saved ship"

You can check if it is still there.

However, an auto-ship saver mod, and a ship extractor mods are two mods you might want to suggest.

Link to comment
Share on other sites

i'm working the other way, inserting a craft file into a sfs, so I'm interested in the notes as well.
I've no help for Ezriilc; that's a hard one, and I've been hoping for a mod for this problem for years, literally.

For Steuben, this one is easy! Simply launch the vessel, then position it with hyperedit. Or, did I misunderstand your question?

Link to comment
Share on other sites

For Steuben, this one is easy! Simply launch the vessel, then position it with hyperedit. Or, did I misunderstand your question?

that process i know. problem is i'm pushing things too hard for step one to work. so i'm trying to cut out the middle man.

Link to comment
Share on other sites

I've no help for Ezriilc; that's a hard one, and I've been hoping for a mod for this problem for years, literally.

Oh, good! I'm glad someone else is interested.

Update: Progress! My latest output .craft file can be fully loaded in the KSP editor, AND the player can take/move parts, BUT... the parts are not connected to each other - rather they appear in a "pile" on the floor. I think all that is left is figuring the exact position and rotation of the non-root parts. EDIT: It works!

Here are some reference links: EDIT: Updated these links. These are not the tool itself, that is further down this thread.

EDIT: The Craft Extractor is now at the bottom of our Craft Kitchen page.

www.Kerbaltek.com/craftkitchen

Edited by Ezriilc
Link to comment
Share on other sites

Claw's InflightShipSave Mod

Back when Inigma had lost the .craft file for his Space Shuttle Replica, Claw and I attempted to write programs to convert the .sfs to a .craft. Claw's version is linked above. (Considering mine was never finished :P)

I have not the slightest clue if it will still work in Version 1.0.4, as IIRC this was made in Version 0.90.0.

Link to comment
Share on other sites

I have not the slightest clue if it will still work in Version 1.0.4, as IIRC this was made in Version 0.90.0.

Yep, it was written in 0.90. I have't tried it in 1.0.X.

It had maybe 6 downloads, so I never bothered to update it.

Cheers,

-Claw

Link to comment
Share on other sites

MORE progress! The parts are now connected together, but the distance between them is off - something in my math, I think.

I've updated the output file in the links above, so maybe someone can see what I'm messing up.

I'm beginning to think this might actually work!

- - - Updated - - -

For some reason, I've not been getting notifications for this thread - a known problem.

looks like pos isn't either extracted from the sfs or insterted to the craft, or both.

I think if you generate it as POS[root] +attPos0[part] you might get what you need.

That was exactly it, but something in my math is off, leaving gaps between parts. Perhaps you can see from the output where I've gone wrong?

As for Claw's mod, I've looked at that, but it's all being done with the in-game API, and doesn't do anything with the config node texts. My web based tool is working strictly from the text of the .sfs file - with a little help from the parts database.

I do appreciate all the help! I look forward to getting this working to some usable level.

Link to comment
Share on other sites

I've done it! ... I think.

The tool produces a seemingly complete ship with all the parts in the right place. The math for position is strange - the attPos0 prop is cumulative with every part in the tree before it, and then pos is calculated from its parent's pos + attPos0.

I strongly suspect that there remains other issues with the final craft, and much testing is in order as I've not yet tried anything with parts rotated and/or in symmetry.

Now that it appears to be working, I'll post the TEMPORARY link to what I'm calling the ALPHA version of this tool. If it works well in the long run, I'll incorporate it into my Craft Kitchen page.

EDIT: I've moved this tool to our Craft Kitchen page.

www.Kerbaltek.com/craftkitchen

I look forward to any bug reports ya'all can send me. Thanks again for the ongoing help! :D

Edited by Ezriilc
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...