Skip to content
This repository has been archived by the owner on Oct 26, 2020. It is now read-only.

Log NRE when going to a vessel on the launch pad #52

Closed
supermerill opened this issue Feb 26, 2015 · 5 comments
Closed

Log NRE when going to a vessel on the launch pad #52

supermerill opened this issue Feb 26, 2015 · 5 comments

Comments

@supermerill
Copy link

Hi
I'm loading a game
I'm going to the vessel in the launch pad (from the save, previous rollout).
The log show a nre, but nothing seem broken.
I'm running with some mods, i can try without if necessary.

The version:
{
"NAME":"Kerbal Construction Time",
"URL":"http://magico13.net/KCT/.version",
"DOWNLOAD":"http://forum.kerbalspaceprogram.com/threads/92377-0-24-2-Kerbal-Construction-Time-Release-v1-0-2-%289-3-14%29",
"CHANGE_LOG_URL":"http://magico13.net/KCT/KCT_changelog",
"VERSION":"1.1.2.0",
"KSP_VERSION":{
"MAJOR":0,
"MINOR":90,
"PATCH":0
}
}

The log:
[...]

[LOG 22:33:44.742] ------------------- initializing flight mode... ------------------
[LOG 22:33:44.763] Target vessel index: 7 vessel count: 8
[LOG 22:33:44.765] [FLIGHT GLOBALS]: Switching To Vessel test thermo ----------------------
[LOG 22:33:44.767] setting new dominant body: Kerbin
FlightGlobals.mainBody: Kerbin
[LOG 22:33:44.770] Reference Frame: Rotating

[...]

[EXC 22:33:45.935] NullReferenceException: Object reference not set to an instance of an object
KerbalConstructionTime.KerbalConstructionTime.DelayedStart ()
KerbalConstructionTime.KerbalConstructionTimeData.OnLoad (.ConfigNode node)
ScenarioModule.Load (.ConfigNode node)
ScenarioRunner.AddModule (.ConfigNode node)
ProtoScenarioModule.Load (.ScenarioRunner host)
ScenarioRunner+� .MoveNext ()

I can attach a savegame if necessary.

@magico13
Copy link
Owner

Could you possibly include the full log (specifically the output_log.txt file from the KSP_Data folder)? The save file may be helpful as well. If you load up the game again to retest, please turn on the Debug Messages setting in the KCT settings.

That error is a very bad one. Where it occurs is during loading of the persistence data, which will result in some serious issues that might not seem present at first. It's definitely something related to KCT though, since it happens inside one of KCT's functions. Often similar issues occur from other mods, but not in this instance.

You may want to try one of the development builds to see if that makes the problem go away (in which case I've likely already fixed it). At the very least, the dev builds have some extra functionality that detects when issues like this occur and will let you know that something's wrong.

@supermerill
Copy link
Author

To turn on the debug message, it's VERBOSE_DEBUG_LOG, right?
anyway, here the log, without additional plug-in, on a new game, with the latest dev build (and the savegame)
To reproduce, load the save and click on the green rocket at the launchpad.
kct_dev_build
log:
http://pastebin.com/pdnZspE8
savegame:
https://mega.co.nz/#!J5AwQSIb!CjpwK4nfVLAXcCI-Fh2Q64aB9FrwqZsjSfjK3x_F5BE

@magico13
Copy link
Owner

The debug messages I was mentioning are specific to KCT and are in the KCT settings, but since you were using the development build they were automatically enabled, so no worries about that.

I think I know what the problem is. The good news is that's it's a simple fix and as long as you don't have any other mods that need to read from the save file after KCT does then there shouldn't be any actual issues with continuing the flight. I may have a potential fix if you're willing to change one line in your save file (until I get home later and fix it on my end): find the "sit = PRELAUNCH" line in the save and change it to "sit = LANDED" (without quotes in both cases).

If you're interested in what exactly is going wrong, it's this: KCT didn't expect people to launch a craft without actually going through with the launch. When the flight scene is loaded up to a craft that's sitting on the pad (PRELAUNCH) it tries to remove the craft from the appropriate VAB/SPH Storage. Since the craft wasn't launched in this game session, there isn't a valid KCT_GameStates.launchedVessel, so it creates a Null Reference Exception. The fix is to check if that's null, and if so then obviously don't try to remove it from the build list! It's a one line fix :)

I'll have this taken care of tonight.

magico13 added a commit that referenced this issue Feb 28, 2015
@supermerill
Copy link
Author

sit = LANDED => it works!
Ok, a simple one ^^.
glad I could help enhance an already excellent product.

@magico13
Copy link
Owner

I also fixed it on my side so it shouldn't be an issue in the future :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants