Nivekk / KOS

Fully programmable autopilot mod for KSP.
Other
80 stars 30 forks source link

Encounter = "None" on entering parent SOI. #272

Open adammada opened 10 years ago

adammada commented 10 years ago

So, i want to go from Mun to Kerbin. Sadly, when i add node which leaves Mun SOI, i still have Encouter=None.

So i cant check periapsis over Kerbin.

I think that any SOI change should give Encounter. Leaving Kerbin SOI should give Kerbol encounter, leaving moon SOI should give planet encounter.

adammada commented 10 years ago

There can be problem which encounter to show when going to interplanetary transfer. First solution;

bshepherdson commented 10 years ago

Maybe a general solution is the right thing? A way to check your periapsis relative to any body.

On Sat Nov 23 2013 at 11:22:50 AM, adammada notifications@github.com wrote:

There can be problem which encounter to show when going to interplanetary transfer. First solution;

  • set "parent" encounter as last in priority (so only show when there is no other encounter)
  • use other name than encounter for "parent" encounters

— Reply to this email directly or view it on GitHubhttps://github.com/Nivekk/KOS/issues/272#issuecomment-29135382 .

Dunbaratu commented 10 years ago

Your path passes through multiple SOI's Each with its own peripasis (and if it's got you captured, an apoapsis). Perhaps getting your encounter should be a matter of choosing a number N for how many SOI's away from now you're talking about, i.e:

ENCOUNTER(0):PERIAPSIS is the same as just PERIAPSIS (use a numbering convention where zero is your current SOI) ENCOUNTER(1):PERIAPSIS is the periapsis of the next SOI you'll be in. ENCOUNTER(2):PERIAPSIS si the periapsis of the next SOI after that. and so on.

adammada commented 10 years ago

i would do:

because its easisest in implementation (just change of backend code, no changes to language). And you could always add ENCOUNTER(x) solution later, if needed.

MaHuJa commented 10 years ago

Subject to #274, the above commit will give the last escaped-to body if you never encounter anything. For example, if you are in the Mun's SOI, and you escape kerbin, it will say sun rather than kerbin. But if you somehow encounter Duna after that, that's what it will report.