Jump to content

Help with engines?


Recommended Posts

Hello! I wanted to make part mods for a long time. Just to take a break from planet mods. But I can't find any tutorials on engines. The only tutorial I found was on fuel tanks. I got modelling down, but textures and all of that stuff (especially coding) just gets me. Any experienced part makers have a good tutorial for me? Thanks! :D

Link to comment
Share on other sites

What modeling software are you using? Do you know how to UV map your models?

The only code you'll have to write for an engine is a config file, unless you intend to write a plug-in, and cfgs are easy enough to get the hang of. Just take a peek at the existing engines setups and figure out what you want to change. But... here.


PART
{
name = VADULE
module = Part
author = Randazzo
MODEL /// <-- this makes something unreadable to the game, so you can type stuff after it. You can do a lot with the MODEL node, like reference textures from another place, but you can also just use mesh = model.mu
{
model = VanguardAstrodynamics/engines/VADULE/model
scale = 1.25,1,1.25
}
scale = 1
rescaleFactor = 1 /// This will default to 1.25, which is fine if your model is a 1 meter scale model and needs to be scaled up.
node_stack_top = 0.0, 0.012, 0.0, 0.0, 1.0, 0.0, 1
node_stack_bottom = 0.0, -0.352, 0.0, 0.0, -1.0, 0.0, 0 // The attachment node definitions. The first six are coordinates. The last one is the visual node size (0,1,2,3) and must be an integer. No 0.5 or anything like that.
node_attach = 0.0, 0.012, 0.0, 0.0, 1.0, 0.0, 1
fx_exhaustFlame_blue_small = 0.0, -0.137, 0.0, 0.0, 1.0, 0.0, running
fx_exhaustLight_blue = 0.0, -0.137, 0.0, 0.0, 0.0, 1.0, running
fx_smokeTrail_light = 0.0, -0.137, 0.0, 0.0, 1.0, 0.0, running
sound_vent_medium = engage
sound_rocket_hard = running
sound_vent_soft = disengage
sound_explosion_low = flameout
TechRequired = advRocketry
entryCost = 1600
cost = 390
category = Engine
subcategory = 0
title = VAD Ultra-Light Engine
manufacturer = Vanguard Astrodynamics
description = Designed to serve primarily as a landing engine, the VADULE is remarkably light yet powerful. However, as a result of it's lightweight design, it is somewhat more fragile than it's contemporaries.
attachRules = 1,1,1,0,0 /// Attachment rules. Stack, srfAttach, allowStack, allowSrfAttach, allowCollision. 1 is yes, 0 is no.
mass = 0.15
// heatConductivity = 0.06 // half default
emissiveConstant = 0.8 // engine nozzles are good at radiating.
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 4
maxTemp = 2000 // = 3600
bulkheadProfiles = size1
MODULE
{
name = ModuleEngines
thrustVectorTransformName = thrustTransform // thrustTransform can be named something else, it is the node in your model that denotes the thrust direction.
exhaustDamage = True
ignitionThreshold = 0.1
minThrust = 0
maxThrust = 40
heatProduction = 150
fxOffset = 0, 0, 0.21
EngineType = LiquidFuel
PROPELLANT
{
name = LiquidFuel
ratio = 0.9
DrawGauge = True
}
PROPELLANT
{
name = Oxidizer
ratio = 1.1
}
atmosphereCurve
{
key = 0 365 // These set your ISP curve. 1 = Sea Level on Kerbin or 1 atm. 0 is vacuum, and the bottom one defines at what pressure your engine has zero thrust for a proper curve.
key = 1 85
key = 5 0.001
}
}
MODULE
{
name = ModuleGimbal // If you have a gimbaling node, this is where you put it.
gimbalTransformName = nozzle
gimbalRange = 4
}
MODULE
{
name = ModuleAnimateHeat
ThermalAnim = heatanim // If you added an emissive animation, this is where you put it.
}
MODULE
{
name = ModuleAlternator
RESOURCE
{
name = ElectricCharge
rate = 2.0
}
}
RESOURCE
{
name = ElectricCharge
amount = 0
maxAmount = 0
isTweakable = false
hideFlow = true
}
MODULE
{
name = ModuleTestSubject // Including this will allow your engine to show up in contracts
environments = 15
useStaging = True
useEvent = False
}
MODULE
{
name = ModuleSurfaceFX // ground smoke
thrustProviderModuleIndex = 0
fxMax = 0.3
maxDistance = 30
falloff = 1.7
thrustTransformName = thrustTransform
}
}

