Jump to content

No On/Off Switch


Recommended Posts

Currently, I've run into something I don't know quite how to fix. I am making an Energy to Mass generator, but for it to even work, I need it to be toggle-able. Currently, I know that parts, like rockets and solar arrays, can be right-clicked during flight.

Currently, that's only part of it. I need to be able to make it to where it can be accessed with the gear settings, like putting the toggle to a hotkey (0-9, etcetera).

I'm basically just rewriting the part config file for a copied large RCS tank, but that shouldn't pose a problem. I've got everything set up: Power consumption, and generation, but it has no on/off switch, so it will not work.

I looked over the XenonGas engine file, seeing as it only had 2 buttons in it's GUI, toggling the engine on and off and even locking the gimbal, but I found nothing that could be done but maybe changing the properties of the new ETM generator into thinking it's an engine. I modified the XenonGas engine previously to produce XenonGas faster than it uses it (A bit cheaty, but yes, I wanted to make my "Warp" engines a reality), and I know that LiquidFuel generation can be done just as easily.

The only problem I have is that there is no On/Off switch...

Link to comment
Share on other sites

ModuleGenerator has the requisite KSPEvents (and KSPActions btw) to allow toggling on/off from either context menu (right-click) or action groups. These are however not available if you've set your generator up to be always active. You should have this in the config for the module:


isAlwaysActive = False

Link to comment
Share on other sites

Hm. I don't think I follow. I asked about how I give it an on/off switch, because I can't even turn it on, but you instead tell me that it's always active, and that I need to turn it off. ಠ_ಠ

You sound like you have experience, but seriously, you didn't even tell me WHERE in the coding this should go. It's not even in there part file where I can change this particular setting. So, I come to my conclusion, and final question, WTF am I supposed to do with this?

Link to comment
Share on other sites

Hm. I don't think I follow. I asked about how I give it an on/off switch, because I can't even turn it on, but you instead tell me that it's always active, and that I need to turn it off. ಠ_ಠ

I'm telling you to turn off the setting in the part config file that forces the generator to not be toggleable.

For further reference, here is an excerpt of the module as defined in the config for the stock RTG. I've highlighted the parameter you'll need to change to false.


MODULE
{
name = ModuleGenerator
[b]isAlwaysActive = true[/b]
OUTPUT_RESOURCE
{
name = ElectricCharge
rate = 0.75
}
}

I'f it's still not working, feel free to post a pastebin, or whatever you prefer, of your config file. It's always hard to bugtrack when you don't have a complete overview.

Link to comment
Share on other sites

Alright, I can't even do that. In fact, right now, I need to change a few thigns, and shoot in the dark here. currently I had apparently given it a new type of propellant.

PROPELLANT

{

name = ElectricCharge

ratio = 160.0

}

If I have realized what I'm doing is as I had predicted, I may have done the exact thing I was trying NOT to do, and ended up connecting it's function to the engine throttle itself. Unless I'm wrong, and I jsut need to change a few thigns.

The only other important part after that is this:

MODULE

{

name = ModuleAlternator

RESOURCE

{

name = LiquidFuel

rate = 0.9

}

}

}

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