Jump to content

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


Dunbaratu

Recommended Posts

Hi all, years ago i did this simple Flight Management Computer for 2 of my vessels, they were so simple scripts like launch to 80-90-100-120 km orbit, and basic orbital maneuvers. sadly lose all my scripts and came back now to check if there are similar Computers style scripts out there.

fyfn04.jpg

35jj7ec.jpg

Link to comment
Share on other sites

Hi ya'all,

Is there any way to get the terminal to appear on the particular part of the screen, or even to move it through a script, like bottom right, a certain number of pixels from the edges?  I know there that I can adjust the terminal size to a certain number of characters across and down.

Thanks!

Peace.

Link to comment
Share on other sites

@Benzel

Hello and welcome!

You can use telnet connection which allows you to copy-paste in your OS terminal.

@theJesuit

None I know of. There're GUI functions that allow arbitrarily-placed textboxes, if that helps.

@johansen

there certainly are, just maybe not here. Check /r/Kos and the Discord server. And yeah, GUI thingies are hot topic these days.

Link to comment
Share on other sites

Hey everyone this is mostly a repost from over at reddit/r/kos but I've made a vscode extension for Kerboscript for those interested. For those who don't know or visual studio code or vscode is a text editor which I personally love and I think the vast majority would agree. It's available cross platform and it's great for a large number of languages.
 
What I've done is added language support for kerboscript / KOS. As of now it's fairly limited but it can:
  • detected syntax errors before running your script
  • highlight syntax such as keywords, function call, variable etc.
  • Allows for collapsing brackets
That's about it at the moment, but it was honestly more work than I thought to even get this in place. If you have issues either let me know on this thread and/or post an issue here.
 
Please provide any feedback or requests for features!
Link to comment
Share on other sites

3 hours ago, dlrk said:

Was Trajectories removed at some point? I have it installed and it addons:tr:available is false

Trajectories has gotten a reboot under a new name and it's API isn't compatible with the old one, partly just because of the name change, but partly because some things actually changed under the hood.  Mods still trying to call it the old way don't work anymore with new versions of Trajectories.

There's a fix in the development branch for kOS but it's not released.

Link to comment
Share on other sites

1 hour ago, Steven Mading said:

Trajectories has gotten a reboot under a new name and it's API isn't compatible with the old one....

What's the name of this replacement mod?  Do you have a link to its forum topic?

I see no mention of it in the Trajectories topic.  Last action I've found is @PiezPiedPy's recompile of Trajectories for KSP 1.4.3, which is said to still work in 1.4.5.

 

Link to comment
Share on other sites

The mod Principia changes a lot of thing with its frame of reference and different terminology for delta-v directions. Does this limit what is possible to do with kOS? Is it possible for kOS to create a Principia manoeuvre and execute it? In Principia you will often see multiple apoapsis and periapsis nodes, will kOS be able to make sense of them?

I couldn't find anything about Principia in the kOS docs , does this mean that the mod is not supported?

Link to comment
Share on other sites

Anyone care to share their wisdom on file handling?  I'm returning to the game after a bit of a layoff, so have started a new game but am reusing all my previous KOS scripts, so now is probably a good time to tidy things up a bit.

Currently I have a series of functions scripts for different tasks (Func--Launch, Funcs-Orbit, Funcs-Common, etc), each containing multiple functions for specific tasks, I then  have a boot script that loads and runs them if it's on the launchpad (on Kerbin and below whatever altitude), and then runs a script which is the specific instruction set for the mission, eg: to launch to a stable orbit it will run the functions

  • Preflight (set initial parameters such as target intercept delays)
  • Launch (to gravity turn)
  • Basic Climb (as opposed to a Max Q climb that I never got working properly)
  • Final Apo (adjust the Apoapsis once out of atmosphere)
  • Circularize (self explanatory).

I prefer this method of multiple functions and a master script over approaches I've seen on youtube of one big script cycling through several modes, but I've only used it for missions starting from Kerbin and in my last game only got as far doing not very precise landings on the Mun.  If I load anywhere other than on the launch pad I need to manually upload a new script (or get Jeb to type it in and we all know that's not his forte!).  

This works but the sheer number of subroutines gets a bit unwieldy after a while, so I'm wondering what other people do?

 

 

Edited by RizzoTheRat
spieling miss takes
Link to comment
Share on other sites

Hi @RizzoTheRat, Cheers Kevin has a pretty cool solution to this kind of problem in the Kerbal Space Programming - Part 6 - Disaster on the Mun! episode of his Kerbal Space Programming YouTube series.

Basically, he uses the boot script to make kOS reboot every 10 seconds check for a connection to KSC and then it looks for an update script in the archive, copies it, runs it and deletes it before rebooting again. This way you have to copy/rename the update script in the script folder every time you have new instructions, but it might beat manually uploading the new scripts every time you have new instructions. :)

