Jump to content

ECMAScript Control Scripting for KSP


secretformula

Recommended Posts

I am working on a mod that would allow scripting of KSP actions (thrust control, directional control, action groups) in response to vessel variables (Altitude, speed, etc). In a way it would work sort of like the mod KOS except rather than use a custom brew programming language (along with the bugs doing so entails) I am using ECMAScript with a reference interpreter to allow for better performance and easier maintenance.

My question to the community:

Is there a desire to have a complete computing system of parts (i.e. you need a hard drive, network adapter processor on the ship). Or just a plain simple click this to run a script to control the ship, no frills sort of mod.

Ideas?

Link to comment
Share on other sites

I am working on a mod that would allow scripting of KSP actions (thrust control, directional control, action groups) in response to vessel variables (Altitude, speed, etc). In a way it would work sort of like the mod KOS except rather than use a custom brew programming language (along with the bugs doing so entails) I am using ECMAScript with a reference interpreter to allow for better performance and easier maintenance.

My question to the community:

Is there a desire to have a complete computing system of parts (i.e. you need a hard drive, network adapter processor on the ship). Or just a plain simple click this to run a script to control the ship, no frills sort of mod.

Ideas?

Well, something that works is always better than something that doesn't. So, my suggestion is to go for simple at first. If that's completed and you still want to add more functionality/depth, then, by all means add extra features like specific gear, or specific requirements like HDDs, etc.

Link to comment
Share on other sites

That is currently the plan, I hope to have something minimally usable along with an API posted in the next few days. The hardest part will most likely be implementing the console interface

It may be worth looking at the kOS license to see what may be freely used there regarding the console interface.

As far as minimally working goes, it may also be worth simply reading in a text file to make sure the system works, and leaving a functioning console out, at least initially.

Link to comment
Share on other sites

I'd say just leave it as a single part. That makes it easy for the user to choose whether the plugin is active on any given ship. I can't really see how splitting it into multiple parts would add to the fun. Perhaps something to revisit when budgets are added to the game, but personally if I'm going to add some scripting to my craft I'd rather not have to deal with artificial limitations like program size.

Link to comment
Share on other sites

Please tell me it will allow for events, instead of just always running in a loop, preferably with a timer event that runs off of game time rather than real time :-) Oh, and a "computer reset" event for quickloads, unless you go so far as to save the program and state in the quicksave file.

I'd think keep it to a single, potentially upgradeable part. Have the part limits specified in the .cfg file, possibly overridden by tweakables. Keep it simple, because as was said, I don't see where complicating the installation of the device would add much in this case. It's about being able to preprogram maneuvers, not computer maintenance. Not sure if CPU speed limitations could be easily enforced, that would probably depend on the interpreter in question. Memory limits could probably be enforced and optionally upgradeable.

You'll probably want to implement some sort of loadable modules (preferably with the ability to unload a module, though that gets tricky) so that you don't need the entire program in a single file, though that would be an acceptable limitation if it isn't easy to implement.

And then it occurs to me I'm giving you suggestions you didn't ask for, so I'll shut up for now :-)

Link to comment
Share on other sites

I was thinking of doing something like this, but I was overcome by procrastination and excessive laziness. Also, I was going to try to use something like Guile, which would probably annoy everyone but me and the other two people who actually like Scheme. :rolleyes:

I'd definitely like to see it as a module, such that you can have a part for it, or simply add it to a command pod as a MODULE à la MechJebCore and kOSProcessor.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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