Jump to content

Engine modification: Changing from 2 fuels to 1


Recommended Posts

I am having some difficulty modifying a part. Namely an ION engine

Here is the stock module:

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

}

Now, I wanted to change this engine so that it only runs on electricity. So I removed the XenonGas portion from the module. I then changed the max thrust from 2 to 40. Although I know the fuel intake scales with the thrust, I also wanted the it to require an even higher electric charge to operate as it no longer required xenon so I changed the ElectricCharge ratio from 1.8 to 3. This is what it looks like now:

MODULE{
name = ModuleEngines
thrustVectorTransformName = thrustTransform
exhaustDamage = False
ignitionThreshold = 0.1
minThrust = 0
maxThrust = [COLOR=#ff0000]40[/COLOR]
heatProduction = 0
PROPELLANT
{
name = ElectricCharge
ratio = [COLOR=#ff0000]3[/COLOR]
}

atmosphereCurve
{
key = 0 4200
}

}

What I got was an engine with a fuel consumption of infinity. I messed with the atmosphereCurve thinking that was the issue but no.

I am looking though the documentation on here but I have not found my mistake yet. I am sure it is something easy that I fouled up or missed. I suspect that "ratio" is the problem yet I don't understand how I can set the fuel consumption rate without it?

Link to comment
Share on other sites

Well that was quick. Thank you :)

So in order for ModuleEngines to function, it requires fuel which has mass. being as I doubt squad wrote a module for a purely electric means of propulsion though space as it defies physics as we know it, I am probably going to have to write one.

Could you do me one last kindness? I have unity installed and at the project wizard, however I am not sure what packages to import in order to create a module. First time using it

Link to comment
Share on other sites

You don't use Unity for coding; you write the plugin in C# and compile it. Here's the (old but AFAIK still valid) guide:

http://wiki.kerbalspaceprogram.com/wiki/Plugins

You might want to, instead, do what FireSpitter does: have the ModuleEngines use a resource that the part itself (via a ModuleGenerator) creates. Check out FireSpitter's electric engines; they do this (using FSCoolant IIRC).

Link to comment
Share on other sites

I will take a look at what FS did for his. I think I get the idea as I messed a little with the ModuleGenerator for a mater-antimater reactor mock up. But I think I will take the harder path and try coding something. That way I learn something about the game engine instead of just messing in config files.

Thanks for the link

I'll see ya around

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