Jump to content

Brand new. How to create plugin not bound to a part?


Recommended Posts

I just started looking into KSP modding, so forgive me if this common knowledge, I haven't been able to find any examples of what I'm trying accomplish. All the tutorials I've involve binding code to new parts that you add to a vessel. I'd like to create a plugin that runs regardless of whether it's bound to a part. Are there any examples of that anywhere?

Context: I wrote a C# software controller for a joystick with light-up buttons. I'd like to be able to figure out what buttons to light up based on the current state of the game. For example, the "Toggle SAS" button on the joystick could light up when SAS is enabled on the active vessel. Further, I'd like to detect when the user is in the VAB, so I can dynamically change the joystick's button bindings. I'd like the plugin to work without having to explicitly add a part to the ship. Is this possible?

Thanks!

- - - Updated - - -

And one more search answered my question....

[KSPAddon(KSPAddon.Startup.MainMenu, false)]

public class YourPlugin: MonoBehaviour

{

public void Awake() { }

public void Start() {

print("Holy Sh*t the plugin started correctly!!");

}

}

- - - Updated - - -

One more followup, are there any blacklisted libraries anymore? The wiki mentioned System.IO used to blacklisted, and I need a System.IO.Pipe for the interprocess communication to my joystick controller.

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