Jump to content

Need an 'easy to follow' guide on how to code in KOS, and script Mechjeb2 actions.


Recommended Posts

I was following a thread on KSPForums where @theo3er scripted the automatic launch/landing of a SpaceX style Starship and Booster.

I mentioned in the Forum that I could use something like this for refuelling flights, but since my 'Orbital Fuel Depot' is always moving in its orbit, the instructions to dock and transfer fuel would be relative, and thus impossible to program.

Theo then told me that you'd use the Mechjeb features of auto rendezvous/docking in your KOS script.

I've never used KOS. Never coded anything.

But in all my games, I have a standard Minmus Lander with a probe brain, and drilling/processing gear for filling large tanks with fuel. I use it on Minmus so that launch and landing are dirt cheap, and my larger spacecraft are refuelled in flight.

I'm looking for a simple guide on how to write a KOS script that would allow me to have a probe-driven lander do this:

1) Set down on Minmus in a specific place

2) Extend solarpanels/radiators/drills and activate a mini IRSU, until a small tank is full up with ore. (The IRSU converts it to fuel faster, so the small ore storage doesn't fill until the fuel tanks are at capacity)

3) Launch to a specific altitude, and circularize

4) Target a specific docking port on a specific Station.

5) Rendezvous/Dock

6) Transfer the majority of fuel from Lander to Station

7) Detach from Station

8) Return to point one and repeat.

Almost all these actions can be managed by action keys, or Mechjeb2 functions. I need to understand KOS enough to write a script to make this work. So I'm looking for something already written that can be cut/pasted in, or a guide that can explain it to me. (Preferably visual aids. I'm a visual learner)

Is what I'm describing possible?

Link to comment
Share on other sites

Hey, controlling MechJeb with KOS is not very straight forward. I used an old version of Mechjeb and linked actionsgroups to the controls of the mechjeb part. As far as I am aware there is no better or full connection between KOS and Mechjeb. Also I think to do this with KOS you would need at least some coding experience and some time to get used to KOS, but there are good tutorials online for both, if you have the time.

I think I saw once that mechjeb itself also has some sort of visual programming tool, maybe you could check that out as well.

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