Jump to content

[WIN] KML - Persistence file editor


Mythos

Recommended Posts

  • 3 weeks later...

I just released v0.9, see OP.

Finally there is some support for Linux and Mac users, but for now it ist only a CLI and no GUI. Download the KML_Mono.zip in that case. Windows users can use the CLI as well, of course. Get the combined GUI and CLI version with KML_Windows.zip. To learn more about CLI, check the COMMANDLINE.md introduction.

There was some trouble recently about IDs being broken in certain contracts, so I included some checks and automatic repairs for that.

This is now fixed as well, thanks for that again:

On 4/12/2020 at 8:35 PM, Krazy1 said:

You probably know this but it gives warnings for Kerbals sitting in external command chairs "part not attached to parent part" but I just ignored those. 

 

Edited by Mythos
Link to comment
Share on other sites

Perhaps is not the best place to ask, but as I used this tool to try to solve the problem, I will star here. 

I added a module to my muna base using KIS, but I couldn't get it properly aligned, so I edited the  ship with KML and pasted the rotation parameter from the parent, but nothing changed. Ideas? 

Link to comment
Share on other sites

45 minutes ago, Tacombel said:

I added a module to my muna base using KIS, but I couldn't get it properly aligned, so I edited the  ship with KML and pasted the rotation parameter from the parent, but nothing changed. Ideas? 

You found the 'PART' that you added and changed its 'rotation' attribute? Probably doesn't make sense to use the value from its parent but have to play around alot (some maths might help), and also very likely have to mess with the 'position' attribute as well. But you should definitely notice some changes, when you look at the right part and also actually did load your changes back into KSP (I always edit quicksaves, easiest to let KSP run and load after you're done in KML).

Link to comment
Share on other sites

59 minutes ago, Mythos said:

You found the 'PART' that you added and changed its 'rotation' attribute? Probably doesn't make sense to use the value from its parent but have to play around alot (some maths might help), and also very likely have to mess with the 'position' attribute as well. But you should definitely notice some changes, when you look at the right part and also actually did load your changes back into KSP (I always edit quicksaves, easiest to let KSP run and load after you're done in KML).

I will try some significant amount change and experiment . I thought it would be an absolute reference. 

Finding the part was really easy. Your tool is really great, it took me perhaps 5 minutes to get used to it. 

Link to comment
Share on other sites

1 hour ago, Tacombel said:

I thought it would be an absolute reference. 

Actually, I don't know. I went so far to replace parts with similar ones (liquid only tank vs. L+O), but considered messing around with position and rotation as too cumbersome. So if I plan to attach something via KIS or the new vanilla feature, I would try to rely on node attachment. But now we have that vanilla feature, probably even more peoply try things like that and I see the need for doing some additional precise number correction. So please report your research results :)

Link to comment
Share on other sites

3 minutes ago, Tacombel said:

Don't know what is happening, but changing the rotation parameter has no effect.

Did you try changing any of the three vector entries independently?

Link to comment
Share on other sites

33 minutes ago, Mythos said:

But somewhere the orientation of parts has to be stored and loaded from. And I don't see any other suspects. Need more research.

This is like magic. I made a test ship with two tanks and a probe and the same happens, so it is not related to the parts I am using. The only thing I can think of is that one of the other parameters is kind of a checksum.

Link to comment
Share on other sites

I made this test craft.

RykKVrl.png

The solar panels are from top to bottom:

rotation = 0,0,0,1
rotation = -1.54268047E-08,1.17178317E-07,-0.130526081,0.991444886
rotation = 0,0.130526081,0,-0.991444886
rotation = 0.130526081,0,0,-0.991444886

Your Quaternion Converter (zachbennett.com) seems to work:

