Jump to content

Override the parts loading constraint


Recommended Posts

 

I don't know if a topic was already made about this subject but when you remove a mod each craft having a single part from it can't be load anymore, the sole solution I know is to reinstall the mod, launch KSP again, remove the parts manually then finally take the mod out of the folder again. It could be really useful to get a mean to "over pass" this impossibility and load the craft even with the missing parts.

Link to comment
Share on other sites

Yea that'd be nice. I can only imagine this being possible if some kind of "placeholder" part could be placed to substitute any missing part. In the same sense as when you get missing textures or models in a game where it's just a big question mark or any symbol. 

Link to comment
Share on other sites

3 hours ago, Red Iron Crown said:

What would happen when the part is between two other parts?

Possibly treat it as a structural failure?  Same as if the part was destroyed by overheating, essentially.  I don't know code, so I don't know exactly how difficult it would be to do, but basically having the 'missing' parts go missing when the ship's loaded.  Means if you planned far enough ahead, you might be able to save the Kerbals, and if you didn't, you've got a ship dead in the water that looks like it was used as kraken bait.

Link to comment
Share on other sites

Depending on the attachment nodes you could replace it with something innert, like a girder for tanks.  This does more difficult when a part has more obscure node placements.

however radial parts should be very easy to remove.

Link to comment
Share on other sites

6 hours ago, XB-70A said:

I don't know if a topic was already made about this subject but when you remove a mod each craft having a single part from it can't be load anymore, the sole solution I know is to reinstall the mod, launch KSP again, remove the parts manually then finally take the mod out of the folder again. It could be really useful to get a mean to "over pass" this impossibility and load the craft even with the missing parts.

Totally agree.

This particular issue has pretty much turned me off any mod that has required parts.

(Besides KER that is...gotta have me some KER.)

Link to comment
Share on other sites

2 hours ago, Rocket In My Pocket said:

Totally agree.

This particular issue has pretty much turned me off any mod that has required parts.

(Besides KER that is...gotta have me some KER.)

Same here, I even use KER in partless mode and delete the parts.  I think RemoteTech is the only part mod I use, and I'm hoping after 1.2 it will have even less necessary parts if it reuses the new stock antenna.

Edited by Alshain
Link to comment
Share on other sites

7 hours ago, Red Iron Crown said:

What would happen when the part is between two other parts? E.g. say you had a mod fuel tank between a stock one and a stock engine?

I think this may be one of those ideas that seems simple on the surface but is actually complex in practice.

 

If the deleted part is at the end of a branch of the part tree then remove the part from the craft and carry on else warn the user that the craft will be deleted if they continue.

Link to comment
Share on other sites

On 31/07/2016 at 5:35 PM, Red Iron Crown said:

 

What would happen when the part is between two other parts?

 

 

Couldn't it be possible to create some kind of a "procedural" part who could take the place of it? Imitating the diameter and adjusting the lenght.

At their best my electronic and informatic knowledges stand to weld and create small radios for the kids and editing .cfg files respectively, far from knowing how to create even a basic 8-bit game. This suggestion was more a curiosity than a "I wan' it NOW".

 

On 31/07/2016 at 9:21 PM, Rocket In My Pocket said:

This particular issue has pretty much turned me off any mod that has required parts.

 

Same situation here. I've started to build stock-only craft some times ago due to a fed-up of parts-mods updates and much more the fact some these updates were erasing old parts for new, unrecognized, ones.

Link to comment
Share on other sites

37 minutes ago, XB-70A said:

 

Couldn't it be possible to create some kind of a "procedural" part who could take the place of it? Imitating the diameter and adjusting the lenght.

Afraid not.  As I understand it, all information about a part is stored with the part.  That would include it's length.  The only thing external to it are the attachment nodes which are assigned on the attached parts.  So once the mod is deleted, the definition of the part is gone, there is no way to detect it's length or any other attribute.

This does pose a problem if you are trying to replace a part on an active craft, but not so much a problem if you are trying to replace the part on a craft you are loading into the VAB.  In the VAB you could theoretically replace it with just about anything, it would look screwball but your in the VAB so you can fix it.  The biggest concern in the VAB case is replacing the part with the same attachment nodes, as some mods have some really awkward attachment nodes. 

These cases would be very hard to adapt to, though with some intelligence I would think the game could at least reduce the number of craft that simply can't be loaded, while some would still suffer from the problem.

EDIT: Correction, the rotation of the part is also saved in the craft file, as well as a general attach position.  However the dimensions, as stated earlier, are saved in the part definition.

Edited by Alshain
Link to comment
Share on other sites

Just now, Alshain said:

Afraid not.  As I understand it, all information about a part is stored with the part.  That would include it's length.  The only thing external to it are the attachment nodes which are assigned on the attached parts.  So once the mod is deleted, the definition of the part is gone, there is no way to detect it's length or any other attribute.

Thanks Alshain, it's the information I was looking for.

Just now, Alshain said:

