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

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

7.8k Downloads

Way to get number of stages without iterating over each part/stage

gavinunderdown opened this issue ยท 1 comments

commented

Is there a way to do so? If not I would say feature request, please.

commented

The current stage number should be equal to the number of stages, and can be obtained directly:

import krpc
conn = krpc.connect()
print(conn.space_center.active_vessel.control.current_stage)

Documentation is here: https://krpc.github.io/krpc/python/api/space-center/control.html#SpaceCenter.Control.current_stage