Jump to content

0.20 Part.cfg Updater


Ph34rb0t

Recommended Posts

What is this?

This collection of batch scripts updates the part.cfgs in all the subfolders of a given folder to the 0.20 spec, i.e. by adding the "PART { }" container. This is especially useful for updating large packs like KWRocketry or NovaPunch.

As a bonus, it looks for a "scale = 1.0" or "scale = 0.1" line in the part.cfg and displays an error message if either can't be found (or "scale" is 0.1). That way, you see immediately what parts need additional intervention. (See here for more info about scaling.)

Adverse effects when used in conjunction with a mod manager for 0.20 (like this one) may occur! Be careful!

If you're running KSP on Linux or Mac, use ChaserGrey's Python script.

Download & Installation

Download here

1. Download the archive

2. Unzip it to a temporary folder

3. Move all the parts of e.g. KWRocketry to [KSP 0.20 folder]\GameData\KWRocketry\Parts (create folders if necessary)

4. Copy RUNME.bat and ScaleChecker.bat to ...\KWRocketry\Parts

Usage

Do not use this on internals!

1. Run RUNME.bat

2. Wait

3. Browse the console output for any errors (Hint: Look for "=====" to quickly identify parts with potentially noncompliant scaling)

Note: All part.cfgs will be backed up!

Recovery

The original, i.e. pre-0.20 part.cfgs can be recovered by copying "Revert.bat" into e.g. "...\KWRocketry\Parts" and running it.

Scales

If you're unhappy with your scaling edits or if the dev team fixed the "scale = 1.0" behaviour in a future update, just copy "Revert SCALES ONLY.bat" into, e.g. "...\KWRocketry\Parts" and run it. It will restore any part.cfgs that needed to be fixed with "scale = 1.0" to their 0.20 state.

I hope that this will be useful to some of you.

Maybe I'll do a bash version for the penguins among us.

Edited by Ph34rb0t
Link to comment
Share on other sites

Sadly, when I used it the files that already had "PARTS {" got whacked! Just under where it put the verbiage "PARTS {" it had very odd ASCII characters.

Is this to be expected?

TB

Can you take a screenshot so we can see what you mean?

Link to comment
Share on other sites

1. Installed KW-Rocketry-0.2.33 using Kerbal Space Program Mod Manager (rev 1.5.6.1)

2. Copied files "RUNME.bat" and "ScaleChecker.bat" into "parts" directory created by KSPMM

3. Ran RUNME.bat

some files look proper, but others do this:

[img

]PARTSissue.jpg

Link to comment
Share on other sites

Should I be able to run ScaleChecker.bat by itself and have it come up with results? It does not seem to want to run independently of "RUNME".

TB

looks like you ran it with a part{} already, I think it's not fully automatic, You still need to know what has part {} and what has not

Link to comment
Share on other sites

yes, looks like as the above poster said, the parts already have been edited...

All I can suggest is to delete the 3rd and 4th lines :) - also check the last line as it may have an extra } in it - should be 2 at the bottom, you will prob find you have 3

Also, nothing against mod managers, but be careful, I am not sure if the mod managers are capable of reading files that are not in the correct directory structure, I have seen comments on people that use them having problems sometimes cause the manager doesn't put things where they are supposed to go.

Link to comment
Share on other sites

...

Is KWRocketry 0.2.33 updated for 0.20?

If so, you won't need to use these scripts.

If you *did* use these scripts on a mod already made ready for 0.20 just run "Revert.bat" and you'll get your original configs back.

Should I be able to run ScaleChecker.bat by itself and have it come up with results?

It's not designed to be run by itself.

Link to comment
Share on other sites

Hi,

Ran the bat file - works fine...

However why not just do a search for "scale"; if it is found just reset to "= 1" ?

If not why cannot you add the line "scale = 1" like you added the Part {} strings?

Thanks !

Cdr Zeta

Link to comment
Share on other sites

I noticed that on some parts if I set the scale to 1 the attachment points (green balls) changed and the shape / size got whacked, primarily the struts. Changed the scale back to it's original, (typically 0.1) and they worked fine, (or seemed to). Am I overlooking something or is the "Scale = 1" a mandatory change and something else in the config file needs to be changed?

TB

Link to comment
Share on other sites

If not why cannot you add the line "scale = 1" like you added the Part {} strings?

I initially had a script for that, but it didn't work for all configurations. Hence, you'll need to apply any changes yourself.

I noticed that on some parts if I set the scale to 1 the attachment points (green balls) changed and the shape / size got whacked, primarily the struts. Changed the scale back to it's original, (typically 0.1) and they worked fine, (or seemed to). Am I overlooking something or is the "Scale = 1" a mandatory change and something else in the config file needs to be changed?

http://forum.kerbalspaceprogram.com/showthread.php/30559-20-And-mods?p=386545&viewfull=1#post386545

It at least worked with all the 0.1 scaled parts I have installed.

Link to comment
Share on other sites

Adverse effects when used in conjunction with a mod manager for 0.20 (like this one) may occur! Be careful!

This is most likely because KSPMM does the same thing when installing a mod. KSPMM will go trough every part file, and check if the "PART { }" wrapper is correct. And add it if needed.

Also, I would like to address the rumors that Mod Managers may not always put things where they are supposed to go.

I can't speak for other mod managers, but KSPMM has always gotten everything in the right folder.

The problem lies when mod makers put more than one mod in the same zip file.

And sometimes uses new folders that I haven't added yet in KSPMM. As of the latest version, all the folders should be included.

For more info on this topic, and how KSPMM handles mods, check the link provided in the OP or Quote from the OP here.

Sorry for addressing those rumors here. If you want me to, I can delete the. And just keep the first sentence.

Not trying to advertise KSPMM or take away focus from your Part.cfg Updater. It's a very useful batch script. ;)

Link to comment
Share on other sites

  • 3 months later...
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...