Jump to content

Making a greenhouse consume/produce ElectricCharge


Kimberly

Recommended Posts

I'm trying to modify someone's greenhouse for my personal use. I stripped out the IonCross stuff without trouble. However, I'm running into trouble getting it to both produce and consume electric charge: when the doors are open, I want it to act like a solar panel and generate electricity. But I also want it to be a constant electricity drain. Peak electricity production is equal to the drain, so you lose electricity if the sun's not directly overhead. Also, instead of "extend solar panel" and "retract solar panel", I want the buttons to read "open shutters" and "close shutters". The part's creator did this through giving the shutters a separate animation module, but this meant it acted as a solar panel regardless of whether the shutters were open, which is silly.

Producing electricity seems to be working--generation happens only if the shutters are open. However, I can't seem to figure out how to give it a constant electricity drain, or how to change the button labels. Currently, the code looks like this:

MODULE
{
name = ModuleDeployableSolarPanel

sunTracking = false

raycastTransformName = glass
pivotName = glass

isBreakable = false


resourceName = ElectricCharge

chargeRate = 2

animationName = door

powerCurve
{
key = 206000000000 0 0 0
key = 13599840256 1 0 0
key = 68773560320 0.5 0 0
key = 0 10 0 0
}
}
RESOURCE
{
name = ElectricCharge
amount = 50
maxAmount = 50
}

Any tips?

Edited by Kimberly
Link to comment
Share on other sites

I think the majority of this is past my skill so far (been modding a month=P) but I do have a couple ideas that may help.

First off I dont thing its possible to change GUI options for certain things, my guess is the solar pannel controls are in this group..I know landing legs are like this too.

As for getting it to use electric charge you could set up a generator module with electric charge as input instead of output. If that does not work you could use the Kethane conversion module, have it burn electric and make something pointless, like intake air (or make a new resource so the converter burns electric and makes 'plant food' or some such).

Link to comment
Share on other sites

I think the majority of this is past my skill so far (been modding a month=P) but I do have a couple ideas that may help.

First off I dont thing its possible to change GUI options for certain things, my guess is the solar pannel controls are in this group..I know landing legs are like this too.

As for getting it to use electric charge you could set up a generator module with electric charge as input instead of output. If that does not work you could use the Kethane conversion module, have it burn electric and make something pointless, like intake air (or make a new resource so the converter burns electric and makes 'plant food' or some such).

I tried a GeneratorModule, but this makes the description window show "Output" and then a blank line, and changes the right-click GUI as well, so that's not ideal.

Link to comment
Share on other sites

I tried a GeneratorModule, but this makes the description window show "Output" and then a blank line, and changes the right-click GUI as well, so that's not ideal.

That's weird. What's the code you use for the GeneratorModule? I would think this should work:

MODULE
{
name = ModuleGenerator
isAlwaysActive = true
INPUT_RESOURCE
{
name = ElectricCharge
rate = 0.75
}
}

Edited by PrivateFlip
Link to comment
Share on other sites

By an amazing coincidence, this is exactly the same thing I came here for help on also. :)

EDIT: A link to the part, and to the post in the IonCross thread if that helps at all (the latter contains a screenshot, as well as permission - "If some one else need it then can to use it by any way without ask.").

Edited by Commander Zoom
Link to comment
Share on other sites

Good and bad news...

I know "Exactly" how to get to work... (Maybe. but you should ask someone more skilled than i)

you need to make a plugin to add a module with more functions.

where it says "MODULE { Name = ModuleGenerator" it refers to a class file in (where it is on your computer)\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll and the values in the part.cfg simply fill in variables already in that file. and when it loads that file it overwrites some gui elements which is why the parts ingame interface changed.

but unfortunately the process you want it to do is simply not programmed in to that class file, so you may enter the correct variables but the class file is simply not looking for them, so nothing happens.

and this is the rest of the bad news i cant program dll's, I ran into the same problem for a mod i am building, and am attempting to make a dll myself. but am failing. and i too am looking for help :(

so actually no "good" news then sorry. but i hoped i helped you understand what the problem is.

And if you or someone you know is good a C# or even C++ (because they're similar) programming you could get them to help

Edited by tomwillp
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...