Jump to content

I want to learn how to make simple modded parts.


WhiteWeasel

Recommended Posts

Ok, I want to learn the basics of modding ksp. I'm somewhat familiar with coding, but not a whole lot. So It would be nice for someone to instruct me on how to make an alternate version of an existing part to start off easy. Let's take the ION engine for example. Alot of it is just changing numbers but still. And yes my save is backed up.

My goals

1)Make a copy of the ION engine (So I don't change the original)

2)Retitle copy to MLAS Adv. ION Thruster

3)Change thrust to .75 kN (50% increase)

4)Change mass to .30 (20% increase)

5)Change e/s from 14.442 to 17.331 (20% increase)

6)Make the blue "thrust" purple*

*Probably not done in the code I think. Don't want to worry about textures just yet.

Edited by WhiteWeasel
Link to comment
Share on other sites

Every thing you need is at Kerbal Space Program\GameData\Squad\Parts\Engine\ionEngine.

You want to edit the "part" CFG file.

You need to make a copy of the "ionEngine" folder and rename it to what you want. Also, don't forget to rename the "name = ionEngine" in the new part file, it needs to exactly match the name of the new folder.

Look here for more help http://wiki.kerbalspaceprogram.com/wiki/CFG_File_Documentation

Link to comment
Share on other sites

Hmm, I don't see power consumption anywhere.

PART
{
name = MLAS Adv. Ion Drive
module = Part
author = NovaSilisko

mesh = model.mu
scale = 1
rescaleFactor = 1

node_stack_top = 0.0, 0.2135562, 0.0, 0.0, 1.0, 0.0, 1
node_stack_bottom = 0.0, -0.1872844, 0.0, 0.0, 1.0, 0.0, 1

TechRequired = ionPropulsion
entryCost = 16800
cost = 5700
category = Utility
subcategory = 0
title = MLAS Adv. Ion Drive
manufacturer = Musteline Aerospace
description = Identical in structure to the PB-ION Electric Propulsion System, but internal circuts and and grid have been retofitted with more powerful, but costly replacements. Overall improvement to thrust, but higher weight and power consumtion as well.
attachRules = 1,0,1,1,0

// --- standard part parameters ---
mass = 0.30
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 7
maxTemp = 3600

MODULE
{
name = ModuleEngines
thrustVectorTransformName = thrustTransform
exhaustDamage = False
ignitionThreshold = 0.1
minThrust = 0
maxThrust = 0.75
heatProduction = 0
PROPELLANT
{
name = ElectricCharge
ratio = 12.0
}
PROPELLANT
{
name = XenonGas
ratio = 0.1
}
atmosphereCurve
{
key = 0 4200
}

}

MODULE
{
name = FXModuleAnimateThrottle
animationName = colorAnimation
dependOnEngineState = True
responseSpeed = 0.5
}

}

Link to comment
Share on other sites

Simple answer, sort of.

The Fuel use of an engine is based on three things, the thrust, the ISP and the fuel ratio.

The thrust changes the fuel use and changing maxThrust would change the fuel use per second at full power but not its efficiency.

Changing ElectricCharge ratio = 12.0 to a smaller ammount would mean it used less electric but MORE Xenon, the ratios of fuel here just changes there ratio of use not the engines ISP.

ISP or fuel use per thrust is defined by "atmosphereCurve key = 0 4200" this means at level 0 (and all other because no other are defined) the ISP is 4200 (really good).

If you want the engine to be less efficient change the atmocurve.

If you want the engine to use more fuel because it produces more thrust change maxThrust.

If you want the engine to use more Xenon and less electricicty then change the ratio numbers.

I can't tell if you want to change the engines ISP AND fuel ratio or just use more fuel as it is a stronger engine but using the same ISP.

Link to comment
Share on other sites

So the resources are not independent? It, might be a lot harder to keep ISP & fuel consumption the same and only increase thrust and e consumption than I thought. I might have to rethink what I'm going to change.

Overall my goal is to increase thrust, but make it consume more resources. Kinda of a side grade because it's more powerful, but weighs and needs more power, making it less useful for small craft. But since large (relatively) craft already have lot of peripherals the extra weight won't matter as much.

EDIT: Hmmm, the effect is more desired than I thought. Maybe I should drop the ISP for balance?

Normal drives:

ZXTowAn.jpg

My drives:

7PXy56H.jpg

Edited by WhiteWeasel
Link to comment
Share on other sites

Fuel units consumed per second by engine:

let mass_sum = total mass of all propellants in ratio form (sum, over all PROPELLANT, of ratio * density of each)

let desired_mass = thrust / Isp / 9.82

for each resource, consume desired_mass / mass_sum * ratio

Note that this means that changing the ratio of a massless resource (i.e. ElectricCharge) or the only massed resource (XenonGas, when the only other resource is ElectricCharge) has no effect on actual rate of consumption of the massed resource. What it does do is change how much the massless one(s) are consumed.

Example

Xenon 1, EC 15

is the same as

Xenon 2 EC 30

Both will result in Xenon and EC being consumed the same amount.

Note however that

Xenon 1 EC 30

and

Xenon 0.5 EC 15

will both result in a doubling of EC consumption from Xenon 1 EC 15.

======

If you want to keep XenonGas usage constant, you will need to change Isp in proportion to changing thrust. If you want to do that AND up electric usage, you should up Isp in proportion to changed thrust AND increase the ratio under ElectricCharge

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