This is important: Make sure your thrustTransform (or whatever you call it) local Z axis is pointing down in Blender. You can switch from local to global by pressing alt+space and selecting local.

hHhFCPUh.png

Edited by Randazzo
Link to comment
Share on other sites

What modeling software are you using? Do you know how to UV map your models?

The only code you'll have to write for an engine is a config file, unless you intend to write a plug-in, and cfgs are easy enough to get the hang of. Just take a peek at the existing engines setups and figure out what you want to change. But... here.


PART
{
name = VADULE
module = Part
author = Randazzo
MODEL /// <-- this makes something unreadable to the game, so you can type stuff after it. You can do a lot with the MODEL node, like reference textures from another place, but you can also just use mesh = model.mu
{
model = VanguardAstrodynamics/engines/VADULE/model
scale = 1.25,1,1.25
}
scale = 1
rescaleFactor = 1 /// This will default to 1.25, which is fine if your model is a 1 meter scale model and needs to be scaled up.
node_stack_top = 0.0, 0.012, 0.0, 0.0, 1.0, 0.0, 1
node_stack_bottom = 0.0, -0.352, 0.0, 0.0, -1.0, 0.0, 0 // The attachment node definitions. The first six are coordinates. The last one is the visual node size (0,1,2,3) and must be an integer. No 0.5 or anything like that.
node_attach = 0.0, 0.012, 0.0, 0.0, 1.0, 0.0, 1
fx_exhaustFlame_blue_small = 0.0, -0.137, 0.0, 0.0, 1.0, 0.0, running
fx_exhaustLight_blue = 0.0, -0.137, 0.0, 0.0, 0.0, 1.0, running
fx_smokeTrail_light = 0.0, -0.137, 0.0, 0.0, 1.0, 0.0, running
sound_vent_medium = engage
sound_rocket_hard = running
sound_vent_soft = disengage
sound_explosion_low = flameout
TechRequired = advRocketry
entryCost = 1600
cost = 390
category = Engine
subcategory = 0
title = VAD Ultra-Light Engine
manufacturer = Vanguard Astrodynamics
description = Designed to serve primarily as a landing engine, the VADULE is remarkably light yet powerful. However, as a result of it's lightweight design, it is somewhat more fragile than it's contemporaries.
attachRules = 1,1,1,0,0 /// Attachment rules. Stack, srfAttach, allowStack, allowSrfAttach, allowCollision. 1 is yes, 0 is no.
mass = 0.15
// heatConductivity = 0.06 // half default
emissiveConstant = 0.8 // engine nozzles are good at radiating.
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 4
maxTemp = 2000 // = 3600
bulkheadProfiles = size1
MODULE
{
name = ModuleEngines
thrustVectorTransformName = thrustTransform // thrustTransform can be named something else, it is the node in your model that denotes the thrust direction.
exhaustDamage = True
ignitionThreshold = 0.1
minThrust = 0
maxThrust = 40
heatProduction = 150
fxOffset = 0, 0, 0.21
EngineType = LiquidFuel
PROPELLANT
{
name = LiquidFuel
ratio = 0.9
DrawGauge = True
}
PROPELLANT
{
name = Oxidizer
ratio = 1.1
}
atmosphereCurve
{
key = 0 365 // These set your ISP curve. 1 = Sea Level on Kerbin or 1 atm. 0 is vacuum, and the bottom one defines at what pressure your engine has zero thrust for a proper curve.
key = 1 85
key = 5 0.001
}
}
MODULE
{
name = ModuleGimbal // If you have a gimbaling node, this is where you put it.
gimbalTransformName = nozzle
gimbalRange = 4
}
MODULE
{
name = ModuleAnimateHeat
ThermalAnim = heatanim // If you added an emissive animation, this is where you put it.
}
MODULE
{
name = ModuleAlternator
RESOURCE
{
name = ElectricCharge
rate = 2.0
}
}
RESOURCE
{
name = ElectricCharge
amount = 0
maxAmount = 0
isTweakable = false
hideFlow = true
}
MODULE
{
name = ModuleTestSubject // Including this will allow your engine to show up in contracts
environments = 15
useStaging = True
useEvent = False
}
MODULE
{
name = ModuleSurfaceFX // ground smoke
thrustProviderModuleIndex = 0
fxMax = 0.3
maxDistance = 30
falloff = 1.7
thrustTransformName = thrustTransform
}
}