x, y, z = 180, 180, 0 (didn't rotate capsule and tank, seems to have mounted the panels on the west side, while east would be y = 0)
x, y, z = 165, -180, 0 (x is the angle w.r.t. ground here and -180 shouldn't make any difference from +180)
x, y, z = 180, 165, 0 (changed heading y)
x, y, z = 180, 180, -15 (rotated along the expansion axis of the panel)

Ok then let's invent some new rotation, e.g. now pointing 45° upward:

x, y, z = 135, 180, 0

This converts to:

rotation = 0,0,0.38268,-0.92388

Which I did set to all panels via KML. Saved in KML, reloaded in KSP:

MA7QCsE.png

Works! :D

1 hour ago, Tacombel said:

The only thing I can think of is that one of the other parameters is kind of a checksum.

No it's not.

So lets fall back to the basic questions: Is your power cable plugged in? :D Did you really save in KML? Did you really reload in KSP?  :wink:

Link to comment
Share on other sites

2 hours ago, Mythos said:

So lets fall back to the basic questions: Is your power cable plugged in? :D Did you really save in KML? Did you really reload in KSP?  :wink:

I think it is  :sticktongue:

Just to check, you do a save, change it with KML and load again, all without exiting KSP, right?

Definitely, something is playing with my install.

Next I plan to change the persistent.sfs, as to load it directly.

Link to comment
Share on other sites

1 minute ago, Tacombel said:

Just to check, you do a save, change it with KML and load again, all without exiting KSP, right?

Yes, that's what I do. In KSP just a normal F5 to quicksave.sfs, open that file in KML, overwrite it with KML (you'll get a message and it also creates a backup file, does it?), do F9 in KSP.

In that case it doesn't even matter if you pause KSP, as it never overwrites quicksave.sfs on its own. That's what you have to keep in mind about persistence.sfs. 

Link to comment
Share on other sites

  • 2 weeks later...

Was playing around with this amazing tool, in particular the 'Refill all resources', but I noticed that for the various life support mods there is waste output, which is supposed to be empty or at least needs some not full-ness in order to do things like recycling etc.

How difficult/time consuming would it be to add a 'Empty all resources' function that basically works inversely to how the 'Refill' works?

(if this is already a thing, I'm not finding it)

Link to comment
Share on other sites

11 minutes ago, DirtyFace83 said:

How difficult/time consuming would it be to add a 'Empty all resources' function that basically works inversely to how the 'Refill' works?

I don't think anyone wants to empty all resources, only that one specific waste resource. I'm not used to life support, is this one resource of many in a single part? Or is it one part per resource?

I would suggest that you use the refill all feature and then go to the waste part and change the numbers manually. Just go down to the RESOURCE node unter the PART and change to "amount = 0".

Link to comment
Share on other sites

2 minutes ago, Mythos said:

I don't think anyone wants to empty all resources, only that one specific waste resource. I'm not used to life support, is this one resource of many in a single part? Or is it one part per resource?

I would suggest that you use the refill all feature and then go to the waste part and change the numbers manually. Just go down to the RESOURCE node unter the PART and change to "amount = 0".

Right, that's what I ended up doing, and everything works as intended. I was just wondering if it was witihn the scope of this tool to add 'Empty all '$resource$' resources in all parts of this vessel' is all.

Really useful tool though, and I agree that LS mods are kind of an outside case.

Link to comment
Share on other sites

50 minutes ago, DirtyFace83 said:

Was playing around with this amazing tool, in particular the 'Refill all resources', but I noticed that for the various life support mods there is waste output, which is supposed to be empty or at least needs some not full-ness in order to do things like recycling etc.

How difficult/time consuming would it be to add a 'Empty all resources' function that basically works inversely to how the 'Refill' works?

(if this is already a thing, I'm not finding it)

Most mods continue working when the waste resource is full, just dumping the excess. In some of them, like kerbalism, you have to select dump excesses in the paw for it to work.

 

Edited by Tacombel
Link to comment
Share on other sites

20 minutes ago, DirtyFace83 said:

'Empty all '$resource$' resources in all parts of this vessel'

This would make quite a long context menu with a lot of items no one uses. Was just looking in the saves I got from others, there is one with 'Supplies', but none hase something like 'Waste'.  Ist that how it's called? Maybe add empty for this resource only?

7 minutes ago, Tacombel said:

In other cases you can dump what you want with tools like hyperedit, Crew manifest or TAC fuel manager. No need to edit the save.

That's an argument, that it would not be worth to include in KML.

Edited by Mythos
Link to comment
Share on other sites

1 minute ago, Mythos said:

This would make quite a long context menu with a lot of items no one uses. Was just looking in the saves I got from others, there is one with 'Supplies', but none hase something like 'Waste'.  Ist that how it's called? Maybe add empty for this resource only?

 

The post above yours by @Tacombel made a good point about how to manage those waste resources without needing to edit anything.

And as you said above, in almost all cases where someone wants to edit a save file for editing resources it's to add something, not remove it, and the tool works just fine as it is.

Link to comment
Share on other sites

  • 3 weeks later...

How does this work?
Just downloaded it, extracted into a folder and when trying to start the application you first get a security warning from Windows.

Ignored it and then a hint of a screen flashes up for some milliseconds and is gone again...

 

 

Link to comment
Share on other sites

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