taniwha / Extraplanetary-Launchpads

GNU General Public License v3.0
53 stars 45 forks source link

Bug: Trying to finalize build with Trajectories installed causes vessel load to fail #163

Closed SprocketCreations closed 4 years ago

SprocketCreations commented 4 years ago

When I click finalize build, nothing appears to happen, but if I'm in orbit the camera gets left behind; and the console is flooded with errors. It even crashed during one test.

Contents of my gamedata folder: Contents of my game data folder Snipped from KSP.log:

G 10:13:35.409] [EL Launchpad] dewarp
[LOG 10:13:35.626] [FlightIntegrator]: Vessel Untitled Space Craft has been unloaded 16.0039086914062, applying analytic temperature 310.213341113292
[LOG 10:13:35.629] Unpacking Untitled Space Craft
[WRN 10:13:37.232] [Part]: PartModule indexing mismatch at probeCoreOcto.v2, index 5.
Node 'ModuleTripLogger' found in loaded data, but 'TrajectoriesVesselSettings' is defined in prefab.
Looking for ModuleTripLogger in other indices...
[WRN 10:13:37.232] ...ModuleTripLogger module found at index 6.
[LOG 10:13:37.240] Ion-Powered Space Probe loaded!
[LOG 10:13:37.241] [EL] GetVesselBox (0.0, 15.0, 0.0) [(-0.9, 14.2, -0.6),(0.9, 15.6, 0.6)]
[LOG 10:13:37.241] [EL]   (-0.9, -0.8, -0.6) (0.9, 0.6, 0.6)
[LOG 10:13:37.243] [Ion-Powered Space Probe]: Ready to Launch - waiting to start physics...
[LOG 10:13:37.245] [FLIGHT GLOBALS]: Switching To Vessel Ion-Powered Space Probe ---------------------- 
[LOG 10:13:37.245] Packing Untitled Space Craft for orbit
[LOG 10:13:37.246] [PlanetariumCamera]: Focus: Untitled Space Craft
[LOG 10:13:37.256] Vessel assembly complete!
[LOG 10:13:37.259] [Trajectories] New vessel, profiles created
[LOG 10:13:37.260] ObT : NaN
M : NaN
E : NaN
V : NaN
Radius: NaN
vel: [NaN, NaN, NaN]
AN: [1, 0, 0]
period: 0

[WRN 10:13:37.260] [OrbitDriver Warning!]: Ion-Powered Space Probe had a NaN Orbit and was removed.
[LOG 10:13:37.261] Ion-Powered Space Probe Unloaded
[LOG 10:13:37.269] [PlanetariumCamera]: Focus: Kerbin
[EXC 10:13:37.288] NullReferenceException
    UnityEngine.Transform.get_position () (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    FlightGlobals.getFoR (FoRModes mode, UnityEngine.Transform referenceTransform, Orbit orbit, CelestialBody body) (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    FlightGlobals.GetFoR (FoRModes mode) (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    FlightCamera.GetCameraFoR (FoRModes mode) (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    FlightCamera.LateUpdate () (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[EXC 10:13:37.310] NullReferenceException
    UnityEngine.Transform.set_position (UnityEngine.Vector3 value) (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    Vessel.SetPosition (Vector3d position, System.Boolean usePristineCoords) (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    ExtraplanetaryLaunchpads.ELBuildControl+<CaptureCraft>c__Iterator1.MoveNext () (at <d36de133894b4c2dada2f696f5429a3a>:0)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[EXC 10:13:37.312] NullReferenceException
    UnityEngine.Transform.get_position () (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    FlightGlobals.getFoR (FoRModes mode, UnityEngine.Transform referenceTransform, Orbit orbit, CelestialBody body) (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    FlightGlobals.GetFoR (FoRModes mode) (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    FlightCamera.GetCameraFoR (FoRModes mode) (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    FlightCamera.LateUpdate () (at <c1858a3f77504bd1aaa946fdccf84670>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
taniwha commented 4 years ago

I very much doubt this has anything to do with KIS (I do most of my testing with KIS installed), far more likely to be Trajectories as it would want the current vessel position. However, I am currently working on a fix for the orbit driver issue that causes the vessel to be deleted, which I think is the cause of those NREs.

SprocketCreations commented 4 years ago

I must have been really tired when I was doing the testing to have failed to notice that I had trajectories installed. Yeah, it was the problem. Should I update the bug report?

taniwha commented 4 years ago

It will help, I think. BTW, I've got the basics of the fix working, I just need to polish it up.