Mythos

[WIN] KML - Persistence file editor

Recommended Posts

Can't find what follows reported yet (if I missed it, sorry!).

Parts with multiple docking ports, when at least 2 ports are docked, can bring to errors in KML. Nb1tD7u.png

While such parts are not existing in stock KSP, they do in add-ons, I did test with the Command Module Hub from Tokamak Industries (Note: I have a recollection from times old multiple docking ports with a part were an issue in KSP, therefore highly discouraged; however the vessel I used in my tests doesn't raise any trouble (no errors, exceptions, warning in the log and debug console) and works finely in KSP).

What I am seeing from examination of the savegame, a part with multiple ports has multiple "ModuleDockingNode" modules; each will have the dockUId field set to uid of the docked part; from the docked parts side, each has the "ModuleDockingNode" module with dockUId set to the corresponding part with multiple ports (so, dockUId can be identical for multiple modules in the save), however the "dockNodeIdx" field is set to a different index for each part.

From what little I can get about how KML works, it reports an error due to checking correspondence of the uid, parsing data from only one "ModuleDockingNode" module with each part so failing to find the correct correspondence in case of multiple docking ports with a part.

I'm attaching savegame and pictures of KML showing vessel structure (with docked parts) and data of the Hub.

Share this post


Link to post
Share on other sites
On ‎22‎.‎02‎.‎2017 at 11:49 AM, diomedea said:

Parts with multiple docking ports

 

Thank you for teaching me something new about docking. I understand the problem and got your savefile to reproduce it. For the moment it seems complicated to rework the docking test for multiple docks per part.

I could just not check such ports and so skip that warning. But that is not my intention, KML should rather do more checks if it would understand multiple docking ports.

But I can assure that you can ignore that warning and use KML for editing such a savefile. The docking information will stay as it is. You just should not try to use the repair-feature on any docking warning with such a multiple dock involved on one side.

As I said about warnings on KAS ports... Not all mod parts are supported and you should read warnings about mod parts like "there is something about that part KML does not understand". And if you know it's due to a mod, than ignore those warnings.

I intended to support KAS ports, but also did not found the time to do so far.

Share this post


Link to post
Share on other sites
Posted (edited)

Would it be at all possible to allow re-defining the root part on a craft in flight? I've heard its difficult and might require alteration of the .craft file as well.

It sounds too complicated but if you could implement it, I would be appreciative.

(RoverDude's Construction ports won't compress if one of them is the root part.)

Sorry, this issue was covered previously. Just noticed the KAS/KIS solution myself. "Nothing to see here."

Edited by Teslamax

Share this post


Link to post
Share on other sites
1 hour ago, Teslamax said:

Would it be at all possible to allow re-defining the root part on a craft in flight? I've heard its difficult

I also think this would be handy, but as you said it is difficult. As KML is still pre-release I might add more standard features first. Like copy & paste of anything or deletion of parts (this is related to the root part problem and might get difficult also and would lead to having the root change just a little more work).

I personally changed root part in my own save recently like that (KIS/KAS connection linking and unlinking caused root to be the KAS-port pointing sideways):

  • dock your problematic vessel to a station (watch out for the problem vessel being docker and the station or whatever other ship being dockee).
  • save and open with KML
  • navigate to that docking connection, identify all related parts (both docking ports and the part you want to be root, and maybe the part that is current root) by part number and UID
  • on the docker side the part will contain a MODULE (ModuleDockingNode) and a DOCKEDVESSEL node therein
  • There you should check the "vesselName" to be your problematic docker vessel and then just change the "rootUId" to your liked part UID
  • save in KML and reload in KSP
  • undock and KSP will reorder the parts for you to have the given part the new root

 

1 hour ago, Teslamax said:

might require alteration of the .craft file as well.

This does not sound correct. The save .sfs file is independent from any .craft file, because it already contains all vessel connection information. This is why some people have the need for a tool to get .craft files out of vessels within a .sfs file. Maybe they launched unsaved vessels and later want to reload them to the VAB.

Share this post


Link to post
Share on other sites

I freaking love your program. Thanks, very useful

Share this post


Link to post
Share on other sites

Does this work in-game? Does it have compatibility with the "K-PAD" From 

Share this post


Link to post
Share on other sites

OK, I tried running it with Mono on Linux and it won't run due to "entry point method cannot be loaded."

I'll take a look at the code later to see if anything stands out but you probably need someone with more experience getting .Net programs working on Mono under OSX and Linux.

Share this post


Link to post
Share on other sites
Posted (edited)

I made some progress and implemented part deletion for any part that's not parent to other parts. This would usually mean any outermost parts. I didn't like the idea to click delete on one part and causing some chain reaction to delete all dependent parts, worst case all parts but root. Of course you can delete your way forward step by step (easiest done in the graph view in vessels tab).

This would fit my needs... Would it fit yours?

Not released yet, but it's in the preview build (the ZIP mentioned on bottom of OP).

KML.zip in this version has some issues with false positive virus warning with Windows Defender. Didn't find a solution, maybe solved after more code changes, see https://github.com/my-th-os/KML/issues/3#issuecomment-322055507

Edited by Mythos
Info about false positive virus warning

Share this post


Link to post
Share on other sites

Thank god for this!  I encounter the docking port bug again in 1.3.1 and this fixed it perfectly!  Thanks a ton!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now