Kerbal Inventory System (KIS)

Kerbal Inventory System (KIS)

1M Downloads

NRE detaching and reattaching part with FAR

Brusura opened this issue · 5 comments

commented

When you detach and reattaching a part there are many NRE

Tested on:
KSP 1.1.2
KIS 1.2.9
FAR 15.6.3
ModuleManager.2.6.24

Steps to replicate:

  1. Go in SPH , add Pod with a structural fuselage, and a solar panel
  2. launch detach the solar panel and attach it on the pod

Ferram already said that is something related on how KIS create and destroy part in this post:

http://forum.kerbalspaceprogram.com/index.php?/topic/19321-112-ferram-aerospace-research-v01563-kindelberger-43016-win64-compatibility/&page=477#comment-2542075

Output_log.txt
output_log.txt

craft file
Auto-Saved Ship.zip

video
https://youtu.be/W_nPeBJjHLQ

commented

Looks like you've provided enough data for reproducing the problem. Though, for now I don't have time to start working on the issue. If you could investigate the issue from the code perspective it would help a lot. First thing we need to know is the exact code line that throws NRE.

commented

Can I somehow help with the testing?

commented

WIsh I could do that, but my programming skills are long forgotten sigh , I suppose I should start from installing unity 5 °_° grab both mod source and run some debugging tool dunno if I can do that I'll see

commented

Well, after all it's not exactly KIS issue. I'd say its triggered by KIS but the issue itself in the FAR. When moving part KIS does decouple/couple of the moving part in the same frame. FAR reacts on the vessel change event and tries to start tracking a new vessel from the moving part. Which, of course, fails since there is no such vessel at the moment.

Need to figure out how to better deal with it. Probably the safest solution would be checking for vessel existence in FAR. On the other hand, I was going to let moving part hanging detaching for at least one fixed update to have it properly deinitialized but it's not that straightforward.

commented

WORKAROUND. Don't move parts on a vessel. Instead, deatch and put it aside (or store in inventory), then attach as needed.