Jump to content

[KSP 1.12.x] kOS v1.4.0.0: kOS Scriptable Autopilot System


Dunbaratu

Recommended Posts

  • 3 weeks later...

I'm getting this error spammed nonstop:

[ERR 16:44:58.240] kOS: kOSVesselModule.CacheControllable called with null parentVessel, contact kOS developers

[ERR 16:44:58.347] kOS: kOSVesselModule.CacheControllable called with null parentVessel, contact kOS developers

[ERR 16:44:58.349] kOS: kOSVesselModule.CacheControllable called with null parentVessel, contact kOS developers

[ERR 16:44:58.468] kOS: kOSVesselModule.CacheControllable called with null parentVessel, contact kOS developers

[ERR 16:44:58.470] kOS: kOSVesselModule.CacheControllable called with null parentVessel, contact kOS developers

[ERR 16:44:58.606] kOS: kOSVesselModule.CacheControllable called with null parentVessel, contact kOS developers

KSP.log

Link to comment
Share on other sites

  • 2 weeks later...

Can someone please explain to me what this is doing?  I know it is setting up an initial pitch maneuver but why the transcendental math?

lock targetPitch to 88.963 - 1.03287 * alt:radar^0.409511.

lock steering to heading(90, targetPitch)

Clearly 90 is east and targetPitch is pitch above the horizon but I don't understand the math and cannot find an explanation (at least not in what appears to be swaheli).  Can someone please break this down as though explaining it to a three year old child?

Link to comment
Share on other sites

  • 1 month later...

Hello thank you for the mod work!

I'm wondering if anyone knows if one could set the kOS Part-Action-Window section to default to collapsed instead of expanded. I think I have a mod that tweaks stock modules to collapse by default, just curious if this can be added to kOS.

Link to comment
Share on other sites

  • 1 month later...
On 7/28/2023 at 9:41 PM, scimas said:

Action sets support has not been added to kOS. And kOS discussion almost exclusively happens over their discord these days. https://discord.gg/H4TgCHja

Hello @scimas, I guess I waited too long to follow the link you sent. I got an "Invite Invalid" error message today when I tried it.  (Invite Invalid: This invite may be expired, or you might not have permissions to join.)  Could you send another link?

Today's question is:  how do I change terminal font and font size from within the script?  I can see many fonts when I do "list fonts" from the terminal, but I can't figure out how to use any of them. I also see in the kOS documentation on github that I should be able to set Terminal:HEIGHT, but I can't seem to get that working either.

It would be great if I could use the font used by the template to write the first line, with "CPU:   0  -", "KBRD", and "EXIT".  See how much smaller the text is in the printable part of the terminal.
 R7UzXLi.png

Link to comment
Share on other sites

  • 6 months later...
On 9/18/2017 at 5:56 PM, Dunbaratu said:

kOS Scriptable Autopilot System v1.4.0.0 for KSP 1.12.x

(This is a continuation of the old thread about the kOS mod: ( 1.2.2 kOS scriptable autopilot system ).)

kOS (Kerbal Operating System) is an autopilot you script yourself. kOS is to programming, what Kerbal Space Program itself is to rocket science. You don’t have to know what you’re doing to get started, but you may find yourself learning a lot by accident as you play with it. And if you already know a lot about programming, it will still be able to hold your interest. kOS is meant to scale with the skill level of the user. You can start off doing very small simple things with it, and get more and more into using its features as you go.
 

Example:

print "Launching".
lock steering to heading(90,80).
lock throttle to 1.
stage.
wait until altitude > 5000.
lock steering to heading(90,60).
wait until altitude > 15000.
lock steering to heading(90,45).
wait until altitude > 25000.
lock steering to heading(90,30).
until apoapsis > 80000 {
  print "apoapsis is " + round(apoapsis,0).
  wait 0.
}
lock throttle to 0.
// ..etc...

What it does

kOS introduces a few new parts that each contain a simulated computer capable of running programs written in its own scripting langauge called kerboscript. The computer has powerful smarts built in to the hardware that allow it to do complex spacecraft operations in one command, thus making it possible to make complex programs with only a few lines of script text.

The intent of kOS is to be a fully in-game item that lives inside the Kerbal’s universe. The program isn’t running on your own gaming computer, but rather it’s being run in a virtual machine that is simulated in the underlying Unity engine.

History

kOS was originally begun as a mod by a single author, Kevin Laity aka Nivekk. Although the project has undergone massive changes since then and now has a very different underlying archetecture and is under active development by a different set of people, none of that would have been possible without his original vision and work.

Changelog

 

Source

 

Downloading:

From Curse

From SpaceDock

Direct from the GitHub Project

 

 

Amazing small mod !

Link to comment
Share on other sites

  • 3 weeks later...
Posted (edited)

I feel like I am an idiot somehow, but I cannot figure it out.

I am playing JNSQ first of all, in case that matters.

I load my kOS-equipped craft on the pad at KSC in either career or sandbox mode, and when I submit the first command in the kOS console it reads "Signal lost. Waiting to reacquire signal." I have told it to use CommNet as my connectivity manager. Under "status" for the part it reads "blocked by Kerbin".

If anybody can point out what I am doing wrong I would appreciate it.

Edit: Apparently it doesn't work with a manned craft, you still need the probe core.

Edited by shifty803
Link to comment
Share on other sites

  • 1 month later...

I am playing around with this mod and noticed that this function will not work. Any reason why.

function unrotate{
    parameter v. if v:typename <> "Vector" set v to v:vector.
    return lookdirup(v,ship:facing:topvector).
}
It trips at the If V:typename part.  
Link to comment
Share on other sites

  • 1 month later...

Is there a way to control the execution of kOS scripts using kRPC? I know that kOS runs scripts inside ksp so it has better(simpler) control over vessels but it is not good at complex calculation, so I want to use an external python program to do the actual calculating of trajectories.

Link to comment
Share on other sites

  • 1 month later...
On 9/20/2024 at 3:57 PM, Kepler452b said:

Is there a way to control the execution of kOS scripts using kRPC? I know that kOS runs scripts inside ksp so it has better(simpler) control over vessels but it is not good at complex calculation, so I want to use an external python program to do the actual calculating of trajectories.

Yes and no :P So in theory you can for example read kosTag :P to pass some small informations :) There was a mod for interaction between this two but it's abandoned unfortunatelly :/

Link to comment
Share on other sites

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...