Jump to content

Simple part.cfg help


Recommended Posts

Hi Guys,

I'm trying to write a very simple greenhouse life support part config but I'm very new to KSP modding and I'm having trouble...

The model I'm working with has window shutters and I would like to configure the following using only a single custom resource unit (life support) in addition to electric charge:

1. Sun up with shutters open means life support is being generated at rate of 1

2. No sun (and/or shutters closed) with lights off means life support is being generated at rate 0 (none)

3. No sun (and/or shutters closed) with lights on means life support is being generates at rate 0.2

Of course lights use electric charge when on. Simple enough right?

I butchered the following code from someone else's starting point. Probably easier for you to start from scratch if you want to help, I just included it so you didn't think I was too lazy to take a crack at this myself first...


PART{
name = greenhouse
module = Part
author = z

// --- asset parameters ---
mesh = model.mu
// --- node definitions ---
node_stack_top = 0.0, 1.61, 0.0, 0.0, 1.0, 0.0, 2
node_stack_bottom = 0.0, -1.61, 0.0, 0.0, 1.0, 0.0, 2
node_attach = 1.25, 0.0, 0.0, 1.0, 0.0, 0.0, 1

// --- editor parameters ---
TechRequired = spaceExploration
entryCost = 10400
cost = 4000
category = Science
subcategory = 0
title = GreenHouse
manufacturer =
description =
PhysicsSignificance = 1

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,1,1,1,0

// --- standard part parameters ---
mass = 4.0
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.3
angularDrag = 2
crashTolerance = 6
breakingForce = 200
breakingTorque = 200
maxTemp = 2900
fuelCrossFeed = True

MODULE
{
name = ModuleAnimateGeneric
animationName = door
startEventGUIName = Remove Shutters
endEventGUIName = Close Shutters
sunTracking = true
raycastTransformName = glass
pivotName = glass
isBreakable = false

powerCurve
{
key = 206000000000 0 0 0
key = 13599840256 1 0 0
key = 68773560320 0.5 0 0
key = 0 10 0 0
}
}
RESOURCE
{
name = LifeSupport
amount = 0
maxAmount = 10
}
MODULE
{
name = ModuleGenerator
requiresAllInputs = true
isAlwaysActive = true
INPUT_RESOURCE
{
name = ElectricCharge
rate = 0.0
}
OUTPUT_RESOURCE
{
name = LifeSupport
rate = 0.01
}
}
MODULE
{
name = ModuleGenerator
isAlwaysActive = false
activateGUIName = UV Lights ON
shutdownGUIName = UV Lights OFF
INPUT_RESOURCE
{
name = ElectricCharge
rate = 0.005
}
OUTPUT_RESOURCE
{
name = LifeSupport
rate = 0.002
}
}
}

Any help would be greatly appreciated. Thanks!

Link to comment
Share on other sites

You're going to need a plugin for that. You can't just take bits from different modules and stick them in a cfg; all a cfg is, is a set of data for *existing* code. I.e. the code will say "load this variable from cfg" and it will load the value from the line of that name in the cfg.

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