This does pose a problem if you are trying to replace a part on an active craft, but not so much a problem if you are trying to replace the part on a craft you are loading into the VAB.  In the VAB you could theoretically replace it with just about anything, it would look screwball but your in the VAB so you can fix it.  The biggest concern in the VAB case is replacing the part with the same attachment nodes, as some mods have some really awkward attachment nodes. 

These cases would be very hard to adapt to, though with some intelligence I would think the game could at least reduce the number of craft that simply can't be loaded, while some would still suffer from the problem.

The idea was to replace the parts in the SPH/VAB only, and in most of the case these are monop' RCS, or a tank. I got to many bad experiences in the past about throwing parts from mods away then discovering that an active ship still have one or more and disappeared with its whole crew...

 

Still by curiosity, as this proposition seems to be unrealizable without investing in greater efforts than the results they will return, could it be possible to launch a sub-program only running the SPH and/or VAB ? The biggest problem with that part missing problem is to relaunch and wait for KSP to load all the modules. Coudn't it be possible to load only the hangars ? And then replace the parts from it. Of course as the parts are with in the modules it will just give a few minutes less of waiting in the best cases.

 

Link to comment
Share on other sites

5 minutes ago, XB-70A said:

Thanks Alshain, it's the information I was looking for.

The idea was to replace the parts in the SPH/VAB only, and in most of the case these are monop' RCS, or a tank. I got to many bad experiences in the past about throwing parts from mods away then discovering that an active ship still have one or more and disappeared with its whole crew...

 

Still by curiosity, as this proposition seems to be unrealizable without investing in greater efforts than the results they will return, could it be possible to launch a sub-program only running the SPH and/or VAB ? The biggest problem with that part missing problem is to relaunch and wait for KSP to load all the modules. Coudn't it be possible to load only the hangars ? And then replace the parts from it. Of course as the parts are with in the modules it will just give a few minutes less of waiting in the best cases.

 

Nothing as fancy as the hangars, but it may be possible to make a simple external tool that parses through a craft file and lists the non-stock parts (comparing to a pre-programmed list of part names).  The biggest issue is that KSP files are not a standard serializable format (AFAIK).  That means the writer of such a tool would have to first write a parser to read the file.  It's still possible though.

Link to comment
Share on other sites

As others have said, I think replacing a missing part with some placeholder part would be tricky (read; extremely difficult to code, would be a minefield of edge cases).  It would possibly be less of an issue for loading craft in the VAB/SPH as at least the interactions between the parts don't have to be considered in the same way.  But either way it would be non-trivial. 

 

12 hours ago, Alshain said:

Nothing as fancy as the hangars, but it may be possible to make a simple external tool that parses through a craft file and lists the non-stock parts (comparing to a pre-programmed list of part names).  The biggest issue is that KSP files are not a standard serializable format (AFAIK).  That means the writer of such a tool would have to first write a parser to read the file.  It's still possible though.

I've pretty much done all the work for doing that while building KerbalX. So I've cobbled together a little script that first identifies the parts present (and which mod they are in) and then examines all the .craft files in the save folder and lists which mods each craft uses and then produces a little summary of which mods you are using and which you can remove. But it doesn't look at the save files, so it won't know anything about mods used by inflight craft.  It's also much simpler than the logic used by KerbalX, it doesn't have KX's understanding of parts and their sub modules (so it could mistake a module for part) and it can't determine the usage of partless mods (like tweakscale, FAR etc), so it may not be 100%.

When I say cobbled together I really mean it. I made this over lunch and it doesn't have much in the way of error handling, I just tested it quickly against a few craft and mods I've got installed currently.  So for Jeb's sake backup your saves before merrily ripping out mods based on what it says! 

https://dl.dropboxusercontent.com/u/9436261/ModLister/mod_lister.exe
Source code of script - http://pastie.org/private/hutty7fzyrbhl1h7zyfq 
(it's written in Ruby and the compiled into a .exe that contains all the ruby libs that it needs to function)
put mod_lister.exe into the root of your KSP install. Then open a terminal and navigate to the KSP install dir and run mod_lister.exe (if you just double click on it the terminal window will close right after it completes so you won't get to see the output).

 

Link to comment
Share on other sites

14 hours ago, Alshain said:

Nothing as fancy as the hangars, but it may be possible to make a simple external tool that parses through a craft file and lists the non-stock parts (comparing to a pre-programmed list of part names).  The biggest issue is that KSP files are not a standard serializable format (AFAIK).  That means the writer of such a tool would have to first write a parser to read the file.  It's still possible though.

.craft file is pretty much same thing as .sfs save.

I had need to play with .sfs innards so I cobbled together something on my own. Needed two more lines to support .craft files.

https://github.com/PTwr/OmNomNom

SfsEditor is thing of interest, KspDebug have sample usage. Ignore OmNomNom for now.

I threw around some comments, but piece of code should explain it better https://github.com/PTwr/OmNomNom/blob/master/KspDebug/Program.cs.

.sfs item classes are not working correctly for .craft, but custom classes can be supplied by overriding https://github.com/PTwr/OmNomNom/blob/master/SfsEditor/SfsItemConstructor.cs.

Please don't crucify me for ugly code, it is not exactly ready to be published :wink:

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