Jump to content

wmvanvliet

Members
  • Posts

    66
  • Joined

  • Last visited

Everything posted by wmvanvliet

  1. Thanks heaps for that @linuxgurugamer! Sorry to be so slow on the uptake. I've not touches KSP in a long time. But now, with the hype for KSP2, I'm looking at it again. I've released version 0.51 with your bugfix in it.
  2. I haven't tested it, but it should be compatible. The Planetary almanac is built dynamically: all bodies that happen to be in the game will appear as global variables. Fresh new version out in collaboration with Thorulf Neustrup. You can now define multiple maneuver nodes from a single function. Maneuver nodes are now specified in the same manner as output variables. Check this out: maneuver: first "The first maneuver to execute" maneuver: second "The second maneuver to execute" # Computing first maneuver: apply 50 dV prograde 45 seconds from now first = [50, 0, 0, 45] # Computing second maneuver: 5 dV normal and 20 dV radial in an hour second = [0, 5, 20, 360]
  3. I'll see if I can install KSP 1.42 at some point and investigate. In the mean time, please try all versions of Kerbulator. I always compile against the newest version of KSP and lately there have been some changes that will make the mod no longer work on older versions
  4. Thanks for the feedback! Based on this I did some more debugging and found that you were right. I missed two important scenarios where I should have unlocked the clickthrough prevention lock but did not. We live and learn. New version 0.46 pushed. Could you give that a try and see if things are now working properly at your end as well?
  5. Recompiled for KSP version 1.9. Nothing changed otherwise.
  6. Just a heads up. I've recompiled Kerbulator against KSP version 1.4.4. I also finally fixed the clickthrough bugs.
  7. Unfortunately, I no longer have any time to work on it (or play KSP for that matter). Having kids will do that to you Anyone willing to work on it is extremely welcome to submit git pull requests! Is Kerbulator still running on the new versions of KSP?
  8. Calculating multiple maneuver nodes in one function is not a problem, you can return a list of values like this: [x, y, z]. However, the interface currently doesn't allow for the automatic placement of a list of maneuver nodes. I've make a ticket on Github for it. I may get to it at some point https://github.com/wmvanvliet/Kerbulator/issues
  9. Thanks for the heads up that click-through has a viable solution now. It's been a while since I've looked at Kerbulator. I'm still looking for ways to solve the enter and cursor keys not working in the editor, which is a real pain in the ass. Just so you know, you can assign labels to input variables like this: in: some_var "Label for variable" The description appears in a tooltip when hovering above the corresponding input textbox.
  10. You'll have to use your own math. A Kerbal day is 6 hours (not 24 like an Earth day). One hour is 60 minuts. One minute is 60 seconds. Do the math! (not sure how many months go in a Kerbal year)
  11. Recompiled Kerbulator for KSP 1.3. Nothing should be broken.
  12. You got the wrong math symbol. The ∧ symbol means the logical 'and' operation, while the ^ symbol means taking the power. The ∧ symbol is a recent addition to Kerbulator. It hadn't occurred to me yet how similar it is to ^. The last line should read: T = (2 * π * √ (a^3) / μ) / 60 Note that your formula will give you the orbital period in minutes (you divide by 60).
  13. Recompiled Kerbulator for the upcoming version 1.2. Grab version 0.42 of this mod to make it work if you run the pre-release.
  14. It adds a lot more. For one, it is a place for the "global" variables to live. You can give names to the output of functions so they don't clash. Plus, you can make small tweaks when you re-use a variable: > v = orbital_speed(...) v: ... > t = some_computation(v * 2) t: ... This is flexibility you won't get with a GUI. True. If I'm going to add a feature, I prefer to do it right and thoroughly. So lets explore this GUI scenario. Here is a mockup of how it could work: The user can "pin" a function to the interface by clicking the push-pin button next to the "close window" button. Pinning a window will remove the "inputs" clutter from the window and keep it open. The name of the function is the title of the window. This is similar to the "auto-run" window. Hovering the mouse on the pinned window will display a tooltip: "Click to edit". Clicking on the pinned window will open the full interface again, so you can edit the inputs and have access to running it again and other functions. When the user pins the same function twice, the second window title will be the function name + "2" ("3", "4", etc.). The output variables of a pinned or auto-running function can be used as input for other functions, by the name of WindowTitle.VariableName. Kerbulator internally keeps a graph of which functions are used as input to other functions (no cycles allowed). A line between the function windows is drawn in the interface to visualize this. When the user re-runs a function, all dependent functions will be re-run as well. This is also true when auto-running a function: all dependent function will also enter auto-run mode. It's going to take some work to get this right
  15. Hrm, but that would mean that Kerbulator spams your screen with windows you have to manually close every time you run a function. Handy for the use case you describe above, but a pain in other cases. Also, what would happen when you need the output of a function twice? For example, you need the speed at Ap and at Pe and you want to use the visviva function to compute both. Really what you want is a command line REPL environment like you get in ipython/matlab/R/mathematica. That may be even not be so difficult to implement, as expressions can already be computed on the fly. Basically, the input field in the run dialog already provides most of the functionality. Something like this: Welcome to the Kerbulator command line... > current_sma = ((Craft.Ap + Parent.R) + (Craft.Pe + Parent.R)) / 2 current_sma = 573948.2839283 > speed_at_Pe = orbital_velocity(current_sma, Craft.Pe + Parent.R, Parent.mu) speed_at_Pe = 2134.394032 > desired_sma = ((400E3 + Parent.R) + (Craft.Pe + Parent.R)) / 2 desired_sma = 693948.2839283 > desired_speed = orbital_velocity(desired_sma, Craft.Pe + Parent.R, Parent.mu) desired_speed = 2432.394032 > delta_v = desired_speed - speed_at_Pe delta_v = 202 # Some functions like 'make_node', 'set_alarm' could be defined by Kerbulator > make_node(delta_v, 0, 0, Craft.TimeToPe) Node set. I really wish I had more knowledge about how to made a good editor widget in Unity. The function editor is a mess currently (stupid font, arrow keys don't work, scrolling also zooms the ship, etc.).
  16. Made a ticket for this, I'll see when I can come up with. https://github.com/wmvanvliet/Kerbulator/issues/33
  17. What do you mean exactly by 'nesting the functions'? Anyway, there are a couple of solutions for the thing you want to achieve: 1. Make the GetSpeedAtPeriapsis function call the GetSemimajorAxis function: in: Ap in: Pe in: mu out: v a = GetSemimajorAxis(Ap, Pe) v = sqrt(mu * (2/Pe - 1/a)) (perhaps that is what you mean by nesting the functions) 2. You can do function calls inside the input fields of the Run dialog: run the GetSpeedAtPeriapsis function you have, but enter GetSemimajorAxis(<some Ap>, <some Pe>) into the 'a' field (replace <some Ap> and <some Pe> with actual numeric values or globals like Craft.Ap + Parent.R) As far as keeping the window open, you can always click the 'repeated run' button (the play icon with arrows). It will use up CPU as it keeps evaluating the function over and over again, but the window will stay open
  18. I just noticed that the arrow keys are broken in text fields provided by mods. This is not limited to Kerbulator, but all text fields. That's really annoying and I will look for a workaround. In the meanwhile, I suggest using an external editor for any major editing of your Kerbulator functions (see the manual on how to do this). On the off chance you use vim as editor, I got a syntax highlighting file for you.
  19. Version 0.4 is here! I've added some things to the language. By popular demand, you can now have if-statements. Although in math, you call them piecewise functions. They go like this: x = 2 y ={ x + 1, if 0 ≤ x < 2 0, otherwise that would in this case set y to 0, since x is not smaller than 2. Check the language reference for more information. This means there is also a bunch of boolean operators added to the language (< > ≤ ≥ == ≠ and more). Note that these operators obey the rules of mathematical notation, not necessarily programming languages, by which I mean this: 0 ≤ x < 2 < y ≤ 5 means 'x bigger than 0 (inclusive) and smaller than 2 (exclusive) and y bigger than 2 (exclusive) and smaller than 5 (inclusive)'. Another nice feature I added is that you can specify pre- and postfixes for your output variables. This makes them look nicer in the GUI. For example: out: "inclination: " inc "°" "Inclination of current orbit" inc = Craft.Inc will display in the GUI when you run the function something like: inclination: 0.45° Again, see the language reference for the updated syntax.
  20. A new version of KSP, a new version of Kerbulator. In this version, window positions are saved!
  21. Ok, version 0.35 is out. Now compatible with 1.1.2!
  22. I'm currently working on upgrading it to version 1.1.2. It needs some UI work.
×
×
  • Create New...