Jump to content

Can't locate classes for KSP Plugin Development


Recommended Posts

I've just installed KSP:Final Approach and want to make a "Hello World" type plug-in. I've watched and read some tutorials, and even tutorials with fairly recent dates don't appear to match what I am seeing. 

I'm using Visual Studio Enterprise 2019 as my IDE. I've Made a C# class library and have tried using  the .Net Framework versions 4.6 and 4.7. References to the following from the KSP game folder have been added to the project. 

  • Assembly-CSharp
  • Assembly-CSharp-firstpass
  • UnityEngine
  • UnityEngine.CoreModule
  • UnityEngine.InputLegacyModule
  • UnityEngine.UI

Many of the tutorials show references to a `Part` base class or `KSPAddon` attribute being added to a class. I've tried to do this and am running into issues immediately.  In the following I get errors that KSPAddon and Part cannot be found. 

 

using UnityEngine;

namespace TestPluginProject
{
    [KSPAddon()]
    public class TestPlugin:Part
    {
    }
}

 

I took a look at the classes in Assembly-CSharp and Assembly-CSharp-firstpass and sure enough, these classes are not defined in there. Is there some other DLL for which I should be adding a reference?

 

Thanks. 

Link to comment
Share on other sites

Found my answer!

I was using the resources from this path. 

Kerbal Space Program\Launcher_Data\Managed

That's not correct. There are some files with the exact same name that I should have used from the following path. 

Kerbal Space Program\KSP_x64_Data\Managed

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