Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


erendrake

Recommended Posts

Is it possible to get the programming functions on a craft that's already in flight? I'd like to use it in an existing save. I tried copying the processor module from the mod parts but it didn't work.

Thx for you help. Awesome mod.

Is the file store on the vessel or on archive?

If it's on archive then it is a file on you're hard drive either in

(old KSP folder)\plugins\plugin data\archive\

Or (old KSP folder)\ships\scripts\

depending on the kOS version.

Copy the file from there and put it in

(new KSP folder)\ships\scripts\

If it is a .text file change it to .ks

If it is running locally on the vessel then:

If you are using remote tech and the craft is out of com range then:

- Backup save

- Remove remote tech .dll from the game data folder (just the dll not the parts)

If not using RT or if with com range jump to here.

- Load save and open vessel

- In the terminal type switch to 1. Or whichever volume it's on

- Then list. to get all file names on that volume

- Then go through typing copy [my_file] to 0. For each one to put the on the archive.

- Go back to the first bit that tells you how to get them off the archive.

Link to comment
Share on other sites

Is it possible to get the programming functions on a craft that's already in flight? I'd like to use it in an existing save. I tried copying the processor module from the mod parts but it didn't work.

Thx for you help. Awesome mod.

Why don't you make a new craft in the VAB trying to match the craft already in flight (setting the fuel values as closely as possible), add the part in question, launch it, close the safe and edit the safe file to match the orbital parameters of the old craft or just outright swap the craft definitions? :)

you can use notepad++ to edit the safe file easily.

Link to comment
Share on other sites

Hey Guys

I think i found an issue:

If you build a Ship (starting part KR-2042-b, after that probe core) and you launch it, everything seems to work.

But if you revert to launch, "lock steering to heading" is broken.

I don't know allready, if it only happens with unmaned vessels, or only if the kos part is the starting item of the vessel.

i spent about 3 hours to get through my code to find the issue (i am new to kos) there was none...related to that.... :D:D

output_log is here:

https://www.dropbox.com/s/xu6p2zz2pr96r8d/output_log4.txt?dl=0

Link to comment
Share on other sites

Okay i think i found the problem.

at the beginning of my script i set "SAS off."

But somehow it messes the steering up.

Same problem when i don't set sas to anything.

It only works, when i either activate and then deactivate SAS manually, or at the beginning of my script first activate it and then deactivate it.

Is that a bug?

Link to comment
Share on other sites

getting a ton of log spam:

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

kOS: Does "MODULERCS" == "MODULETWEAKABLERCS"?

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

kOS: Does "COLLISIONFX" == "MODULETWEAKABLERCS"?

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

kOS: Does "MODULEAGX" == "MODULETWEAKABLERCS"?

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

kOS: Does "FMRS_PM" == "MODULETWEAKABLERCS"?

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

kOS: Does "KASMODULEGRAB" == "MODULETWEAKABLERCS"?

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

kOS: Does "KOSNAMETAG" == "MODULETWEAKABLERCS"?

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

kOS: Does "MODULETWEAKABLERCS" == "MODULETWEAKABLERCS"?

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

kOS: yes it does

Fills up the log continuously while my script is running (which calls for ModuleTweakableRCS each tick)

Link to comment
Share on other sites

Quick question, because after reading a bunch of documentation on how RUN works I haven't seen anything that indicates this directly.

I know that when you RUN Program(args) the arguments get passed to the program called. My question involves the reverse situation. Is there a way that after the program is finished running it can pass a set of arguments back? From what I've read on the github documentation there is RETURN function for called programs.

This suggests to me that I would need to use DECLARE to set arguments I wish to return as global variables. If that is the case is there a way to release global variables?

Link to comment
Share on other sites

Is the file store on the vessel or on archive?

If it's on archive then it is a file on you're hard drive either in

(old KSP folder)\plugins\plugin data\archive\

Or (old KSP folder)\ships\scripts\

depending on the kOS version.

If not using RT or if with com range jump to here.

- Load save and open vessel

- In the terminal type switch to 1. Or whichever volume it's on

- Then list. to get all file names on that volume

- Then go through typing copy [my_file] to 0. For each one to put the on the archive.

- Go back to the first bit that tells you how to get them off the archive.

There are no files at all in these folders.

For the second option where do you want me to type stuff? Because I can't access the kOS terminal. Did you mean that or sth. else?

Thx for your help.

- - - Updated - - -

Why don't you make a new craft in the VAB trying to match the craft already in flight (setting the fuel values as closely as possible), add the part in question, launch it, close the safe and edit the safe file to match the orbital parameters of the old craft or just outright swap the craft definitions? :)