This is important: Make sure your thrustTransform (or whatever you call it) local Z axis is pointing down in Blender. You can switch from local to global by pressing alt+space and selecting local.

http://i.imgur.com/hHhFCPUh.png

I got the model sorted out. And the texture.

wab0Wld.pngAnd thanks as well! :D

- - - Updated - - -

I can't get the Blue arrow to go down

Link to comment
Share on other sites

You do that in Unity, not Blender.

I've always done it in Blender, is it easier in Unity? Serious question.

Don't the pre-fab connections get messed up if you do it that way? Does that even matter?

Link to comment
Share on other sites

I've always done it in Blender, is it easier in Unity? Serious question.

Don't the pre-fab connections get messed up if you do it that way? Does that even matter?

In Unity, add an extra "empty" GameObject to the part hierarchy, rename it thrustTransform and align it accordingly. That works perfectly fine and doesn't break any prefabs.

Ok, so I got Unity, and it's stuck at the connecting bit...

http://i.imgur.com/R8uwR2F.png

Good. Cease and desist, and get unity 4.2.2 ;)
Oh, alright. :)

KSP still uses the legacy animation system for things like engine emissives, so you must use Unity 4.2.2.

Link to comment
Share on other sites

In Unity, add an extra "empty" GameObject to the part hierarchy, rename it thrustTransform and align it accordingly. That works perfectly fine and doesn't break any prefabs.

How does that work with gimbaling? Would I need to parent it or leave it be?

Right now I've got some engines with thrustTransform as parent to the nozzle and some with the Nozzle as parent to the thrustTransform and it never quite looks right.

Link to comment
Share on other sites

How does that work with gimbaling? Would I need to parent it or leave it be?

Right now I've got some engines with thrustTransform as parent to the nozzle and some with the Nozzle as parent to the thrustTransform and it never quite looks right.

I've never made gimballed engines myself, but the following might help you:

http://forum.kerbalspaceprogram.com/threads/28816-Gimbal-Module?p=355601&viewfull=1#post355601

Link to comment
Share on other sites

In Unity, add an extra "empty" GameObject to the part hierarchy, rename it thrustTransform and align it accordingly. That works perfectly fine and doesn't break any prefabs.

KSP still uses the legacy animation system for things like engine emissives, so you must use Unity 4.2.2.

How does that work with gimbaling? Would I need to parent it or leave it be?

Right now I've got some engines with thrustTransform as parent to the nozzle and some with the Nozzle as parent to the thrustTransform and it never quite looks right.

For gimbaling, I create the thrustTransform in Unity, as Sumghai mentioned, and then move the engine bell's object under it. It breaks prefab, yes, but that's never been a problem for me with engines. So far the only parts I've found that care about that are the landing gear/legs.

Just remember that the location of the thrustTransform's "center" will be the pivot for it to gimbal. So I usually position it at the top of the engine bell for this. If I'm doing a a non-animated gimbal, in which the thrust vector moves but the nozzle doesn't, then I'll position it down at the opening of the engine bell instead.

And yep, you need 4.2.2 if you want to animate heat glow. Later versions took out the ability to animate the emissive color/brightness.

Link to comment
Share on other sites

And yep, you need 4.2.2 if you want to animate heat glow. Later versions took out the ability to animate the emissive color/brightness.

I wouldn't say that it's been "taken out" - rather, from 4.3 onwards, animated emissives require the use of the new mecanim animator component.

Unfortunately, as KSP still uses the legacy animation system, it doesn't recognize mecanim animator-based emissive animations, hence the current workaround is to use the old 4.2.2 version.

Link to comment
Share on other sites

I wouldn't say that it's been "taken out" - rather, from 4.3 onwards, animated emissives require the use of the new mecanim animator component.

Unfortunately, as KSP still uses the legacy animation system, it doesn't recognize mecanim animator-based emissive animations, hence the current workaround is to use the old 4.2.2 version.

Yep, that's what I meant. Worded badly. :)

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