Jump to content

Solved! How to change the root part of a craft!


Recommended Posts

Good news everyone!

I just wrote a Python script to change the root part of a .craft file!

You'll need Python 3.3.2 or superior, found at http://python.org/

As such, it should work on many platforms, and if you have linux you probably already have Python.

Usage:

Windows:

(path to python)\python reroot.py (craft file path/name) (part number to become root)

Linux:

you probably don't need the path to python or even to type python. Use '/' when appropiate.

If no path is supplied, it will look for the craft file in the current directory. The ouput is a new file with the original name plus a "_rootx" x being your supplied part number.

The part number to become root is which part you want to be root, counting from 1.

For now, you gotta open the craft file with a text editor, identify which part you need to be root and count its position.

To help you, you got to know that a part starts with a

PART

{

and soon there's a line that says

partName = (something)

which gives you a very good clue. Maybe you miss and you wanted another part with the same name. Try again.

This is a very first working version and there's zero error or bad input file tolerance. If the file does not exist or the number is not a number, you will get an error. Backup your file (though it should be untouched).

Not tested on linux (as of yet). Ship may experience unexpected structural failure (nah).

All corrections and suggestions are welcome. Feel free to fork in sourceforge or translate the code to c# to build a mod! (i really want someone to do that!).

You can download it here: https://sourceforge.net/projects/kspcraftreroot

Link to comment
Share on other sites

Not sure what you were searching for, but googling "ksp change root part" turns up the SelectRoot mod right on the first page for me.

Now you can start wiggling and turning the knife in the wound. Finish him off!

Edited by Jackissimus
Link to comment
Share on other sites

Yup...the search on KSP Spaceport BLOWSS!!!!!!...I can type the EXACT, FULL title of a mod, much less just a relevant word, and it MAY show up near the bottom of the page, or maybe somewhere on the 2nd page, or maybe not at all...??

So I use "site:http://kerbalspaceprogram.com/" in the Google search with whatever I am looking for...(you dont type use the " ")...This usually brings up the EXACT mod right in the first couple links.

And yes, I've had to resort to this method on a couple other forums I am on, as well... :(

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