Jump to content

How to make a mod


Rigel Agar

Recommended Posts

[MOD - Moved to Add-on Discussions subforums, as that is the appropriate place to be asking about add-on making in general]

As your question is a very broad one, the answer depends on a number of factors.

Firstly, what sort of add-on do you want to make?

- A Part or Parts Pack add-on that provides new components to build spacecraft from requires knowledge of 3D modelling, texturing and CFG file writing

- A Plugin add-on that provides new functionality to the game or individual spacecraft requires programming and compiling in C#

- Other types of add-ons include alternative flags, textures, configuration file patches for crafts/resources/planets

- It is possible for an add-on to include both Parts and Plugins

Secondly, what do you want your add-on to do?

Do you want to make a whole range of new rocket / spaceplane parts? Or just one or two small utility parts like a spinning light or a science experiment? Or maybe you want to write a new guidance system for KSP crafts?

Thirdly, what sort of technical expertise do you have?

Some people are very good at making and texturing models, while others are good at programming code. A few a good at both, and still others may be good at writing CFG files or contracts.

"Project Managers" and "Ideas People" are generally frowned upon in this community, because more often than not such people make promises/demands/requests without putting any tangible effort into the final product, nor do they usually understand the technical limitations of the game / modding API

Fourth, how much time do you want to invest in learning to make and maintain add-ons?

Modding should be considered a fairly serious commitment - once you make a mod, you need to maintain it by releasing updates and bugfixes, dealing with user issues etc.

If you have little to no knowledge in modelling, texturing or programming, but still really want to learn to make a mod, start with something very small and very simple, to learn the basics before moving on to more ambitious projects.

Your responses to these questions will determine what tools/resources you will need.

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
On 10/04/2016 at 3:20 AM, Maxsimal said:

i'm curious about this too, from the programming route you outlined.

What are the key necessities there?   Visual Studio, Unity (5 now..?) and what else?   

I don't do plugin coding myself, but this list of links curated by @CaptainKipard may help:

On 25/09/2014 at 9:28 PM, CaptainKipard said:

PLUGIN DEVELOPMENT

I would love someone with Plugin experience to point out helpful threads for this

Add-on Posting Rules

CompatibilityChecker - Source code for plugin authors to implement a checker that shows a message if their mod is incompatible with the user's version of KSP and/or Unity

KSP API Documentation

Starting out on Plugins

KSP Plugin Framework - Plugin Examples and Structure - by TriggerAu, very recent and up to date

Example plugin projects to help you get started - by TaranisElsu

The official unoffical help a fellow plugin developer thread

Wiki page on Plugins

Creating your first module - on the Wiki

Info on spawning objects and applying gravity - Includes example code, links to more examples, and some useful hints.

How to animate a part with multiple animations?

Great info on Kerbal transforms, bones, rig, FSM, states (ragdoll, idle, sumble, run etc) 

Link to comment
Share on other sites

The easiest way, by far, is to go download SharpDevelop (that also include the c# compiler/assembler).
Then create a new empty project and add the reference assemblies for KSP and Unity:
- Assembly-CSharp
- Assembly-CSharp-firstpass
- KSPUtil
- UnityEngine
- UnityEngine.UI

Then take the default .cs file the project comes with, remove all the content and put this in its place:

using System;
using System.Collections.Generic;
using UnityEngine;


namespace YourStuff {


[KSPAddon(KSPAddon.Startup.MainMenu, true)]
public class MyMod : MonoBehaviour
{
  // keep it alive
  MyMod() { DontDestroyOnLoad(this); }
  
  // called at every simulation step
  public void FixedUpdate()
  {
    print("hello world");
  }
}
  
public class MyPartModule : PartModule
{
  // this is loaded from .cfg
  [KSPField] public float my_value;
  
  // this is an event
  [KSPEvent(guiActive = true, guiName = "Click me!", active = true)]
  public void ClickMe()
  {
    Monobehaviour.print("stop clicking me!");
  }

  // shown on the part tooltip in editor
  public override string GetInfo()
  {
    return "hello world!";
  }
}
  
} // YourStuff

Then, gets yours hands dirty :) Have fun

Link to comment
Share on other sites

  • 7 months later...
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...