Jump to content

Crafty: preview


Recommended Posts

332wcbt.jpg

'Crafty' is a graphical Java application designed to analyze .craft files and report what mods/parts packs the ship uses. At the moment, it can only identify parts from these sources:

Stock parts

Mechjeb 1.7._

BACE Construction Co. 0.1

The program is in a usable state otherwise. All I need to do is flesh out the information in the database.txt file so it can recognize other mods. This will take some time because it means I need to download every plugin and every part pack so I can identify the part names. I\'m almost done cataloging the files from the 'Plugin-Powered Addon Releases' section, so expect an update soon.

Old version information:

In response to the thread 'Distribution Methods for 'Amalgamated' Ships' (

http://kerbalspaceprogram.com/forum/index.php?topic=7144.0), I have decided to create a modest Java command line program that takes a .craft file and lists all the parts of a ship in alphabetical order.

It\'s pretty crude at the moment, and you need to be able to run Java on the command line to use it. I plan to upgrade it with a simple graphical interface and package it as a .jar file, but I wanted to show you guys a proof-of-concept first.

So you take a ship like this:

testcraft.png

And run it on the command line...

a586ww.jpg

And there you go!

Make sure to put a slash at the end of your KSP folder path name. The program isn\'t very forgiving of errors at the moment.

Link to comment
Share on other sites

May I also suggest having a counter of some sort to identify how many of that part are on the ship? That could just be off to the side or something, for those who need it.

Nice program you got here! 8)

Link to comment
Share on other sites

Good suggestions. I can scan the parts and find the proper in-game \'title\' as it appears in the VAB, and maybe give the name of the part folder the .cfg file lives in. As far as telling you what pack it came from, we\'d need to make a database file of all the packs on the site and the parts contained inside. That list would need upkeep, of course. Definitely possible.

EDIT:

The program now lists all the parts you have installed and some information about them. I\'ll see about making a GUI and Jar package for this.

nlenv9.jpg

Link to comment
Share on other sites

Listing the internal part name, the folder name the part is in and the actual part name from it\'s config would probably be enough. As far as the user cares, they don\'t even need to see the internal name, or even the part name - They just need to know where to get it, but listing names would give good feedback.

Think you could add an option to auto-zip the craft and all contents into appropriate folders in an archive? That would make it perfect for everyone sharing ships. Anyone know if you can use the Windows archiver from the command line? Pkzip maybe?

Link to comment
Share on other sites

Interesting... bundling a craft file with its required parts? If I could make a GUI that lets you drag-and-drop, that would be pretty cool.

Wow, I haven\'t written a Java program for a loooong time. Gotta study my old stuff and figure out how to make Swing applications!

Link to comment
Share on other sites

That\'d be awesome, but if you\'re packing the ship with other people\'s parts, you may run into some issues regarding ownership there.

Personally, I would have no problem whatsoever with anyone else using my parts in a craft file package such as this, as long as no claims of ownership to my stuff is made, but I know other people prefer to have users only get the content from the developers themselves.

Link to comment
Share on other sites

Think you could add an option to auto-zip the craft and all contents into appropriate folders in an archive? That would make it perfect for everyone sharing ships. Anyone know if you can use the Windows archiver from the command line? Pkzip maybe?

Please do not do this; it\'s not even the ownership issues, its version control; you\'ll have specific parts from random packs, perhaps several versions old, floating around. Install a ship with an older version and you overwrite the newer version of the mod you have installed. Even if you could add in backup/restore functions, its a mess (and you\'re replicating the functions of the Generic Mod Enabler in a lot of cases.

Add that on top of the ownership/distribution issue and its not something that should happen; if you could install 'ships' as standalone/binary entities that didn\'t require parts to be installed in the parts folder, it might be different.

Link to comment
Share on other sites

You know, Tib, as I was typing that I was thinking exactly the same thing. Could get pretty messy.

The other option then is just to let people find the listed parts themselves, or the poster to find them and make links. Still a PITA, but the app still does it\'s job and tells you what it\'s made of at least. It\'s a shame there\'s no better way to automate it safely.

Link to comment
Share on other sites

I\'ve compiled a database file that the program will eventually use to tell you where your parts came from. I think I covered all the downloadable parts from 'Collections', 'Part packs and Parts', and 'Plugin Releases' (except for KW Rocketry).

File is in plain-text with one part per line, formatted like this:

internal part name, part folder name, parts pack name

Feel free to use this however you want. You can do a manual search for a folder name on the text file if you need to find something.

Link to comment
Share on other sites

Well, the part description doesn\'t always tell you what mod pack it came from. What this program will eventually do is this:

1. Make a list of the parts/mods you have installed

2. List all the parts in a .craft file

3. Tell you what parts in a .craft file you are missing, and what the name of the folder/parts pack is (using that text file I made)

So, walking through an example of what will happen when I finish more of the program:

Give it a .craft file. The program finds entries that look like this:

{

part = basekitFuelTank_4294927144

pos = 0.2661144,20.36475,0.1843084

rot = 0,0,0,1

istg = 0

dstg = 0

sidx = 1

sqor = -1

attm = 0

link = basekitEngine_4294926666

attN = top, basekitReactor_4294928738

attN = bottom, basekitEngine_4294926666

}

Then it looks at this line:

part = basekitFuelTank_4294927144

And it discovers that your ship is using a part named 'basekitFuelTank'.

It looks it up in the text database and finds:

basekitFuelTank, basekit_FuelTank, BACE Construction Co 0.1

And finally, the program tells you, you are missing 'basekitFuelTank', that it can be found in the folder 'basekit_FuelTank', and that this part is in the 'BACE Construction Co 0.1' pack. You can plug that into the forum search bar and find the mod easily.

Link to comment
Share on other sites

Yes, that information is more useful to the end-user. I just use the name from the .craft file and match it to the parts.cfg and then report the name of the folder for human usage.

EDIT:

Made the interface, and it\'s ugly but it works. It currently only lists the parts installed verbosely, and lists the parts of a craft by name. It still runs from the command line because I haven\'t made a .jar file yet.

Link to comment
Share on other sites

  • 3 weeks later...

Yeah, I think the downloads got messed up when they migrated the forums.

I\'ve decided I should make this an online Java applet. The only thing it will do is list which parts packs are used by a .craft and give you URLs for the threads you can download them from. I expect to work on this more tomorrow and get down to cataloging more of the new parts.

Link to comment
Share on other sites

  • 3 weeks later...

Alright, I\'ve advanced this project into a more usable state. I\'d like it to be an online applet, but I\'d have to go to some extra trouble to make it happen. It\'s limited right now to a couple packs but I expect to expand it very soon.

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