Reproduction of this issue is 100% across 30+ launches.

When Periapsis (or any other ship parameter) does not have a value yet, it is reported as NAN in the Visual Scripting environment (VIZZY).

Because NAN is not a number, none of the comparison operators can be used with it, all comparison operators against a NAN value will always return false 100% of the time. This breaks scripts.

Test Case:
- Output Orbit:Periapsis to the screen for the entire time during flight while Periapsis is still N/A on UI Orbit category.
- It will Report NAN.

The following loop has a 100% failure rate when Periapsis does not have a value yet on UI:
- while(Orbit:Periapsis less than 6000)
- -- loop contents never execute unless periapsis is an actual number

Since NAN is not a number, Comparing (NAN less than 60000) will always result in false. This makes various ship parameters unreliable inside Vizzy.

Requested Fix: None of the ship parameters should ever report NAN in the VSL (VIZZY), they should always report 0 (Zero) when no value (N/A) exists yet.

It is also impossible to check for NAN in the VSL - because there is no way to test if a value is actually a number.

Discussion Submitted

1 Comment

  • Log in to leave a comment
  • Profile image
    209 mreed2

    Not a fix -- but NaN is a string, and you can detect it using the "contains" operator. So, while ("NaN" contains Orbit:Periapsis or Orbit:Periapsis < 6000) will work (if awkwardly).

    In regards the specific issue being discussed, the orbital parameters accessed via the "Craft" Vizzy object are far more likely to be defined. The values in the Orbit widget are configured to match the values that you see in the Map screen -- they are "friendly" and thus apoapsis and periapsis subtract the radius of the planet. The ones that come from the "Orbit" widget are suitable for use in equations of orbital motion and are "raw," so [i]don't[/i] subtract the radius of the planet. When a craft is sitting stationary on the launchpad, Orbit:Periapsis will be NaN, but Craft:Periapsis will be defined (as a very small number, located inside the planet). Obviously, Craft is more difficult to work with, but its another option.

    14 days ago

No Upvotes

Log in in to upvote this post.