Link to comment
Share on other sites

8 hours ago, MaltYebisu said:

The mod Principia changes a lot of thing with its frame of reference and different terminology for delta-v directions. Does this limit what is possible to do with kOS? Is it possible for kOS to create a Principia manoeuvre and execute it? In Principia you will often see multiple apoapsis and periapsis nodes, will kOS be able to make sense of them?

I couldn't find anything about Principia in the kOS docs , does this mean that the mod is not supported?

kOS (or any other mod) can only create stock nodes, not the principia ones. The MechJeb devs are working with the principia devs to make the principia data available to other mods (better ask in the principia thread about this, they can tell better). At that point if someone creates a principia addon for kOS, you will be able to do all kind of stuff. 

Until then you still can sort of access the principia nodes. When you click "show on navball" in principia, it creates a stock node that's continuously updated (except that its delta v doesn't tick down). So, although you can't create a node or edit it from outside of principia, you can partially access it and do things like

1. point in the maneuver direction

2. wait till execution time

3. whatever else you come up with that doesn't involve changing the node itself

with kOS. 

Link to comment
Share on other sites

19 hours ago, MaltYebisu said:

Hi @RizzoTheRat, Cheers Kevin has a pretty cool solution to this kind of problem in the Kerbal Space Programming - Part 6 - Disaster on the Mun! episode of his Kerbal Space Programming YouTube series.

Basically, he uses the boot script to make kOS reboot every 10 seconds check for a connection to KSC and then it looks for an update script in the archive, copies it, runs it and deletes it before rebooting again. This way you have to copy/rename the update script in the script folder every time you have new instructions, but it might beat manually uploading the new scripts every time you have new instructions. :)

Cheers, I'll have a look at that.  Thinking about it presumably I could use the vessel's name as the filename so I could set up a mission/task specific script before loading the vessel.

Link to comment
Share on other sites

13 minutes ago, Denko666 said:

 It doesn't work on version 1.4.5

False.

CKAN provides no capacity (as far as I know) to update its notion of what a mod is compatible with without also uploading a new version of the mod.  The real story is that the last time kOS had a release, 1.4.1 was the highest version of KSP in existence, so that was all that could be promised in the CKAN versioning files without a crystal ball to know what SQUAD will change in future versions, so that's all that was promised.  It still DOES work on 1.4.5, but I know no way to tell CKAN that without a new release.

