kRPC: Control the game using C#, C++, Java, Lua, Python...

kRPC: Control the game using C#, C++, Java, Lua, Python...

7.8k Downloads

Add the ability to terminate a vessel

lucaelin opened this issue ยท 1 comments

commented

Title says it all, I think... but the implementation turns out to be a little complicated...
According to the KSP API, each Vessel has a function void Die(), BUT this behaves really strange if the Vessel is in view, because for some reason the vessel is not removed from the (unity) scene.
On the other hand, the RP-0 avionic parts have a PartModule called RangeSafety. This loops over every part each frame and makes every leaf-part go boom (i don't fully understand the boom part tbh), and since it uses the vessels part list it needs the vessel to be loaded/unpacked in order to work.
So maybe a combination of both would be possible?

commented

Another approach might be to fire an OnVesselRecoveryRequested game event. Not sure if this would work for vessels in all situations though.