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:
The procedures of a service set to
KRPC.Service.GameScene.Inheritwill be available in all game scenes. This is the default. Its classes take their game scenes from the classes and services further up the hierarchy, so they can differ from those of a service set 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 method or property set to
KRPC.Service.GameScene.Inheritwill be available in the game scenes of the class of the object it is called on. A class set toKRPC.Service.GameScene.Inherittakes them from its base classes and services.
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.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 (); } // ... }