If you tell CKAN to allow older versions, it will show up and you can install it and it will work.  (There's a way to tell CKAN "show me everything for KSP 1.4.x where I don't care about the x".  It's in the settings somewhere but I don't have access to it at the moment to find exactly where it is in the menus.)

 

Link to comment
Share on other sites

16 minutes ago, Steven Mading said:

False.

CKAN provides no capacity (as far as I know) to update its notion of what a mod is compatible with without also uploading a new version of the mod.  The real story is that the last time kOS had a release, 1.4.1 was the highest version of KSP in existence, so that was all that could be promised in the CKAN versioning files without a crystal ball to know what SQUAD will change in future versions, so that's all that was promised.  It still DOES work on 1.4.5, but I know no way to tell CKAN that without a new release.

If you tell CKAN to allow older versions, it will show up and you can install it and it will work.  (There's a way to tell CKAN "show me everything for KSP 1.4.x where I don't care about the x".  It's in the settings somewhere but I don't have access to it at the moment to find exactly where it is in the menus.)

 

I did that, i installed the latest kOS for version 1.4.1 on KSP 1.4.5 with CKAN. But the menu entries for assigning scripts to cores didn't get added, and the control panel never detected any kOS processors on the vessel with the CPU part added. So according to you there might be conflict with another mod?

Link to comment
Share on other sites

6 hours ago, Denko666 said:

I did that, i installed the latest kOS for version 1.4.1 on KSP 1.4.5 with CKAN. But the menu entries for assigning scripts to cores didn't get added, and the control panel never detected any kOS processors on the vessel with the CPU part added. So according to you there might be conflict with another mod?

There has to be something wrong.  Can you post your output log somewhere that I can look at it?

Link to comment
Share on other sites

On 9/26/2018 at 7:13 AM, Steven Mading said:

There has to be something wrong.  Can you post your output log somewhere that I can look at it?

I put a KSP log here: https://www.dropbox.com/s/2cg6xurzipt8qnn/KSPlog.txt?dl=0

I looked through it, and there are quite a few errors mentioning:

[ERR 15:23:27.518] Cannot find a PartModule of typename 'ModulekOSVoidAction'

I added both kOS mod and the kOSforAll mod. Maybe the error because of kOSForAll...

This ship deff. has a kOS CPU in its design. But as is visible in the control panel of kOS, no CPUs are found.: 

Album s2IYQtc will appear when post is submitted

Edited by Denko666
added screenshot
Link to comment
Share on other sites

On 9/25/2018 at 4:45 PM, Steven Mading said:

CKAN provides no capacity (as far as I know) to update its notion of what a mod is compatible with without also uploading a new version of the mod.

CKAN does allow the compatibility information to be updated by the online copy of the .version file pointed at by its URL field.  In a Issue discussion, @HebaruSan said this:

Spoiler

The .version file for the supposedly 1.3.1 backport says:


  "URL": "http://ksp-avc.cybutek.net/version.php?id=559",

... which in turn says:


{"NAME":"Kerbalism","URL":"http://ksp-avc.cybutek.net/version.php?id=559","DOWNLOAD":"https://spacedock.info/mod/1749/Kerbalism","CHANGE_LOG_URL":"https://spacedock.info/mod/1749/Kerbalism","VERSION":{"MAJOR":1,"MINOR":9,"PATCH":0,"BUILD":0},"KSP_VERSION":{"MAJOR":1,"MINOR":4,"PATCH":4},"KSP_VERSION_MIN":{"MAJOR":1,"MINOR":4,"PATCH":0},"KSP_VERSION_MAX":{"MAJOR":1,"MINOR":4,"PATCH":5}}

So that's where it's getting 1.4 compatibility from. Updating the online .version file pointed to by URL allows mod authors to extend or change the game version compatibility info without requiring users to download a new copy of the mod (note that KSP-AVC also works this way). That URL field should point to an online .version file that's specific to the backport series, but it's currently shared with the 1.4 series.

"Updating the online .version file pointed to by URL allows mod authors to extend or change the game version compatibility info without requiring users to download a new copy of the mod (note that KSP-AVC also works this way)."

That's the URL field in the .version file.  If that online version is changed, what KSP-AVC and CKAN think of that releases' compatibility will be updated.

Edited by Jacke
Link to comment
Share on other sites

22 minutes ago, Jacke said:

CKAN does allow the compatibility information to be updated by the online copy of the .version file pointed at by its URL field.  In a Issue discussion, @HebaruSan said this:

  Reveal hidden contents

The .version file for the supposedly 1.3.1 backport says:



  "URL": "http://ksp-avc.cybutek.net/version.php?id=559",

... which in turn says:



{"NAME":"Kerbalism","URL":"http://ksp-avc.cybutek.net/version.php?id=559","DOWNLOAD":"https://spacedock.info/mod/1749/Kerbalism","CHANGE_LOG_URL":"https://spacedock.info/mod/1749/Kerbalism","VERSION":{"MAJOR":1,"MINOR":9,"PATCH":0,"BUILD":0},"KSP_VERSION":{"MAJOR":1,"MINOR":4,"PATCH":4},"KSP_VERSION_MIN":{"MAJOR":1,"MINOR":4,"PATCH":0},"KSP_VERSION_MAX":{"MAJOR":1,"MINOR":4,"PATCH":5}}

So that's where it's getting 1.4 compatibility from. Updating the online .version file pointed to by URL allows mod authors to extend or change the game version compatibility info without requiring users to download a new copy of the mod (note that KSP-AVC also works this way). That URL field should point to an online .version file that's specific to the backport series, but it's currently shared with the 1.4 series.

"Updating the online .version file pointed to by URL allows mod authors to extend or change the game version compatibility info without requiring users to download a new copy of the mod (note that KSP-AVC also works this way)."

That's the URL field in the .version file.  If that online version is changed, what KSP-AVC and CKAN think of that releases' compatibility will be updated.

So if I change the .version in our master github branch (where CKAN points to) then it will be seen by CKAN?  In my mind "change the master branch" *IS* making a release.  It's just missing the step where we upload the zip to other sites.

Link to comment
Share on other sites

3 minutes ago, Steven Mading said:

So if I change the .version in our master github branch (where CKAN points to) then it will be seen by CKAN?  In my mind "change the master branch" *IS* making a release.  It's just missing the step where we upload the zip to other sites.

You want to talk to @HebaruSan, or someone of equal knowledge about .version files, KSP-AVC, and CKAN, about exactly how to do that.  I'm still learning this.  Best to get it right the first time.

Edited by Jacke
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...