Jump to content

I'm writing a plugin and I don't know where to start


Recommended Posts

So basically I'm trying to make a generator that takes a certain amount of electric charge to activate before it starts producing power. I'm completely new to the KSP API and I have no idea how to go about doing this. Does anyone know how I should start? I think once I know which classes to use, I'll be able to figure out the rest, but at the moment I'm kind of stuck.

Link to comment
Share on other sites

I've checked out most of the tutorials, so I'm somewhat familiar with the way plugins work. Currently, my plugin adds "start" and "stop" actions to the right-click menu that disable themselves when the other one is clicked, but nothing else. I'm having trouble figuring out how to check whether or not the ship has a certain amount of a certain resource. I'm also having trouble adding serialized KSPFields, as my solution apparently doesn't recognized the [Serialized] attribute.

Edited by Deus Zed Machina
Link to comment
Share on other sites

1 hour ago, Deus Zed Machina said:

I'm pretty sure GetConnectedResourceTotals is what I'm looking for, but I'm confused about what values to use for the arguments. How would I make proper use of this class?

When the documentation isn't clear (90% of the time), I google for "ksp" and the name of the function, which usually brings up the source for a few mods on Github. If I can't figure out how they work from reading, I'll clone the source locally and open the project to investigate where they're getting the parameters in more depth.

I know that doesn't answer your question about GetConnectedResourceTotals, but you know what they say about teaching a man to fish.

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