you can use notepad++ to edit the safe file easily.

I tried that but just copied the PART section for the kOS part to the old craft. The game then refused to load the save. It just paused for a second and went on where it was.

It seems like an awful lot of work to get every value perfectly right and there is so much room for little typing errors that I'm just not sure if it will work.

Thx anyway

Link to comment
Share on other sites

What IDE are people using?

I found kOS_IDE for Windows but it had problems finding the Archive and wanted to save with a .txt exension and seems to not be supported any longer.

Looking for something that would help me learn the syntax with highlighting and maybe autocomplete or suggestions of legal words.

Link to comment
Share on other sites

Could you make an option to change font size in the terminal, please? It would be nice to be able to scale it when resizing terminal window. Right now it's very small and hard to work with at higher resolutions. Thank you!

Wasn't able to find anything about that in the internet, so making a suggestion here.

Link to comment
Share on other sites

Hey, I had a funny idea recently: Could there be a command to play music or sounds? Something like "Play 1.". 1 is the name of the file, and the files which can be played are stored in the kOS FameData folder. This would be pretty neat, if kOS launches your rocket and in the background you can hear an epic song or so. :D

Link to comment
Share on other sites

What IDE are people using?

I found kOS_IDE for Windows but it had problems finding the Archive and wanted to save with a .txt exension and seems to not be supported any longer.

Looking for something that would help me learn the syntax with highlighting and maybe autocomplete or suggestions of legal words.

