nuggreat/kOS-scripts

Logging_atm.ks prev->new issue

Closed this issue · 0 comments

I reported an issue with this code in a reddit comment and said I would follow up here on github when I found the problem. I've tracked it down, but don't really understand it.

The problem occurs in this block of code.

In my script, I have the code setup so that it pauses atmo logging in space and then continues to log atmo data when the rocket returns to the atmosphere on its sub-orbital trajectory. At the bottom you have the problem code block, which is not setting new variable data unless it detects the variable to be a proper type.

This was because I was setting the incremental variables to report as "N/A" in my log output, so when returning to the atmosphere a type error would often be thrown and crash kOS, so I made sure to wait until the atmo code actually generated number values again.

I have no idea why this is causing an issue for vehicles ascending within the atmo, but sure enough if I roll back to the logger.ks version before I made the change of checking the variable type before updating, everything works again.

I think I will try to set the variables themselves to 0 so they always remain scalar, and in the actual log output section do some IF checks for 0 and there insert "N/A" to the output.

So anyways no need for a response, just wanted to let you know it was an issue caused by me not your code. Thanks!