Simpit-team / KerbalSimpitRevamped

A revamp of the Kerbal Simpit Mod for KSP
BSD 2-Clause "Simplified" License
26 stars 15 forks source link

[Feature]: Add a "Vessel changed" message #87

Closed Tetopia closed 1 year ago

Tetopia commented 1 year ago

The problem

When changing vessels in the game the controller might be in an inconsistent state to the vessel you changed to. E.g. if using an unmotorized potentiometer as a throttle, the potentiometer might be set to a different value than the ships throttle, maybe resulting in unwanted thrust. If you got a notification every time the ship changes you could discard all inputs in question until you've insured consistency between you controller and the current vessel in game. Maybe even flash an LED to notify the player about the inconsitencies.

Feature request to solve the problem

Send a VESSEL_CHANGED_MESSAGE message every time the game switches to a different vessel.

Nearest features that are already in the mod

You can use the SCENE_CHANGE_MESSAGE to get a notice when entering the flight mode. You can use the VESSEL_NAME_MESSAGE to get most of the vessel changes. But this only workes when the two vessels have different names. You can track single values (like the throttle) and note when they change without the player changing the input (e.g. player has not moved throttle in the last second)

PBechon commented 1 year ago

Added in 0fd24fd2840e6a0557318724863d45d326540af2