Jump to content

SAS Reset


Crzyrndm

Recommended Posts

All my minor mods are going into a single thread post-1.0 release. Please check my signature for the new thread

Simple plugin which adds the function to reset the SAS mode to stability assist after either SAS keybind is used (toggle/hold) or on landing. Settings file allows any of the above to be disabled (so you could have it rest only on touchdown for example)

Drop the .dll anywhere in GameData to use

Download here

License is CC0 1.0 Universal

Version 1.1

* Added config options

* Added option for reset to activate on touchdown

Edited by Crzyrndm
Link to comment
Share on other sites

Ah, so that's how you listen for control input.

Thanks for this. I'd argue that it should only apply to the toggle key, though. I use the hold button for temporary autopilot overrides.

And you always want the autopilot to try force it's way back to whatever it was doing when you unpause? I'm not likely to change that because I can just tap it to reset the SAS mode (instead of having to toggle it off and then on again).

Probably, but a quick google search turned up no solutions so I just wrote my own (~5 lines of code + some copy paste to handle vessel switching. Sometimes it's just easier to do it yourself).

The coding method has some slight differences (looking for a keypress event rather than comparing states, only finding the UI object once, etc.) but the overall effect is the same

EDIT: In my case, mods which only enable/disable SAS without changing the mode would not cause a state reset (which one of my other mods, Pilot Assistant, does do), but I'm not particularly concerned about that since I don't use stock SAS and mods which would affect SAS at the same time.

Edited by Crzyrndm
Link to comment
Share on other sites

  • 1 month later...

Honestly, this needs to be a stock change. The current functionality is slightly counter intuitive. The problem is made worse by the fact that the buttons are rather small, and sometimes you'll be fighting the SAS for control, only to realize you're locked to pro/retrograde or something.

Thanks for making this. Will try it out.

Link to comment
Share on other sites

I didn't realize this was needed? O_o Doesn't vanilla SAS reset if you turn it off and back on again?

Nope.

And of course, I'd rather you use my version. Ego and all, you know.

...but there's basically no difference to the end user between SAS Reset and ResetSAS.

Link to comment
Share on other sites

Nope.

And of course, I'd rather you use my version. Ego and all, you know.

...but there's basically no difference to the end user between SAS Reset and ResetSAS.

Sorry, just to clarify, I wasn't aware of the other mod. I was talking about the unmodded game.

And maybe I'm just confused by your meaning of "reset". In what way does it reset? Defaults back to "hold position"?

Link to comment
Share on other sites

And maybe I'm just confused by your meaning of "reset". In what way does it reset? Defaults back to "hold position"?

It sets the SAS mode back to it's default "hold current attitude" any time the user switches SAS off. Stock just leaves it in it's current mode which can be a real pain

@technicalfool

If I'd seen your version originally, this wouldn't exist (one less thing I have to find time for). Given the simplicity though, I wasn't looking too hard.

RE: Checking Inputs vs state

Polling SAS state vs. Polling user inputs both have their advantages. Polling Inputs won't affect any mods which switch SAS state (my own Pilot Assistant comes to mind) There are many cases where a mod might want SAS off, but don't bother to reset the state (:sealed: ...I need to fix that now I've thought of it... :sealed:). On the flip side of the coin, polling inputs won't fight with a mod which toggles SAS on.

GameSettings.<function> is for KSP bindings

Input.GetKey(<KeyCode>) is for a specific key

@KerbMav

Easily (ish) done. It's more a matter of finding time. I might be able to get to it over the weekend if Pilot Assistant development doesn't pop up any hurdles (big if there...)

Edited by Crzyrndm
Link to comment
Share on other sites

  • 2 months later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...