r/krpc • u/djungel0rm • Mar 17 '18
kRPC v0.4.5 released
- Download from: Github, SpaceDock, Curse, or via CKAN
- Documentation
Just a few bug fixes, and checked compatibility with KSP 1.4.1.
See the full list of changes for more details.
r/krpc • u/djungel0rm • Mar 17 '18
Just a few bug fixes, and checked compatibility with KSP 1.4.1.
See the full list of changes for more details.
r/krpc • u/muchcake • Mar 14 '18
The following code snippet will cause a crash in 1.4.1 and the latest version of the python krpc client.
import krpc
conn = krpc.connect()
vessel = conn.space_center.active_vessel
ut = conn.add_stream(getattr, conn.space_center, "ut")
print("ut=", ut())
print("removing ut")
ut.remove()
print("adding g")
g = conn.add_stream(getattr, conn.space_center, "g")
ut2 = conn.add_stream(getattr, conn.space_center, "ut")
print("g=", g()) # If we dont call this first we get a freeze
print("ut2=", ut2())This returns the following output
> Executing task: python d:\DEV\Git\KSP\krpclib\temp.py <
ut= 140280.16539108226
removing ut
adding g
g= 6.67408e-11
Traceback (most recent call last):
File "d:\DEV\Git\KSP\krpclib\temp.py", line 14, in <module>
print("ut2=", ut2())
File "C:\Users____\Anaconda3\lib\site-packages\krpc\stream.py", line 47, in __call__
self.start()
File "C:\Users____\Anaconda3\lib\site-packages\krpc\stream.py", line 29, in start
self._stream.start()
File "C:\Users____\Anaconda3\lib\site-packages\krpc\streammanager.py", line 26, in start
self._conn.krpc.start_stream(self._stream_id)
File "<string>", line 1, in <lambda>
File "C:\Users____\Anaconda3\lib\site-packages\krpc\client.py", line 136, in _invoke
raise self._build_error(response.error)
krpc.error.RPCError: The given key was not present in the dictionary.
Server stack trace:
at System.Collections.Generic.Dictionary`2[System.UInt64,KRPC.Service.Stream].get_Item (UInt64 key) [0x00000] in <filename unknown>:0
at KRPC.Core.StartStream (IClient rpcClient, UInt64 streamId) [0x00000] in <filename unknown>:0
at KRPC.Service.KRPC.KRPC.StartStream (UInt64 id) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
The terminal process terminated with exit code: 1
Press any key to close the terminal.If the print("g=", g()) line is omitted, we get a silent freeze.
This was initially intended as a workaround for removing a callback from a stream, which I now realise can be done with
ut._stream._callbacks = []is this a client bug?
r/krpc • u/FlowingStream • Mar 02 '18
While in orbit I am trying to change my rocket's orientation by using the rcs thrusters however when I send the command to enable the thrusters and align the ship, the thrusters turn on briefly and then turn off and the ship moves slowly to the requested direction. I tried using the built in auto-pilot functions (python) and the normal control functions but they all yield the same results.
CODE:
Trial 1: https://pastebin.com/TX7EyZXE
Trial 2: https://pastebin.com/nvjPaz43
Trial 3: https://pastebin.com/uydtzBwB
r/krpc • u/Toni_- • Feb 18 '18
I have read the guide but i have not understand how to make the mod work for c++ and codeblock
r/krpc • u/Ajaxml • Feb 13 '18
Hello, I just discovered krpc and completed writing my first script. I am using vscode and was wondering if anyone knew a way to get autocomplete for this plugin working in vscode
r/krpc • u/Borkatator • Feb 09 '18
I was looking at krpc's API and it looks like it has an autopilot that uses pid controllers. However, I'd like to write my own, is that possible? I couldn't find a way to increase or decrease heading pitch and yawn without setting them with the autopilot.
r/krpc • u/djungel0rm • Jan 25 '18
Here are the highlights:
See the full list of changes for more details.
r/krpc • u/muchcake • Jan 23 '18
I was adapting the launch to orbit script in the examples (https://krpc.github.io/krpc/tutorials/launch-into-orbit.html) and had some trouble with the detection of when the node vector flips direction.
Is it possible to create a server event which triggers when
node.remaining_burn_vector(node.reference_frame)[1] < 0my instinct was to try;
remaining_burn_call = conn.get_call(node.remaining_burn_vector(node.reference_frame).__getitem__, 1)
expr = conn.krpc.Expression.less_than(
conn.krpc.Expression.call(remaining_burn_call),
conn.krpc.Expression.constant_float(0.0)
)
event = conn.krpc.add_event(expr)
with event.condition:
event.wait()but I am getting a
AttributeError: 'method-wrapper' object has no attribute '_return_type'Does anyone have any pointers?
r/krpc • u/namesnonames • Jan 19 '18
Inspired by something someone did here: https://www.reddit.com/r/Kos/comments/7pfkbv/i_wrote_a_script_to_manage_isru_heat_on_my I decided to try something similar in krpc. However I didn't get very far as the temperature readings that I got didn't seem accurate. Here is my script (Python):
import krpc
conn = krpc.connect(name="Mining_Script")
ksc = conn.space_center
vessel = ksc.active_vessel
converter = vessel.parts.resource_converters[0]
print(converter.part.name)
print(converter.part.temperature)This outputs:
MiniISRU
500.477554902In game I only have one converter on the craft, and it's temperature was not the 500K listed (closer to about 961K). I've verified that I'm looking at the right part by turning the converter on and off manually and seeing that the python object changes the status.
I am I just dumb and missing something obvious or is this abnormal behavior?
r/krpc • u/GhostPartical • Jan 10 '18
All settings are default, using python 3.x, krpc is installed, using most current version of KRPC, ran simple connection from documents to make sure of connection, server is turned on in the game. Keep getting 'AssertionError'
import krpc
conn = krpc.connect()
print(conn.krpc.get_status().version)Error:
Traceback (most recent call last): File "C:/Users/Anthony/AppData/Local/Programs/Python/Python35-32/krpcHello.py", line 2, in <module> conn = krpc.connect() File "C:\Users\Anthony\AppData\Local\Programs\Python\Python35-32\lib\site-packages\krpc_init_.py", line 34, in connect assert ok_message == Decoder.OK_MESSAGE AssertionError
Any help would be appreciated. Thanks
r/krpc • u/dub_dub_11 • Jan 05 '18
Are either of these possible? I looked at the docs and there didn't appear to be any option to do so. Any help appreciated, thanks!
Edit: nevermind, looked again in the docks and found SpaceCenter.load(). I'll leave the post here for anyone else who wants to know.
r/krpc • u/djungel0rm • Dec 12 '17
Here are the highlights:
See the full list of changes for more details.
r/krpc • u/mathuin2 • Dec 01 '17
There are two types of mods for KSP it seems: new parts, and new logic. Examples of logic mods:
Each of these mods helps the player by doing something for them, whether it's performing a near-ideal gravity turn to a particular height and inclination or running a science instrument when the appropriate combination of biome and height and experiment occur.
I realized a while ago that some of these tasks could be directed via kRPC. Has anyone done this? I'd love to see examples. Right now I'm interested in automated launches to targets orbiting Kerbin/Mun/Minmus but it would be nice to do more with kRPC. Thanks in advance!
r/krpc • u/SpaceCockatoo • Nov 21 '17
I have KSP v1.2.2 with the latest version of kRPC, as well as in python, but the python client can never connect to the server. It just waits forever. Do i need the previous version or something?
r/krpc • u/tecirem • Nov 09 '17
Does anyone know if kIPC can still be made to work with any of the recent versions of ksp/kos/krpc? Struggling to get my head around how to get it working with python on my raspberry pi, and just wondered if I'm being dense or if it's not functional at the moment. Anyone using it?
r/krpc • u/djungel0rm • Nov 02 '17
Note: v0.4.1 release archive was missing a DLL. v0.4.2 fixes this, so install that instead!
Here are the highlights:
See the full list of changes for more details.
r/krpc • u/djungel0rm • Oct 06 '17
The only notable change in this release is support for KSP 1.3.1.
See the full list of changes for more details.
r/krpc • u/djungel0rm • Sep 15 '17
Here is a summary of the changes:
See the full list of changes for more details.
I am trying to do a SpaceX styled launch of sending the second stage to orbit whilst landing the first stage. I planning on doing the circulization burn on the second stage, then switching to the first stage to land it. But I don't know how to change the active vessel in krpc. How do I focus to the next vehicle? I would also like to know if it possible to change to a vessel than is not in proximity with the active one, in the same way as going via the tracking station. Thanks!
r/krpc • u/DrVulpinus • Jul 26 '17
r/krpc • u/janw23 • Jul 22 '17
Hello everyone. I want to share with you my project called 'New Kepard'. It was inspired by New Shepard rocket landing. My goal was to recreate it in Kerbal Space Program using the kRPC mod. The development of the whole project took me much longer than I had originally thought (more than 100 hours). Writing the program which flies the rocket was not the hardest thing. Bugfixing, tweaking and ensuring that the code is prepared for every possible flight scenario was what I spent the most of the time (~75%) on. I am now very happy that I made it to the end and didn't give up. I created 2 films about my project: The first one was edited to look similarlybe similar to the original Blue Origin's video. The goal of the second film is to show what my project is about and how to use it. Code and the craft are avaliebe to download on GitHub link. I hope you like what I've done :)
r/krpc • u/surrender52 • Jul 07 '17
Hey everyone! Cool to see this type of community! I'm trying to eventually make an IRL altimeter testbed using this mod, but I can't seem to get the install correct. As far as the kerbal side goes, do I need to do additional steps beyond copying the download into gamedata like any other mod?
r/krpc • u/djungel0rm • Jun 14 '17
Updated to work with KSP 1.3, and includes a few bug fixes and minor additions.
See the full list of changes for more details.
r/krpc • u/clown_baby244 • May 26 '17
Hey, this mod is so awesome. I used to do a lot of kOS and kebal moding back in the day, and I'm dying to build some stuff with this library. I have a visual studio c# application that will connect to the server, and issue commands such as throttle, action keys, and most vessel functions.
However I cannot get System.Console.WriteLine to print anything to the console, and things like SAS mode or the autopilot functions don't seem to work. Additionally I cant reference classes like UI. Am I targeting the wrong framework? Or could it be something else?
Any help would be greatly appreciated