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 containing service or class. 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 from the containing service or class. Game scene inheritance works as
follows:
A service set to
KRPC.Service.GameScene.Inheritwill be available in all game scenes. This is equivalent to setting it toKRPC.Service.GameScene.All.A service procedure or property set to
KRPC.Service.GameScene.Inheritwill be available in the same game scenes as the containing service.A class set to
KRPC.Service.GameScene.Inheritwill be available in the same game scenes as the containing service.A class method or property set to
KRPC.Service.GameScene.Inheritwill be available in the same game scenes as the containing class. If the containing class is set toKRPC.Service.GameScene.Inheritthe class method or property will be available in the same game scenes as the containing service.
Examples
Declare a service whose procedures are available in the
KRPC.Service.GameScene.Flightgame scene:[KRPCService (GameScene = GameScene.Flight)] public static class MyService { // ... }
Declare a service whose procedures are available in the
KRPC.Service.GameScene.FlightandKRPC.Service.GameScene.Editorgame scenes:[KRPCService (GameScene = (GameScene.Flight | GameScene.Editor))] public static class MyService { // ... }
Declare a service whose procedures are available in the
KRPC.Service.GameScene.Flightgame 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 (); } // ... }