Try Atom (http://atom.io). Install autocomplte-plus package and kos syntax highlight package (search by kos)

Link to comment
Share on other sites

What IDE are people using?

I found kOS_IDE for Windows but it had problems finding the Archive and wanted to save with a .txt exension and seems to not be supported any longer.

Looking for something that would help me learn the syntax with highlighting and maybe autocomplete or suggestions of legal words.

If you check the reddit /r/kos area, people have made some syntax highlighter config files for a few common editors. They don't help you to know what the suffixes are for bound things, or the magic special variables, but they help with the basic syntax.

Link to comment
Share on other sites

What IDE are people using?

I found kOS_IDE for Windows but it had problems finding the Archive and wanted to save with a .txt exension and seems to not be supported any longer.

Looking for something that would help me learn the syntax with highlighting and maybe autocomplete or suggestions of legal words.

There is also language definition for notepad++. It can't autocomplete or suggest legal words, but it does good job with syntax highlight.

You can find link for notepad++ kOS script language somewhere in this thread. Sorry, don't have exact link for post.

Link to comment
Share on other sites

I'm a bit confused about interacting with parts. I'm trying to explore most basic stuff, but still get errors.

For example, when I run this programm from tutorial, it tells me "Undefined variable 'p'".

SET MOD TO P:GETMODULE("ModuleRTAntenna").

LOG ("These are all the things that I can currently USE GETFIELD AND SETFIELD ON IN " + MOD:NAME + ":") TO NAMELIST.

LOG MOD:ALLFIELDS TO NAMELIST.

LOG ("These are all the things that I can currently USE DOEVENT ON IN " + MOD:NAME + ":") TO NAMELIST.

LOG MOD:ALLEVENTS TO NAMELIST.

LOG ("These are all the things that I can currently USE DOACTION ON IN " + MOD:NAME + ":") TO NAMELIST.

LOG MOD:ALLACTIONS TO NAMELIST.

What am I doing wrong? Is there any place where parts and modules exploring/interactions are described in more detail?

I'm trying to activate RemoteTech antenna by the way. I can show my ship, etc. I'm running 0.16.2 version on kOS.

Please, help!

Link to comment
Share on other sites

Quick question, and sorry if this has been covered a hundred times already...

I'm using remotetech, if I start a KoS program while I have a connection, then my probe goes out of range, will the program continue to run? Very keen to use kos to carry out orbit insertion burns on the far side of planets for example.

Link to comment
Share on other sites

Quick question, and sorry if this has been covered a hundred times already...

I'm using remotetech, if I start a KoS program while I have a connection, then my probe goes out of range, will the program continue to run? Very keen to use kos to carry out orbit insertion burns on the far side of planets for example.

It will. if you dont forget to turn on the RT light on the KOS panel

Link to comment
Share on other sites

Does anyone have a valid use case for the following situation?

* You do have Remotetech installed.

but,

* You do NOT want the behavior of the CONFIG:RT light enabled?

We keep getting lots of posts by people saying kOS is broken and doesn't work with RT, and they're often spreading this misinformation in other places, based on not knowing about having to turn that option on.

The original reason for making it an option is that there once were some buggy problems in that code and it was considered experimental "as-is" software. But I wonder about whether it's worth it to keep it an option given how leaving it turned off really breaks kOS in RT - maybe it should just always behave like it's on, when RT is detected installed and enabled, and always like it's off when RT is not present.

Thus why I'm asking if there's valid use cases for it staying off when RT is present. There'd have to be in order for it to be a good idea for it to remain an option.

- - - Updated - - -

For example, when I run this programm from tutorial, it tells me "Undefined variable 'p'".

With the code snippet you posted it's impossible to tell what the problem is because it occurs prior to that point. The complaint is that when you do:

SET MOD TO P:GETMODULE("ModuleRTAntenna").

, there is no such thing as a variable "P" yet. P needs to have been set somewhere earlier than that line.

If this was taken from a tutorial it may be referring to a "P" that earlier code above in the same page has set, and the tutorial is assuming you already ran that earlier code.

Link to comment
Share on other sites

cool program. Endless possibilities. But found a small bug when messing around with the mod.

Problem: Stages or chutes are manually initiated or armed with use of space bar when used in terminal window.

To replicate:

- Build rocket (I have two nose cone parachutes attached to empty fuel tanks)

- Adjust stages so you have engine and then followed by chute by itself

- Launch rocket

- Open kOS terminal

- When terminal window is active and you press space bar (ex. "run <script>.") the parachute is armed and waits for correct velocity to deploy.

What should happen: Space bar should not cause any interference with rocket operation when used inside kOS terminal window.

Work around: type command while on launchpad but serves no use once rocket is launched or if user needs to issue additional commands in flight.

Mods used: kOS, KIS, KAS, realchutes, deadly reentry, TAC, FAR, kerbal engineer, KW, mechjeb, infernal robotics, stage recovery, station scienece, tweakscale, kerbal alarmclock, kolonization

Edited by Smokie23
Link to comment
Share on other sites

cool program. Endless possibilities. But found a small bug when messing around with the mod.

Problem: Stages or chutes are manually initiated or armed with use of space bar when used in terminal window.

Not had this problem with the space bar before (I have it with all other vessel controls) but you could try using this mod to help:

http://forum.kerbalspaceprogram.com/threads/108561-0-90-%28Jan25-15%29-Control-Lock-Input-text-into-text-fields-without-issuing-commands-to-your-vessel

Link to comment
Share on other sites

cool program. Endless possibilities. But found a small bug when messing around with the mod.

Problem: Stages or chutes are manually initiated or armed with use of space bar when used in terminal window.

To replicate:

- Build rocket (I have two nose cone parachutes attached to empty fuel tanks)

- Adjust stages so you have engine and then followed by chute by itself

- Launch rocket

- Open kOS terminal

- When terminal window is active and you press space bar (ex. "run <script>.") the parachute is armed and waits for correct velocity to deploy.

What should happen: Space bar should not cause any interference with rocket operation when used inside kOS terminal window.

Work around: type command while on launchpad but serves no use once rocket is launched or if user needs to issue additional commands in flight.

Mods used: kOS, KIS, KAS, realchutes, deadly reentry, TAC, FAR, kerbal engineer, KW, mechjeb, infernal robotics, stage recovery, station scienece, tweakscale, kerbal alarmclock, kolonization

Are you on Linux by any chance?

Link to comment
Share on other sites

Not had this problem with the space bar before (I have it with all other vessel controls) but you could try using this mod to help:

http://forum.kerbalspaceprogram.com/threads/108561-0-90-%28Jan25-15%29-Control-Lock-Input-text-into-text-fields-without-issuing-commands-to-your-vessel

Sucks that I need to install more mods but this worked for me. No more arming chutes!! Thanks

Are you on Linux by any chance?

Nope win8.1 64-bit.

Edited by Smokie23
Link to comment
Share on other sites

@Steven have you guys considered at all just dropping intrinsic support for RT? If you can get them to include signal delay in the right-click menu for antenna everything will be there for people to code in their own support or just release a function library for people to use with the new kOS version

Link to comment
Share on other sites

Just one question. I am aware that the KOS units don't "exist" in the VAB so uploading programs isn't possible until launch but I am still wondering. I found the lines of what's on the KOS hard drive in the perisistent file and now the question: Is it possible, or advisable, to alter the parts cfg in such a way that the hard drives will have files uploaded to them the moment you hit the launch pad and the units come into existence?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...