KRPC.Bridge¶
kRPC services for FMRS, OCISLY and Trajectories. Three Kerbal Space Program mods that have no scriptable interface at all, made drivable from Python. Version 2 also adds services of its own (flight control and telemetry, stock utilities, booster catch towers) and needs kRPC 0.7.0.
import krpc
conn = krpc.connect()
conn.fmrs.armed = True # capture this flight's stages
conn.fmrs.track_parachutes = True # else a chute-only booster is ignored
# ... launch, fly, separate ...
vid = next(iter(conn.fmrs.dropped_vessels))
conn.fmrs.jump_to_vessel(vid) # fly the booster down
booster = conn.space_center.active_vessel
# ... land it ...
conn.fmrs.recover_current()
print(conn.fmrs.recovered_funds()) # 14832.0
conn.fmrs.jump_to_main() # back to the mission
The cameras come back on their own.
Where to start¶
-
New here? The scripting guide walks a complete booster recovery from arming to the recovery ledger, then the six things that go wrong.
-
Looking for a member? The API reference has every procedure (over 300 members in twelve services), with units, return shapes and what each one raises. Use the search box.
-
Writing a plugin? Architecture explains the Core, the load order and why plugin isolation is a build-time property. Read it before adding one.
Why it exists¶
kRPC exposes stock KSP beautifully and mod internals not at all. It wraps the game's own
objects, plus the KSPField, KSPEvent and KSPAction members of any PartModule — and
that is the whole of it. A mod whose functionality lives in a static class, a singleton or
a ScenarioModule is simply invisible.
All three mods here are exactly that shape.
FMRS exposes no KSPEvent, no action group and no key binding. Its jump API is a public
method on a MonoBehaviour that stock kRPC has no way to reach. And the jump is not a
vessel switch — it is a full flight-scene reload, 5 to 20 seconds, in which everything is
destroyed and rebuilt from a save file.
OCISLY subscribes to no scene GameEvent and uses no DontDestroyOnLoad, so that
reload silently drops every camera it was streaming, and nothing in the game brings them
back.
Trajectories has a real public API — a static class, Trajectories.API — which is
exactly the shape kRPC cannot see. It holds the only atmospheric impact prediction in the
game that integrates the stock drag cubes at the vessel's actual attitude, and stock kRPC
has no impact prediction of any kind.
This mod reaches all three by reflection, resolved once at load, and reports member by
member when something has moved. Each integration is a separate assembly and degrades on
its own: a mod you do not have reports available = False with a diagnostic naming exactly
what was looked for, and nothing else is affected.
Install¶
Requires KSP 1.12.x and kRPC 0.7.0. FMRS, OCISLY and Trajectories are each optional.
-
Download the latest release and unzip it so
GameData/KRPC.Bridge/lands in your KSPGameData/. Keep each.xmlnext to its.dll— kRPC reads it to build the Python docstrings, so without ithelp(conn.fmrs)is empty. The booster catch tower's parts are a separate download,TowerCatch-x.y.z.zip(GameData/TowerCatch/, optional and complete: the tower's parts, its craft and its plugin; the bridge holds nothing of it. It needs ModuleManager, Modular Launch Pads, HullCamera VDS and the Breaking Ground and Making History expansions). See the README: never keep a second copy of its patch or of its plugin. -
Install the kRPC Python client. There is nothing else to install; this mod ships no client library of its own.
-
Start KSP, start the kRPC server, then from any REPL:
Verified against FMRS Continued 1.2.9.6, Trajectories 2.4.5.4, kRPC 0.7.0, KSP 1.12.5.