Jump to content

[1.12.x] kRPC: Control the game using C#, C++, Java, Lua, Python, Ruby, Haskell, C (Arduino)... (v0.5.4)


djungelorm

Recommended Posts

  • 3 weeks later...

New release is out!

The python client got quite a bit of work, now with proper type annotations and stub generation. Should work much better with auto-complete and type checking in IDEs like pycharm.

On the server, added support for independent engine throttles, plus a bunch of bug fixes.

https://github.com/krpc/krpc/releases/tag/v0.5.2

Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

Hi!
Just wondering, could this be used to obtain the current state of SAS modes from KSP? Looking at the documentation, it seems very complete, but maybe this is overkill for what I'm trying to do.

I have a Stream Deck + now, I'm making a KSP profile so I can activate different SAS modes from it etc, and I'd like to be able to read the data from KSP (to change the status of the icons on the Stream Deck). I've searched this thread and forum but has this been done before?

Thanks!

Link to comment
Share on other sites

Yes, you certainly can.

The function you need is here: https://krpc.github.io/krpc/python/api/space-center/control.html#SpaceCenter.Control.sas_mode

The code (in python) would look something like this:

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

i.e. connect, get the current vessel, get its "control object", then query the sas mode. There are other things too like whether sas or rcs is enabled etc.

Link to comment
Share on other sites

2 hours ago, djungelorm said:

Yes, you certainly can.

The function you need is here: https://krpc.github.io/krpc/python/api/space-center/control.html#SpaceCenter.Control.sas_mode

The code (in python) would look something like this:

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

i.e. connect, get the current vessel, get its "control object", then query the sas mode. There are other things too like whether sas or rcs is enabled etc.

Ok, thanks a lot for that. I know a bit of python so I should be able to figure this out. I just don't know how the Stream Deck software can "pull" data from some external source, I'll try to educate myself on that. Thank you!!

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...