artwhaley Posted June 15, 2017 Share Posted June 15, 2017 It sounds like once again you're doing something over my head, but if you don't mind posting or PMing me the relevant code I'll take a look at it. You are setting the 'target_direction' with your unit vector, not converting to target pitch and heading, I assume? And by well behaved, I assume you mean 'not reversing itself rapidly?' Have you tried slowing that down for testing? Quote Link to comment Share on other sites More sharing options...
lushr Posted June 15, 2017 Share Posted June 15, 2017 6 hours ago, artwhaley said: It sounds like once again you're doing something over my head, but if you don't mind posting or PMing me the relevant code I'll take a look at it. You are setting the 'target_direction' with your unit vector, not converting to target pitch and heading, I assume? And by well behaved, I assume you mean 'not reversing itself rapidly?' Have you tried slowing that down for testing? I can send you the code, though it's written largely in Julia (with a dependency on MOSEK, a commercial SOCP solver), so I'm not sure it'll be helpful for you. Let me know if you want it. By not well behaved, I mean "suddenly snapping back and forth between pointing straight up and the direction I'm commanding." To illustrate this, here is a video of the behaviour in question: The relevant section starts at around 31 seconds. The short white line appearing behind the vehicle is the commanded direction, which should be compared to the actual direction of the vehicle. Additionally, here is a plot of AutoPilot.error in the video, with the X-axis being seconds and the Y-axis being degrees error: You can see that the controller is exhibiting very anomalous behaviour that is not typical of PID loops, and I'm not sure what could be causing it. In extremis, I can implement my own attitude controller, but would rather avoid doing so. Quote Link to comment Share on other sites More sharing options...
Nismu Posted June 16, 2017 Share Posted June 16, 2017 My apologies if this has been answered already, but my curiosity is getting the best of me. Has anyone been able to get autocomplete for kRPC on Visual Studio Python or PyCharm, other than code already entered? I am not sure if my own settings have been set up properly. Quote Link to comment Share on other sites More sharing options...
artwhaley Posted June 16, 2017 Share Posted June 16, 2017 @lushr - Yes your code would probably take me too long to understand. lol. That is NOT the typical behavior of the autopilot module. Are you setting the autopilot by heading and pitch, or setting it by 3D vector? I have never experimented with setting it by vector and will look into it if that's what you're doing. Also, it wouldn't fully explain your results but what reference frame are you setting on the autopilot? @Nismu - I use Visual Studio pretty regularly. Because the server passes it's service descriptions at connect time, I usually just keep pasting the relevant bits of my code down into the immediate window to keep auto complete working for me - every time I grab a service or property I do the assignment in the immediate window too so autocomplete works. There may well BE a better way and hopefully someone else chimes in with it, but other than having to have KSP open and a vessel on the launchpad I don't find it TOO much hassle to copy my assignments down to the immediate window as I code. Quote Link to comment Share on other sites More sharing options...
Nismu Posted June 16, 2017 Share Posted June 16, 2017 @artwhaley thank you for your support. I thought I was doing something wrong, but I'm glad to hear there are other ways of making it work. Quote Link to comment Share on other sites More sharing options...
lushr Posted June 22, 2017 Share Posted June 22, 2017 (edited) @artwhaley Thank you for the help, I've been away from KSP (and will be so for a few more days), so haven't been able to do more poking at it. I've tried setting it with both heading and pitch (computed from the 3D vector) and with the vector itself, with similar results. The reference frame being used is a landing-site relative one, computed such that X is up, Y is east, and Z is north. My plan (once I get back to KSP) is most likely to implement my own attitude controller, I've been looking for an excuse to do some PID control theory, and this is ideal. Edited June 22, 2017 by lushr Quote Link to comment Share on other sites More sharing options...
Axilourous Posted June 23, 2017 Share Posted June 23, 2017 (edited) I have a python code for a simple rocket, it is called krpc.py. When I try to run it, it says there is no such thing as the connect. I have code. import time import krpc conn = krpc.connect(name='Rocketything') vessel = conn.space_center.active_vessel vessel.auto_pilot.engage() vessel.auto_pilot.set_pitch_and_heading(90,90) vessel.control.throttle=1 countdown=10 while(countdown>-0.1): print(countdown) countdown=countdown-1 vessel.control.activate_next_stage() while(vessel.Resources.Amount(SolidFuel)>0.1): time.sleep(1) print('Booster Separation') vessel.control.activate_next_stage() while(vessel.Resources.Amount(LiquidFuel)>0.1): time.sleep(1) print('Parachutes Deployed') vessel.control.activate_next_stage() vessel.auto_pilot.disengage() while vessel.flight().surface_altitude > 0: time.sleep(1) print('Landed') Error: File "C:\Users\***\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 460, in runcode exec(code, self.locals) File "C:\Users\***\Desktop\krpc.py", line 2, in <module> import krpc File "C:\Users\***\Desktop\krpc.py", line 3, in <module> conn = krpc.connect(name='RocketyThing') AttributeError: module 'krpc' has no attribute 'connect' >>> anyone know why it is doing that? It is preventing me from launching my rocketything EDIT: With the python client thingy that I installed, do I put that in GameData? Edited June 23, 2017 by Axilourous Quote Link to comment Share on other sites More sharing options...
Kerbart Posted June 23, 2017 Share Posted June 23, 2017 12 minutes ago, Axilourous said: I have a python code for a simple rocket, it is called krpc.py. When I try to run it, it says there is no such thing as the connect. I have code. Error: File "C:\Users\***\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 460, in runcode exec(code, self.locals) File "C:\Users\***\Desktop\krpc.py", line 2, in <module> import krpc File "C:\Users\***\Desktop\krpc.py", line 3, in <module> conn = krpc.connect(name='RocketyThing') AttributeError: module 'krpc' has no attribute 'connect' >>> anyone know why it is doing that? It is preventing me from launching my rocketything By naming your program krpc.py you cause Python to look at your program when it's searching for a connect method. Rename your script into something else, say "launch_rocket.py" and things should work just fine (assuming you did install the KRPC module. If you didn't install krpc you can install it with a simple pip install krpc from the command prompt. Quote Link to comment Share on other sites More sharing options...
Axilourous Posted June 23, 2017 Share Posted June 23, 2017 (edited) 9 minutes ago, Kerbart said: By naming your program krpc.py you cause Python to look at your program when it's searching for a connect method. Rename your script into something else, say "launch_rocket.py" and things should work just fine (assuming you did install the KRPC module. If you didn't install krpc you can install it with a simple pip install krpc from the command prompt. Rename the file, or Rename the name='Rocketything' thing? What about the client, do I did install it before the problem happened, but where do I put that krpc 0.3.9 folder, Should it also go in GameData, or get deleted, or just leave it? I just know that conn = krpc.connect(name='Rocketythingy') is the problem... Edited June 23, 2017 by Axilourous Quote Link to comment Share on other sites More sharing options...
Kerbart Posted June 23, 2017 Share Posted June 23, 2017 14 minutes ago, Axilourous said: Rename the file, or Rename the name='Rocketything' thing? What about the client, do I did install it before the problem happened, but where do I put that krpc 0.3.9 folder, Should it also go in GameData, or get deleted, or just leave it? I just know that conn = krpc.connect(name='Rocketythingy') is the problem... Hi, Rename the file. If it's called "krpc.py" things will not work. The krpc 0.3.9 folder... that goes "somewhere" in your Python folder. I'm vague on purpose, because that is not the preferred way of doing. Most libraries in Python are installable through pip, and it makes your life a whole lot easier to do so: You don't have to worry about where to put the files. Pip will take care of it. You don't have to worry about dependencies (krpc uses google's protobuf library. If you don't have it...) Pip will take care of it. You don't even have to download anything! Pip will take care of it. So, how to run pip on your computer? If you have a modern Python installation, pip already comes with it. Open a command prompt (with Admin rights, depending on how Python is installed you may or may not need that). Navigate to the folder where your python.exe is Type python -m pip install krpc Pip will take care of it! Quote Link to comment Share on other sites More sharing options...
Axilourous Posted June 23, 2017 Share Posted June 23, 2017 Okay, so I have already done everything you said, and the one I haven't done, I just finished, but it still has the error, it looks a little different though. Error: ============== RESTART: C:\Users\***\Desktop\launch_rocket.py ============== Traceback (most recent call last): File "C:\Users\***\AppData\Local\Programs\Python\Python36-32\lib\site-packages\krpc\connection.py", line 21, in connect self._socket.connect((self._address, self._port)) ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\***\Desktop\launch_rocket.py", line 3, in <module> conn = krpc.connect(name='launch_rocket') File "C:\Users\***\AppData\Local\Programs\Python\Python36-32\lib\site-packages\krpc\__init__.py", line 24, in connect rpc_connection.connect(retries=10, timeout=0.1) File "C:\Users\***\AppData\Local\Programs\Python\Python36-32\lib\site-packages\krpc\connection.py", line 25, in connect raise NetworkError(self._address, self._port, str(ex)) krpc.error.NetworkError: [WinError 10061] No connection could be made because the target machine actively refused it (address=127.0.0.1, port=50000) So, from what I know, it looks like my KSP install is saying no to my code. Quote Link to comment Share on other sites More sharing options...
artwhaley Posted June 23, 2017 Share Posted June 23, 2017 That error is progress! The library of installed and trying to connect. That error means krpc didn't accept the connection. Make sure you've clicked the 'start server ' button in the krpc window inside ksp Quote Link to comment Share on other sites More sharing options...
ave369 Posted June 23, 2017 Share Posted June 23, 2017 Does this mod remove the necessity to use dlls and recompile mods each time for a new version? Just write a code script that is understood by any version of KSP. Quote Link to comment Share on other sites More sharing options...
Kerbart Posted June 24, 2017 Share Posted June 24, 2017 11 hours ago, ave369 said: Does this mod remove the necessity to use dlls and recompile mods each time for a new version? Just write a code script that is understood by any version of KSP. Sadly no; the part that provides the connection inside KSP will/can break with new versions (because Squad is breaking the interface). On the other hand, breakage can in this instance be reduced to a single part, and once that's fixed you're good to go, so there's that. 12 hours ago, artwhaley said: That error is progress! The library of installed and trying to connect. That error means krpc didn't accept the connection. Make sure you've clicked the 'start server ' button in the krpc window inside ksp @ave369, this is what coding is all about. Try, fail, analyze, fix, repeat... You are making great progress. Like Art said, now it's just a matter of making it connect inside the game. You will have to activate the mod, and either make it automatically accept incoming calls, or manually confirm the connection. Don't give up, you're almost there. After that comes the next challenge: making your script do what you want it to do. That will be a whole different ballgame! Quote Link to comment Share on other sites More sharing options...
artwhaley Posted June 24, 2017 Share Posted June 24, 2017 14 minutes ago, Kerbart said: After that comes the next challenge: making your script do what you want it to do. For me, KRPC has added a whole new layer onto the game. In real spacecraft - writing the software is at least as important as designing the hardware and KRPC is one of the ways to bring that to KSP! I get as much joy out of writing 'firmware' for each new rocket design as I do out of figuring out how to string the physical pieces together! Quote Link to comment Share on other sites More sharing options...
Axilourous Posted June 24, 2017 Share Posted June 24, 2017 Okay, so I am on a new computer, and it now works perfectly fine, almost. It says there isn't a resource called LiquidFuel(I was just basing it off of how SolidFuel was named.) Anyone know what its called? Also, @artwhaley and @Kerbart, thank you for the help and encouragement. This is actually my first time using Python, so you guys helped a lot, despite the fact that on my other computer, I still have that connection problem, I can figure that out on Monday though. Quote Link to comment Share on other sites More sharing options...
Kerbart Posted June 24, 2017 Share Posted June 24, 2017 11 minutes ago, Axilourous said: Okay, so I am on a new computer, and it now works perfectly fine, almost. It says there isn't a resource called LiquidFuel(I was just basing it off of how SolidFuel was named.) Anyone know what its called? It should be LiquidFuel; here's a line from one of my launch programs: fuel = vessel.resources.amount('LiquidFuel') 11 minutes ago, Axilourous said: Also, @artwhaley and @Kerbart, thank you for the help and encouragement. This is actually my first time using Python, so you guys helped a lot, despite the fact that on my other computer, I still have that connection problem, I can figure that out on Monday though. I hope you solve the problem on your other computer. Getting things to work is a huge step forward though; now you have a working example of where it works, and getting the other one to work is merely a matter of figuring out where it differs. I would highly recommend diving into the Python language as well; it's a great programming language. If you have experience with other languages I recommend this book: https://www.amazon.com/Quick-Python-Book-Second/dp/193518220X It works its ways through the various subjects very quickly without wasting a lot of time. Python is an exceptionally elegant language but you miss out on a lot of it if you're doing things the way you're used to in C or Java. Python will let you write constructs the way you're used to do in C (or Java, C#, etc) but it'll result in code that is 3× as wordy as "pure Python." However, if you're new to programming it is very likely not the best choice (it assumes familiarity with lots of concepts), and an introductory book like this one is better: https://www.amazon.com/Head-First-Python-Brain-Friendly-Guide/dp/1491919531 Finally, if you haven't done so, it's worth investing time in reading the kRPC documentation; it contains a lot of examples and it helps you to figure out how to do certain things. Make sure you understand the concept of reference frames, as getting information about your position/velocity/direction highly depends on the reference frame that you're using (the reference frame of the active vessel is great for measuring distance to other vessels, but not so great for your orbital velocity; your velocity in regards to the active vessel will be 0, after all). Good luck in your endeavours, and don't hesitate to ask any questions! Quote Link to comment Share on other sites More sharing options...
Axilourous Posted June 24, 2017 Share Posted June 24, 2017 2 minutes ago, Kerbart said: It should be LiquidFuel; here's a line from one of my launch programs: fuel = vessel.resources.amount('LiquidFuel') I hope you solve the problem on your other computer. Getting things to work is a huge step forward though; now you have a working example of where it works, and getting the other one to work is merely a matter of figuring out where it differs. I would highly recommend diving into the Python language as well; it's a great programming language. If you have experience with other languages I recommend this book: https://www.amazon.com/Quick-Python-Book-Second/dp/193518220X It works its ways through the various subjects very quickly without wasting a lot of time. Python is an exceptionally elegant language but you miss out on a lot of it if you're doing things the way you're used to in C or Java. Python will let you write constructs the way you're used to do in C (or Java, C#, etc) but it'll result in code that is 3× as wordy as "pure Python." However, if you're new to programming it is very likely not the best choice (it assumes familiarity with lots of concepts), and an introductory book like this one is better: https://www.amazon.com/Head-First-Python-Brain-Friendly-Guide/dp/1491919531 Finally, if you haven't done so, it's worth investing time in reading the kRPC documentation; it contains a lot of examples and it helps you to figure out how to do certain things. Make sure you understand the concept of reference frames, as getting information about your position/velocity/direction highly depends on the reference frame that you're using (the reference frame of the active vessel is great for measuring distance to other vessels, but not so great for your orbital velocity; your velocity in regards to the active vessel will be 0, after all). Good luck in your endeavours, and don't hesitate to ask any questions! Thanks, I'll check out that second book as I'm not to good with programming, and only know the basics of C#, HTML, and Java(I would've used C# or Java, but I couldn't get them working, and I found I like python better ) I figured out why it wasn't accepting LiquidFuel! It was supposed to be while(ves.resources.amount('LiquidFuel')>0.1): #Correct^ while(ves.resources.amount(LiquidFuel)>0.1): #Incorect^ Lol, glad that you showed me that line of code of yours Quote Link to comment Share on other sites More sharing options...
Axilourous Posted June 24, 2017 Share Posted June 24, 2017 (edited) Okay, new problem... so I have a 3 stage rocket, it is simple, It go up, it come down. But to decouple a stage I have to restart the program... I figured it might have something to do with the fact that I have 2 while loops, doing the same thing. So I decided I should instead of while (ves.resources.amount('LiquidFuel')>0.1): I should try using the while(ves.resources_in_decouple_stage(1[False])>0.1): But I can't seem to get it working, it says it can't have subclasses, what are subclasses? Would this code work? and how do I use it correctly? The API isn't exactly helping much... EDIT: Fixed! I did not use the stuff I said above, but instead, I used while(vs.thrust>1): and it worked out good, it will usually do that while loop, when its thrust is <1 It goes to the next loop, stages, and stops completely... I decided to try moving the second while loop into the first, so it looks like: while(vs.thrust>1) *stuffs* while(vs.thrust<1) *more stuffs* It worked perfectely! I even have it showing my velocity, speed, and LiquidFuel in my python shell thing, updated every 4-6 seconds! But, I like to know when its about to decouple, from the shell thing, so my newest question is, how do I get it to show the LiquidFuel of a certain stage? I also trying to get solar panels to deploy, how do I activate action groups, or deploy the solar panels?Also, as I did not figure out my questions above, feel free to answer them! You don't have to tho Jeez, after I completely loose fuel, It spams me Stage Separation every 2 seconds, lol. EDIT2: Figured out solar panels, maybe... Edited June 24, 2017 by Axilourous Quote Link to comment Share on other sites More sharing options...
artwhaley Posted June 26, 2017 Share Posted June 26, 2017 This might do what you want - It should be a complete script that covers most launch fuel states. It looks at the resources of the NEXT decouple stage, because things that were in the current decouple stage are already decoupled! If the next decouple stage doesn't dump any fuel it goes ahead and fires it. This covers stages that are decoupler or fairing only without activating an engine. Then it checks for SRBs first, since it's not uncommon to have srb's burn out and decouple while a main liquid engine is still burning. It prints out what percentage is remaining. if empty, it stages. Then it checks liquid fuel and does the same - reporting percentage remaining and then staging when that hits zero. The whole program exits when it hits stage 0, but you could change that 8th used line to make it stop earlier if you had a probe or something you didn't want it staging into. #setup stuff import krpc import time conn=krpc.connect() sc=conn.space_center v=sc.active_vessel #launch vessel while v.control.current_stage>0: #Stop when we're out of stages! res=v.resources_in_decouple_stage(v.control.current_stage-1, cumulative=False) # Grab the resource state of the NEXT decouple stage (things we'll lose if we hit space bar!) if not (res.has_resource('SolidFuel') or res.has_resource('LiquidFuel')): #If Next stage doesn't dump any fueled parts, go ahead and fire it. v.control.activate_next_stage() if res.max('SolidFuel')>0: # This stage has SRBs print('SolidFuel Percent: '+str((res.amount('SolidFuel')/res.max('SolidFuel'))*100)) #Display what percentage of SRB is remaining if res.amount('SolidFuel')==0: #If the SRB is empty - decouple v.control.activate_next_stage() continue #makes sure we don't stage twice accidentally by starting a new iteration of the loop before we look at liquid fuel. if res.max('LiquidFuel')>0: #This stage has liquid fuel print('LiquidFuel Percent: '+str((res.amount('LiquidFuel')/res.max('LiquidFuel'))*100)) #Display what percentage of SRB is remaining if res.amount('LiquidFuel')==0: #if tanks are empty decouple v.control.activate_next_stage() time.sleep(.2) #throttle the loop to only run 5 times per second. Quote Link to comment Share on other sites More sharing options...
artwhaley Posted June 26, 2017 Share Posted June 26, 2017 (edited) And NOT at 3 in the morning I refactored this to be a little more reuseable. Now it has an easy to find variable for setting the maximum stage to autostage until, and i moved all the autostage logic and fuel reporting into user defined functions you can put at the top of other programs and reuse. I'm not a python expert but this code is a LITTLE less 'hacked together.' import krpc import time maxautostage=0 #last stage to separate automatically - allows you to protect a fairing or probe engine or something you DON'T want to just bumble into cutting loose! freq = 5 # refresh rate def main(): # Main program logic. Execution will actually start here when main() is called at the bottome of the file! conn=krpc.connect() sc=conn.space_center v=sc.active_vessel while True: # this loops forever. In practice... this loop probably only needs to run until some condition - target apoapsis is achieved for a launch, usually? # check autostage 'freq' times per second for t in range(freq): autostage(v) time.sleep(1.0 / freq) stagestats(v)# Every 5 refreshes, print the fuel data per stage! def autostage(vessel): if vessel.control.current_stage>maxautostage: #Stop when we're out of stages! res=vessel.resources_in_decouple_stage(vessel.control.current_stage-1, cumulative=False) # Check to see if we're about to dump any useable fuel if not (res.has_resource('SolidFuel') or res.has_resource('LiquidFuel')): vessel.control.activate_next_stage() if (res.max('SolidFuel')>0) and ( res.amount('SolidFuel')==0): # This stage has SRBs vessel.control.activate_next_stage() return if (res.max('LiquidFuel')>0) and (res.amount('LiquidFuel')==0): #This stage has liquid fuel vessel.control.activate_next_stage() def stagestats(vessel): print('') x=vessel.control.current_stage-1 while(x>=-1): res=vessel.resources_in_decouple_stage(x, cumulative=False) # Grab Stage Fuel Data if res.max('SolidFuel')>0: # This stage has SRBs print('Stage:'+ str(x+1)+' - SolidFuel Percent: '+str((res.amount('SolidFuel')/res.max('SolidFuel'))*100)) #Display what percentage of SRB is remaining if res.max('LiquidFuel')>0: #This stage has liquid fuel print('Stage:'+ str(x+1)+' - LiquidFuel Percent: '+str((res.amount('LiquidFuel')/res.max('LiquidFuel'))*100)) #Display what percentage of SRB is remaining x-=1; main() Edited June 27, 2017 by artwhaley Edited - Kerbart suggested some stuff I'd done dumb be done smarter! Quote Link to comment Share on other sites More sharing options...
Kerbart Posted June 28, 2017 Share Posted June 28, 2017 (edited) I took the liberty—and with his permission—to clean up @artwhaley's code a little bit and make it conform to common Python coding practices a bit more. It's basically the same code, I tested it, but it's been refactored for increased readability, which makes it easier to adapt it later. Art suggested that we start looking in some repository for krpc code—github, perhaps? I'm all for it and I'll be more than happy to help out. But without further ado, here's the latest* version of Art's launch script: *I'd almost say final, but that'd be a fallacy; code is never "done," after all. import krpc import time # ---------------------------------------------------------------------------- # Launch parameters # ---------------------------------------------------------------------------- MAX_AUTO_STAGE = 0 # last stage to separate automatically REFRESH_FREQ = 5 # refresh rate ALL_FUELS = ('LiquidFuel', 'SolidFuel') # ---------------------------------------------------------------------------- # Main loop # ---------------------------------------------------------------------------- def main(): conn = krpc.connect() sc = conn.space_center v = sc.active_vessel # continue checking until user quits program while True: # check autostage 'REFRESH_FREQ' times per second for t in range(REFRESH_FREQ): autostage(v) time.sleep(1.0 / REFRESH_FREQ) show_stage_stats(v) # Every second, print the fuel data per stage! # ---------------------------------------------------------------------------- # staging logic # ---------------------------------------------------------------------------- def autostage(vessel): '''activate next stage when there is no fuel left in the current stage''' if out_of_stages(vessel): return res = get_resources(vessel) interstage = True # flag to check if this is a fuel-less stage for fueltype in ALL_FUELS: if out_of_fuel(res, fueltype): next_stage(vessel) return if res.has_resource(fueltype): interstage = False if interstage: next_stage(vessel) def show_stage_stats(vessel): '''for each available stage, bottom to top, show available fuel''' print('') # iterate from largest stage to final stage to be used for stage_num in stages_bottom_to_top(vessel): res = get_resources(vessel) for fueltype in ALL_FUELS: if res.max(fueltype) > 0: frac = res.amount(fueltype) / res.max(fueltype) print('Stage {} - {} percentage: {:3.0%}'.format( stage_num, fueltype, frac)) # ---------------------------------------------------------------------------- # Helper functions # ---------------------------------------------------------------------------- def out_of_stages(vessel): '''True if no more stages left to activate''' return vessel.control.current_stage <= MAX_AUTO_STAGE def get_resources(vessel): '''get resources of the vessel in the decouple stage''' return vessel.resources_in_decouple_stage( vessel.control.current_stage - 1, cumulative=False) def out_of_fuel(resource, fueltype): '''return True if there is fuel capacity of the fueltype, but no fuel''' return resource.max(fueltype) > 0 and resource.amount(fueltype) == 0 def next_stage(vessel): '''activate the next stage''' vessel.control.activate_next_stage() def stages_bottom_to_top(vessel): '''return an iterator that lists all available stage numbers, bottom to top''' return range(vessel.control.current_stage - 1, MAX_AUTO_STAGE - 1, -1) # ---------------------------------------------------------------------------- # Activate main loop # ---------------------------------------------------------------------------- main() Changes made to the code: "magic numbers" captured in constants constants are listed in caps, to make them recognizable as constants every function has a (simple) docstring, making code reuse easier complex expressions are wrapped in functions, making the code "self documenting" as well as easier to maintain cleaned up the fuel stats, by using the python formatting codes instead of concatenating the output together. Edited June 28, 2017 by Kerbart Quote Link to comment Share on other sites More sharing options...
djungelorm Posted June 28, 2017 Author Share Posted June 28, 2017 16 hours ago, Kerbart said: Art suggested that we start looking in some repository for krpc code—github, perhaps? I'm all for it and I'll be more than happy to help out. I could set up a repository under the krpc "organisation" on github to act as a community repository? Then add maybe you and @artwhaley so that you have the necessary permissions to commit code and accept pull requests from others? Quote Link to comment Share on other sites More sharing options...
Kerbart Posted June 28, 2017 Share Posted June 28, 2017 1 hour ago, djungelorm said: I could set up a repository under the krpc "organisation" on github to act as a community repository? Then add maybe you and @artwhaley so that you have the necessary permissions to commit code and accept pull requests from others? That sounds like a great idea! Quote Link to comment Share on other sites More sharing options...
ThomasD Posted June 29, 2017 Share Posted June 29, 2017 9 hours ago, djungelorm said: I could set up a repository under the krpc "organisation" on github to act as a community repository? Then add maybe you and @artwhaley so that you have the necessary permissions to commit code and accept pull requests from others? I started writing a GUI application (external to KSP) using Kivy and the asyncio module for python - happy to share this once/if I get something vaguely working. Tom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.