Jump to content

PartModules, Required Inputs and isAlwaysActive only for ModuleGenerator?


Recommended Posts

Regarding calls to requiresAllInputs and the associated INPUT and OUTPUT_RESOURCE, as well as isAlwaysActive, are they specific to the ModuleGenerator, or can we use them in modules that are not declared as ModuleGenerator?

Sorry if this has been covered before, I have done a few searches and was unable to find anything on that topic.

Link to comment
Share on other sites

Ok so let's take a step back.

since KSP 0.20.0 everything in a cfg file is either a config node, or in a config node, in most cases where addons are involved that's PART{}

Everything inside a config node defines information about that config node.

So when you say PART{name = bedazzle}, you're setting the variable "name" in that particular instance of PART{} to "bedazzle"

Here's the trick. You can set any variable you want, and you can set it to anything you want to.

But if the code associated with the confignode you do it in does not know to use that variable, it won't do anything.

PART{bandana = banana} is totally valid and won't throw any errors at all.

PART{}, INTERNAL{}, PROP{}, ATTACH{}, MODEL{}, RESOURCE_DEFINITION{} and RESOURCE{}, all have specific code associated with them, but MODULE{} doesn't, the code associated with MODULE{}, and thus the code that uses the variables you set in it, is determined by MODULE{name}

So yes, you can set requiresAllInputs, input_resource, output_resource, and isAlwaysActive literally anywhere you want.

'S'not gonna do anything most of the time.

Edited by Greys
Link to comment
Share on other sites

Ok thanks, Greys, that's what I was getting at... I wasn't sure if they actually were usable with all partmodules or not. I see now that they are not, and have to be defined properly. Now that I'm looking at monodev and plugin development, I'm beginning to see how I can actually build out what I'm looking for.

Thanks for the help.

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