AvionicsSystems icon indicating copy to clipboard operation
AvionicsSystems copied to clipboard

Feature request: action groups exposability

Open snakeru opened this issue 5 years ago • 1 comments

Hi @MOARdV. Since you seem to support the idea, I'm filing a feature request here. ------------Desired functionality start------------------------

  • Ability to invoke MAS functionality from action groups.
  • Configurable arguments to the functions called
  • Configurable names of the functions called

Proposed list of exposed actions: SAS (stability assist/prograde/retrograde) Attitude autopilot (see below) SAS speed mode (surface/orbit/target) ------------Desired functionality stop------------------------ I quite realize that some of that might be infeasible too cumbersome for players to actually be useful, it's just to have some material for the discussion.

I did some research (looked into BARIS code) and have found in a nutshell, adding the callback is rather easy. That's how they do it:

        [KSPAction(guiName = "Toggle Resource Locks")]
        public void ToggleResourceLocksAction(KSPActionParam param) { ... }

So there might be a set of modules each having a single action - and the modder will include these modules that he'd like to have.

One problem here is that the guiName is not configurable. So if there would be configurability, then one will have to deal with action texts like "Execute action A" and "Execute action B" (with actions A and B possibly configured through the monitors or the vehicle description).

The possible use-case would be "programming" the ascent using the "smart parts" mod. This mod allows to automatically trigger pre-programmed action groups once a certain condition is reached. Say, a fuel level or an altitude.

The most tricky part would be giving the ship the initial inclination for the gravity turn. I noticed that there is an attitude autopilot in MAS already so it would be nice to expose that one. However, it requires some arguments. Here is how this could be done:

  1. An IVA setting. Say, a rotational knob named "AttitudeA" and where one can set the value from 0 to 90 accompanied by a second knob that defaults to 90 and can be used to select anything in the range of 0...360. The group action then also will be called "AttitudeA".
  2. Taking values from the action group descriptions. AG1=AttitudeHold[80E] - will incline ship 10 degrees from vertical in east direction. The problem: I'm not sure if it's known which AG was triggered
  3. Configure attitude autopilot with a separate line and then consequently take next values: AA=80E/5E/0E # This will make AA to hold 80 degrees east first time it is activated, then 5 degrees east and then 0 degrees (horisontal) for the third, forth and so on times.

Another thing that will have to be exposed would be sas speed mode. Otherwise the ascent efficiency might be ruined.

snakeru avatar Mar 30 '19 16:03 snakeru