Jump to content

djungelorm

Members
  • Posts

    379
  • Joined

  • Last visited

Everything posted by djungelorm

  1. There isn't a collection of scripts anywhere yet - but I agree it'd be very useful to set something up! Maybe a wiki linked from the documentation website and on here? The only existing example scripts I know of are those in the tutorials on the documentation site, and a couple of scripts which I've put on github here: https://github.com/djungelorm/krpc-toolkit
  2. I've added a fix to catch the exception, which should hopefully fix the UI disappearing issue. Could you test it out for me as I'm unable to reproduce it on my system? Here's a version with the fix: https://github.com/djungelorm/krpc/releases/tag/v0.1.9-ui-fix - - - Updated - - - Yes, performance is kinda bad with 0.1.9, but should improve drastically in 0.1.10 thanks to a bunch of changes to the main server loop. If you want details and a pre-release to play around with, see here: https://github.com/djungelorm/krpc/releases/tag/v0.1.10-pre-performance
  3. I'm unable to reproduce this. Can you provide me with more details? Are you on Windows/Linux? What version of KSP/kRPC/KER/KAC are you using? Do you still have issues with just kRPC installed (without KER and KAC installed)? Could you maybe provide a save file with a list of steps to reproduce the bug?
  4. You didn't misread - I've added lots of new aero functionality in line with the changes from KSP 1.0 And you can get the current latitude and longitude by calling vessel.flight().latitude and vessel.flight().longitude http://djungelorm.github.io/krpc/docs/python-api/space-center/flight.html#Flight.latitude
  5. I've started adding documentation for this here: http://djungelorm.github.io/krpc/docs/python-client.html
  6. It already is http://djungelorm.github.io/krpc/docs/python-api/space-center/comms.html - - - Updated - - - Will do! The client and krpc service are only documented via the tutorials at the moment, reference docs are indeed missing. Awesome Keen to see how it turns out!
  7. It's quite simple, you just need to annotate your classes/methods/etc. with C# attributes provided in the KRPC.Service.Attributes namespace. kRPC will scan all the DLLs loaded by the game for these attributes to add the functionality to the server. There are also a few restrictions on the structure/types of the classes/methods etc. It's documented here: http://djungelorm.github.io/krpc/docs/extending.html For fully fledged examples, take a look at kRPCKerbalAlarmClock (https://github.com/djungelorm/krpc/tree/master/src/kRPCKerbalAlarmClock) or kRPCInfernalRobotics (https://github.com/djungelorm/krpc/tree/master/src/kRPCInfernalRobotics) which add services for the KAC and IR mods. - - - Updated - - - Streams aren't properly documented yet, but they are used in this tutorial which should give you some hints on how to use them: http://djungelorm.github.io/krpc/docs/tutorials/launch-into-orbit.html They aren't required, they just provide a more efficient way to get data out of KSP in a continuous fashion without having to invoke repeated remote calls. - - - Updated - - - No, currently the only control over warping is space_center.warp_to(ut). Sounds like something that should be added though, so I'll put it on the todo list for the next version. - - - Updated - - - OK, I'll investigate... Added an issue for this on github here: https://github.com/djungelorm/krpc/issues/133
  8. Version 0.1.9 has been released! [Moderator removed defunct website link] The main changes are: InfernalRobotics support (documentation) KerbalAlarmClock support (documentation) Refactored Resources class and associated methods Added Engine.PropellantRatios
  9. I'm adding support for InfernalRobotics to the next version - which is trivial using it's API Are there any other mods people would be interested in having access to via kRPC?
  10. Is there a way to reliably reproduce the bug? Are there any errors being reported in the KSP log file? - - - Updated - - - Should be fairly easy to interface with InfernalRobotics' API - added to the TODO list. If you could get javascript to speak protocol buffers to the server then a web script should be achievable. I plan to add a choice of communication protocols in the future, allowing SOAP style requests which would make interfacing webapps a lot easier.
  11. Version 0.1.8 has been released! Download link: https://kerbalstuff.com/mod/636/kRPC...0Call%20Server The main changes are: KSP 1.0.2 support: Updated engine thrust and ISP functionality Updated aerodynamics functionality [*] Improved enum support in Python client. Uses Enum objects instead of plain ints. PS. I made this release in a bit of a hurry as I'm going away on holiday all of this week, but wanted to get KSP 1.0 support out there. Hoping there aren't any major bugs!
  12. On it's way soon Currently figuring out the KSP 1.0 engine thrust and ISP changes...
  13. Unfortunately, looks like this "hack" is the best way to do it at the moment. I hadn't considered this use case, so will have a think about how to make this better. (Added it as an issue on github so I don't forget https://github.com/djungelorm/krpc/issues/108)
  14. You could iterate over the parts in the vessel that are in those stages, and sum their masses. For example: parts = conn.space_center.active_vessel.parts mass = 0 for stage in [0,1,2]: for part in parts.in_decouple_stage(stage-1): mass += part.mass
  15. As far as I can tell it doesn't expose it, so you can't tell the SAS autopilot to point in an arbitrary direction. All I've managed is to instruct it to point in the directions that are available via the mode buttons next to the navball (which as of v0.1.7 you can set using vessel.auto_pilot.sas_mode = ...)
  16. Version 0.1.7 has been released! Download link: [Moderator removed defunct website link] The main changes are: Support for Python 3 Setting SAS modes and navball speed mode Clean up engine thrust methods Fix orientation of docking port reference frames Rename engine.activated to engine.active (to match other parts) Fix CKAN install bug on Windows
  17. Thanks - confirmed on Windows using CKAN 1.6.6. Oddly, it works fine on Linux!
  18. Oooo interesting, my guess is that it's because the classes and methods are dynamically created when the client connects to the server. I don't have experience with VS, so I don't know if there is an easy workaround for this.
  19. The python client will throw a krpc.error.RPCError exception. (In fact that's the only thing a failed RPC will throw - the message will differ based on the actual error though.) You can check if FAR is installed using conn.space_center.far_available --------- EDIT: ----------- This got me thinking. Maybe kRPC should allow custom exception types to be defined in a service, and expose them to the client. Then you could use whatever exception handling mechanism the client language has to differentiate between different sorts of errors.
  20. kRPC doesn't currently support python 3 due to it's dependency of Google's protobuf library. However, a quick Google search reveals Google has recently released a new version that supports python 3 I'll have a go at upgrading the library. To connect remotely (over a local network) you first need to configure the server to listen on a network interface that's connected to the network. This can be done from the server window pictured here: http://djungelorm.github.io/krpc/docs/getting-started.html#installation Click on the button next to "Address" and it'll give you a list of IP addresses for the network interfaces on your machine. You can also enter the IP address manually. You also need to get the client to connect to the correct IP address. For example the following, but replaced with your IP address: import krpc conn = krpc.connect(address='123.123.123.123') If you're trying to do this over the internet, you'll probably need to set up port forwarding on your router and get the client to connect to your routers WAN IP - depends on your set up though.
  21. Cool It's not possible at the moment - only the active vessel can be controlled. Shouldn't be too difficult to add this feature though.
  22. Version 0.1.6 has been released! Download link: https://kerbalstuff.com/mod/636/kRPC:%20Remote%20Procedure%20Call%20Server The main changes are: Parts API Tutorial here: http://djungelorm.github.io/krpc/docs/tutorials/parts.html You can now inspect the parts that make up a vessel, and traverse the parts tree Interact with part fields, methods and actions (i.e. everything that appears in the right click menu of a part). This should also work with functionality added to parts via mods. Classes to make interaction with of types of stock part simple, including: engines, decouplers, docking ports, landing legs, landing gear, parachutes, ... Change which part the vessel is controlled from All the tools you should need to write a docking autopilot! [*]Ability to get/set the current target And for those of you wanting to write your own client, I've included the source for the protocol buffer messages, and compiled versions for Python, Java and C++.
  23. It's already on CKAN And, yeah, bug reports are best posted on the github issues page.
  24. Thanks I agree a parts API is an essential feature. I had a go at implementing something a while back, never quite finished it, but the design was as follows: Add the following to the Vessel class: Vessel.parts - returns a list of Part objects, one for every part in the vessel Vessel.root_part - the root part, from which you can walk the tree of parts that make up the vessel Add a Part class with methods/properties including: Part.name - the name of the part, e.g. "mk1pod" Part.parent and Part.children - for traversing the tree of parts that make up the vessel Part.modules - a list of string names of the part modules that the part has (gives an indication of the type of part, e.g. engine/solar panel etc.) Part.actions - returns a list of toggle-able actions, as strings, such as "Activate Engine" or "Toggle Torque" Part.trigger_action (string actionName) Part.fields - a dictionary mapping names of fields to their values (for example this would contain the part's temperature, and engines current thrust or other custom data) Part.mass Part.stage - which stage is the part in? ... and other general properties And maybe a few helper functions to make some common use cases a bit less cumbersome, such as getting the dry mass of a part (without resources) These general lists of action/field names should mean that the API will automatically pick up new functionality added by mods etc. And I think this design will support the use cases you suggested.
  25. I've released version 0.1.5 - links updated in the first post. The list of changes is quite long, but the most notable things are: The server now persists across game scene changes Integration with FAR and RemoteTech API Added some tutorials to the documentation: http://djungelorm.github.io/krpc/docs/tutorials.html Reference frame improvements: Tutorial: http://djungelorm.github.io/krpc/docs/tutorials/reference-frames.html Fixed lots of bugs Added Vessel.surface_velocity_reference_frame and Node.orbital_reference_frame Removed Vessel.non_rotating_reference_frame and Body.surface_reference_frame The default reference frame for Vessel.flight() and the auto-pilot is now Vessel.surface_reference_frame Visual debugging - you can draw direction vectors in-game to visualize what's going on
×
×
  • Create New...