Game Scenes#

Anything that can be called is configured to be available from a particular game scene, or scenes. This includes service procedures and properties, and class methods and properties. This is controlled by the following enumeration:

enum KRPC.Service.GameScene#
Inherit#

Inherit the game scene from the class hierarchy and the services. This is the default.

All#

All game scenes.

SpaceCenter#

The game scene showing the Kerbal Space Center buildings.

Flight#

The game scene showing a vessel in flight (or on the launchpad/runway).

TrackingStation#

The tracking station.

EditorVAB#

The Vehicle Assembly Building.

EditorSPH#

The Space Plane Hangar.

Editor#

Either the VAB or the SPH.

MissionBuilder#

The mission builder.

AstronautComplex#

The astronaut complex facility, open within the space center scene.

MissionControl#

The mission control facility, open within the space center scene.

ResearchAndDevelopment#

The research and development facility, open within the space center scene.

Administration#

The administration facility, open within the space center scene.

The special enumeration value KRPC.Service.GameScene.Inherit can be used to inherit the game scene setting. Game scene inheritance works as follows:

Game Scenes and Required Mods gives the full order, which the required mods share.

Examples

  • Declare a service whose procedures are available in the KRPC.Service.GameScene.Flight game scene:

    [KRPCService (GameScene = GameScene.Flight)]
    public static class MyService {
        // ...
    }
    
  • Declare a service whose procedures are available in the KRPC.Service.GameScene.Flight and KRPC.Service.GameScene.Editor game scenes:

    [KRPCService (GameScene = (GameScene.Flight | GameScene.Editor))]
    public static class MyService {
        // ...
    }
    
  • Declare a service whose procedures are available in the KRPC.Service.GameScene.Flight game scene by default, and declare a procedure which overrides this and is available in all game scenes:

    [KRPCService (GameScene = GameScene.Flight)]
    public static class MyService {
        // ...
    
        [KRPCProcedure (GameScene = GameScene.All)]
        public static string MyProcedure() {
            throw new NotImplementedException ();
        }
    
        // ...
    }