Jump to content

Craft File Color Tool


DadJokeCinema

Recommended Posts

So I've been playing around with a tool to parse the JSON craft files, and one of the first things I wanted to do was to be able to match up colors perfectly. To do this, I put up the first version of a tool that allows you to cut and paste from the VAB into a text box, or save a JSON file and load it. The tool then gives you part count, a hierarchy of the craft parts in tree view, and a few details about each part and the resources they carry. The Color Editor tab lets you see all colors present on the ship, and by selecting a part, you can use the color selector to pick a new base or accent color using RGB, HSV, or Hex. After making your changes, you can copy the JSON out of the text area and paste back into the VAB.

A short video demonstration is here:

 

The tool is currently sitting at https://ksp2-craft-tools-46qsp.ondigitalocean.app/


LIMITATIONS: 
* pasting in a huge JSON file can take a few seconds, just be patient.
* copying and pasting back into the VAB sometimes messes up fairings and symmetry. I think that's more a KSP2 thing than the tool.
* not a ton of aggressive cross browser testing, it seems to work fine in Chrome.

 

I made it for my own curiosity, but I'm open to feedback and bug reports.

Link to comment
Share on other sites

Right now, there are problems with the symmetry sets when you duplicate parts, or try to attach something to a new location. So, like, if I build a sub-assembly with some symmetrical attachments, and then try to attach that sub-assembly with a different symmetry to a craft, the symmetry often ends up being correct on one copy of the part, but messed up on all the other instances. If you're looking for suggestions on where to expand the editing tool. I wouldn't mind something that lets me pick parts and fix the symmetry sets for cases like that. E.g., if I have a left wing sub-assembly and a symmetrical right-wing sub-assembly, have an option in the tool that fixes the right wing to have the same symmetry groups as the left wing.

Right now, I have to try and do that by hand, or do various workarounds, and that's painful.

Also, save files are JSON with a lot of similarity in how the craft are stored. Being able to apply all of the edits to craft in flight in a save file might be useful.

Link to comment
Share on other sites

8 minutes ago, K^2 said:

Right now, there are problems with the symmetry sets when you duplicate parts, or try to attach something to a new location. So, like, if I build a sub-assembly with some symmetrical attachments, and then try to attach that sub-assembly with a different symmetry to a craft, the symmetry often ends up being correct on one copy of the part, but messed up on all the other instances. If you're looking for suggestions on where to expand the editing tool. I wouldn't mind something that lets me pick parts and fix the symmetry sets for cases like that. E.g., if I have a left wing sub-assembly and a symmetrical right-wing sub-assembly, have an option in the tool that fixes the right wing to have the same symmetry groups as the left wing.

Right now, I have to try and do that by hand, or do various workarounds, and that's painful.

Also, save files are JSON with a lot of similarity in how the craft are stored. Being able to apply all of the edits to craft in flight in a save file might be useful.

Save files are my next move - you can't just straight yank them out of the save file and paste into the VAB, probably because of the lack of VAB root part guid, but that's an easy fix.

The symmetry sets and struts are separate sections in the file, so they shouldn't be impossible to parse and display them. I'm worried that the issue is on the KSP2 side. It will take more investigation.

Link to comment
Share on other sites

43 minutes ago, DadJokeCinema said:

I'm worried that the issue is on the KSP2 side.

There's definitely an issue on KSP2 side, but usually one of the parts (the one you're actually dragging) pastes correctly, so it looks like it might be possible to fix in data. But I've only looked at some specific cases where I was able to fix things manually, and the general case might be trickier. If you plan to have a repository for this, I don't mind taking a crack at it myself and submitting a PR. I'm just absolutely terrible at UI, so it'd take me an eternity to make something remotely functional from scratch, but I can contribute to something like this if you'd like.

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