Jump to content

Absolute beginner at plugins- how do I start?


Recommended Posts

11 hours ago, ThatGuyWithALongUsername said:

Just installed Monodevelop/Xamarin studio thingy. I already know similar programming languages and how OOP works, so I feel like I can learn C# quickly. I also have a few small ideas that I feel would be easy to make.

Where/how do I start making KSP plugins?

Start here... links to everything, and tutorials.

 

Link to comment
Share on other sites

Welcome to the wide world of modding!  I started by taking a then-defunct mod and modifying the source code to how I wanted it to function.  Are you working on an Apple product or Linux?  If Linux, I had some trouble with MonoDevelop earlier and you may want to look at the messages between @Tralfagar and @AliceTheGorgon in this thread.  Essentially MonoDevelop defaults to a version of Mono that is different than what KSP uses (IIRC 4.0 or so).  You'll need to download an earlier version (IIRC 3.12) and tell Mono to use that version instead.  That post and the following discussion/troubleshooting goes into how to install the correct version of Mono.

As for knowledge of how to create plugins for KSP, check out the New API Documentation thread and the associated wiki (click "classes" on top to view).  You'll also want to look into the Unity API for the class MonoBehaviour.  A lot of KSP classes derive from this class and it contains several methods you'll use quite a bit (such as OnStart, OnGui, Update, FixedUpdate).

And finally, check out the KSP Wiki on creating your first module for an example of how the .cfg files play with the programming.

Oh!  And one more thing.  Upgrading to Unity 5 broke some stuff in mods that were using previous versions of Unity.  Check out this thread.  Especially if you're going to be doing something with GUI elements (which almost all mods do).

Link to comment
Share on other sites

On 6/18/2016 at 5:35 PM, ThatGuyWithALongUsername said:

Just installed Monodevelop/Xamarin studio thingy. I already know similar programming languages and how OOP works, so I feel like I can learn C# quickly. I also have a few small ideas that I feel would be easy to make.

Where/how do I start making KSP plugins?

Like Mr. Anderson above, I 'absorbed' some code chunks from another mod I was interested in and began beating them briskly to find answers.  That, and I had another modder on Skype who answered a lot... a LOT of stupid questions.

Unfortunately, unless you devote your life to figuring out how to mod for KSP, you'll probably be like many of us.  A mushroom.  Kept in the dark and fed manure.

C# is not one my native languages either.  And while the logic and syntax of it is close enough to others you can figure it out, the problem arises in the Unity and KSP code you're trying to use to make things work.  Either it's half documented, the documentation is outdated or it's just not there at all.  Squad will tell you next to nothing about how their code works and when they do provide answers it's usually couched in a format that makes it appear God is talking to some lowly peasant.  So, like that humble peasant, we tend to learn how this crap works via experimentation, googling, or getting on these forums and asking if anyone else has had that problem.

I wish I had a better answer for you but, like the game of KSP itself, modding usually involves lots of explosions.

GL.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...