Jump to content

Question about reprogramming mods


Orion Pax

Recommended Posts

Hi

I'm not sure where to post this soo...

Anyways, my question is how to reprogram certain parts in certain mods?

Let's take MechJeb for example, I'm pretty sure that if I can access the Space Plane Guidance files, it is possible to add more things to do. In other words, instead of just heading and altitude, I can add speed. I'm guessing that the source file will show something like maintain heading X and so on so if I define speed and add it as an option it will maintain the given speed by controlling the throttle.

Another example is in BD armory, say the AIM-9 sidewinder. If you've ever used this mode you probably know that the missiles just suck and few flares/chaffs with some random turn will manage to avoid the missile - disgusting :rolleyes:      Is it possible to edit the algorithms or whatever it is that guides the missile and make it better? (more parameters etc... ) I can then proceed to make my own designs and so on... 

* I know nothing about programming as of now so if I messed terminology - that's why :blush:

*** If I really manage to reprogram stuff, it will be just for personal use only. If it turns out to be so great that I want to share it with the community, I will be sure to ask for permission from the authors and give credit.

Thanks 

Edited by Orion Pax
Link to comment
Share on other sites

If you don't know about programming, i would take things slowly. Without learning C# (or, at least, any other more serious language) first, you can't expect to just understand the source AND being able to change it without breaking things.

If you are motivated to try, great. I just advise you to learn programming first.

Link to comment
Share on other sites

If you're completely new to programming, I would start with a language that allows you to instantly see results.  It doesn't have to do with KSP, but just to get you into an environment where you're comfortable staring at lines of code.

I don't know squat about Python, but from what I understand, this would be a good start for beginners.

You could also play around in HTML/Javascript/CSS.  Pretty straightforward, easy to learn, and you can see what you've changed with a simple refresh.  After you get comfy in the programming environment, you can move onto stuff like C# for KSP.

Link to comment
Share on other sites

On 12/9/2017 at 3:32 PM, Orion Pax said:

Let's take MechJeb for example, I'm pretty sure that if I can access the Space Plane Guidance files, it is possible to add more things to do. In other words, instead of just heading and altitude, I can add speed. I'm guessing that the source file will show something like maintain heading X and so on so if I define speed and add it as an option it will maintain the given speed by controlling the throttle.

In very simplistic terms -- yep, that is pretty much what goes on under the hood.  Should be entirely doable.

But that is a vast oversimplification.  That particular code is likely a mix of physics, KSP method calls, and GUI updating code.

I would suggest starting with trying to program something a bit simpler -- a basic PartModule that has buttons / consumes resources / etc.  Get a feel for the C# language, the system APIs, Unity APIs, and then finally, KSPs own API.

Trying to jump right into the 'adjust other peoples code' will be a very big uphill battle as you are fighting against lack of knowledge of the basics (like syntax, structure, or even just how to setup the project files to compile correctly).  Start small, work up to big.

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