Jump to content

Any ideas or best practices to edit .craft files?


b_griffin

Recommended Posts

Hello,

I tried to use a quad connector to 4 nuclear engines. Each of the engine had a decoupler and I tried to put another quad connector underneath the decouplers.

It all seem good during design, but when I tried to launch it it would bend like crazy. I opened the .craft file and saw that only one of the decouplers was attached to the quad connector. The other 3 decouplers were just hanging there.

First I tried many times to fix this in the vehicle assembly building but it will always only attach one.

Then I tried to reverse engineer the .craft file to connect the 3 decouplers. I saw that you have to tell each decoupler that it has to be connected to the quad adapter and then tell the adapter that is connected to the decouplers. There seems to be some ordering tough because there are 4 places so you need to specify 01 02 03 or 04...

I tought that when you flip the quad adapter then the top connector 01 should be connected to 02, 02 to 01, 03 to 04 and 04 to 03.

After making all the changes, I saved the file and loaded back in KSP. In the building it seemed to load ok but all the engines were on (poor kerbals in the building were really worried about all the leaked radiation). When I tried to launch KSP crashed.

So at the end I figured that editing the .craft file is not that straight forward and I was wondering if there are any editors out there to consistently make changes.

I did try the kerbaledit but I dont think you can make changes to the ship file there.

Has anybody try to edit this with some success? or how to edit them?

thanks

Link to comment
Share on other sites

The best practice is: Don't.

You're trying to get around the single parent connection system that KSP uses, which is likely what's making it crash. The best practice is learning how to design things properly, you can for example do the quad connector thing just fine by strutting the quad connectors to eachother.

Link to comment
Share on other sites

So, (taking a step back) did you have engines on inside the VAB?! Well done, I've not seen or heard of that yet!

This appears to be your first post too, so Welcome to the Community!! You also appear to have arrived with a far from standard question!

Just making sure I understand your design, you had 4 engines on a quad coupler then under each engine was a decoupler and then under that was another quad coupler? and your problem was that there was only 1 point of connection to the 2nd quad coupler?

Unfortunately what you've hit on is a limitation of the games engine. Craft follow a tree structure, they can branch like a tree, but branches can't be connected together. What you have there is a split to 4 branches going to each engines, one of the branches then connects to the 2nd quad coupler but it is impossible for that branch to be connected to the other 3. At least with stackable or radial parts. That's why your .craft editing efforts produced such odd results I think.

There are two ways (that I know off) to get round the branching limitation. Struts are the only part that can be attached in the VAB/SPH that can form links that don't conform to the tree branching structure. You can use them to essentially glue the decouplers to the quad coupler but that can be a bit ugly.

The other solution is to use docking ports. Put a decoupler under each engine, then a docking port attached to each decoupler (facing docking port side down). Then under one of the docking ports put another docking port (docking port side facing up) and then attach the quad coupler to that. That is your tree structure. Then on the 3 points of the quad coupler that are free put more docking ports (also facing up), making sure they attach to the quad coupler not the other docking ports. In the VAB/SPH these won't actually be connected, but as soon as you launch the craft they will (should) dock and will form the connection structure that (I think) you are after. I'd also recommend adding some struts to help keep that connection firm.

You can then ignore the fact they are docking ports and just drop the whole assembly by triggering your decouplers.

Hope that helps! Happy building!

Link to comment
Share on other sites

Craft files in KSP are trees, in the computer science sense. This means that if you draw a diagram of your craft with each part represented by a point and connections between parts represented by lines, there are not allow to be any cycles. The VAB and SPH don't let you violate this rule. If you do so by editing the .craft file, it's no surprise that KSP might crash, because it's going to open up that file and start parsing it with the assumption that it's a tree. Essentially, you've corrupted the file.

There is a way to effectively have a craft with cycles in it, though: Use docking ports. When you build it in the VAB, it will still be a tree, but if you line up two docking ports without having them actually connected, then when you take it to the launchpad, they should dock. So in your example, instead of trying to attach the lower quadcoupler directly to all of the decouplers, put docking ports there. Then put another docking port under one of them, flipped the other way around so that it looks docked. Put the flipped quadcoupler under that decoupler. Then add the final three docking ports - make sure that they're actually connected to the quadcoupler, but they should line up perfectly with the docking ports above, and should dock when you go to the launchpad.

There's lots of stuff you can do by editing .craft files, though personally all I've done with it is get some surface-attached things positioned and oriented more precisely than was possible in the SPH.

Edit: Hah, beaten to the punch while I was typing, and with exactly the same solution too.

Edited by PetWolverine
Link to comment
Share on other sites

Thanks All

I tried the docking ports and everything worked perfectly.

However, the decouplers destroy the 4 nuclear engines when activated.. lol. Abandon idea.

Launch success:

VoFiOCb.jpg

1st Decoupling worked fine:

HGb71V8.jpg

Decouplers in the nuclear engines tear the whole thing apart lol:

rMTrQWNh.jpg

No Kerbals were injured.

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...