Jump to content

Recommended Posts

Hello !

Im working on my first ksp mod who's gonna add new propulsion systems (like nuclear fusion or antimatter for example).

I have a little problem with one of my engines : im using a module enginesFX for the engine principal informations and a prefab_particle for the flame. And the flame, dont want to apears when the engine start.

If someone can check the code and tell me if there is errors, it will be very helpful !  Thank you !!:D:D

PART
{
	name = EtrFusion1
	module = Part
	author = Lgg159
	mesh = model.mu
	rescaleFactor = 0.78125
	node_stack_top = 0.0, 0.16, 0.0, 0.0, 1.0, 0.0, 1
	TechRequired = heavyRocketry
	entryCost = 0
	cost = 36000
	category = Engine
	subcategory = 0
	title = "ETR-1" Aerospike Fusion Engine
	manufacturer = UTech Nucler Science Inc.
	description = The "ETR-1" engine use a new technology : it uses nuclear fusion and electromagnetic fields to create and propulse very hot helium in the space.
	attachRules = 1,0,1,0,0
	mass = 2.7
	heatConductivity = 0.06 
	skinInternalConductionMult = 4.0
	emissiveConstant = 0.8 
	dragModelType = default
	maximum_drag = 0.2
	minimum_drag = 0.2
	angularDrag = 2
	crashTolerance = 10
	breakingForce = 200
	breakingTorque = 200
	maxTemp = 3000
	bulkheadProfiles = size1
	tags = fusion etr nuclear helium he3 magnetic tritium deuterium
	MODULE
	{
		name = MultiModeEngine
		primaryEngineID = Helium3
		primaryEngineModeDisplayName = Helium3
		secondaryEngineID = Tritium
		secondaryEngineModeDisplayName = Tritium
		autoSwitchAvailable = False
	}
	MODULE
   {
        name = ModuleEnginesFX
		engineID = Helium3
		powerEffectName = running
        thrustVectorTransformName = thrustTransform
        exhaustDamage = True
        ignitionThreshold = 0.1
        minThrust = 0
        maxThrust = 5600
        heatProduction = 400
        fxOffset = 0, 0, 1.2
    PROPELLANT
    {
        name = DeuteriumFuel
        ratio = 4.5
        DrawGauge = True
    }
    PROPELLANT
    {
        name = Helium3Fuel
        ratio = 3
    }
	atmosphereCurve
	{
		key = 0 20000
		key = 1 19800
		key = 6 0.001
	}
   }
   	MODULE
    {
        name = ModuleEnginesFX
		engineID = Tritium
		powerEffectName = running
        thrustVectorTransformName = thrustTransform
        exhaustDamage = True
        ignitionThreshold = 0.1
        minThrust = 0
        maxThrust = 5500
        heatProduction = 390
        fxOffset = 0, 0, 1.2
    PROPELLANT
    {
        name = DeuteriumFuel
        ratio = 4.5
        DrawGauge = True
    }
    PROPELLANT
    {
        name = TritiumFuel
        ratio = 3
    }
	atmosphereCurve
	{
		key = 0 19800
		key = 1 19200
		key = 6 0.001
	}
   }
   	EFFECTS
	{
		running
		{
			AUDIO
			{
				channel = Ship
				clip = sound_rocket_hard
				volume = 0.0 0.0
				volume = 0.05 0.6
				volume = 1.0 1.5
				pitch = 0.0 1.2
				pitch = 1.0 2.0
				loop = true
			}
			PREFAB_PARTICLE
			{
				prefabName = fx_exhaustFlame_blue
				transformName = thrustTransform
				emission = 0.0 0.0
				emission = 0.05 0.0
				emission = 0.075 0.25
				emission = 1.0 1.25
				speed = 0.0 0.25
				speed = 1.0 1.0
				localOffset = 0, 0, 0
			}
			PREFAB_PARTICLE
			{
				prefabName = fx_exhaustLight_blue
				transformName = thrustTransform
				emission = 0.0 0.0
				emission = 0.05 0.0
				emission = 0.075 0.25
				emission = 1.0 1.25
				speed = 0.0 0.25
				speed = 1.0 1.0
				localOffset = 0, 0, 0
			}
			
		}
	}
	MODULE
	{
		name = ModuleGimbal
		gimbalTransformName = thrustTransform
		gimbalRange = 3
	}
	MODULE
	{
		name = FXModuleAnimateThrottle
		animationName = ksp_l_midrangeEngine_anim
		responseSpeed = 0.001
		dependOnEngineState = True
		dependOnThrottle = True
	}
	MODULE
	{
		name = ModuleAlternator
		RESOURCE
		{
			name = ElectricCharge
			rate = 6.0
		}
	}
	MODULE
	{
		name = ModuleTestSubject
		useStaging = True
		useEvent = True
		situationMask = 127
		CONSTRAINT
		{
			type = REPEATABILITY
			value = ALWAYS
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = REPEATABILITY
			value = BODYANDSITUATION
			prestige = Significant
		}
		CONSTRAINT
		{
			type = REPEATABILITY
			value = ONCEPERPART
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = GT
			value = 4000
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = LT
			value = 8000
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = GT
			value = 2000
			prestige = Significant
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = LT
			value = 4000
			prestige = Significant
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = GT
			value = 1000
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = ALTITUDEENV
			test = LT
			value = 2000
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = ALTITUDE
			test = GT
			value = 0 // this just registers altitude as something to care about
			situationMask = 8
		}
		CONSTRAINT
		{
			type = ALTITUDE
			test = LT
			value = 300000
			situationMask = 16
			body = _NotSun
		}
		CONSTRAINT
		{
			type = ALTITUDE
			test = LT
			value = 600000
			situationMask = 32
			body = _NotSun
		}
		CONSTRAINT
		{
			type = SPEED
			test = GT
			value = 0
			situationMask = 8
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = SPEED
			test = LT
			value = 600
			situationMask = 8
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = SPEED
			test = GT
			value = 300
			situationMask = 8
			prestige = Significant
		}
		CONSTRAINT
		{
			type = SPEED
			test = LT
			value = 1200
			situationMask = 8
			prestige = Significant
		}
		CONSTRAINT
		{
			type = SPEED
			test = GT
			value = 600
			situationMask = 8
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = SPEED
			test = LT
			value = 2500
			situationMask = 8
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = LT
			value = 200
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = GT
			value = 100
			prestige = Trivial
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = LT
			value = 100
			prestige = Significant
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = GT
			value = 50
			prestige = Significant
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = LT
			value = 50
			prestige = Exceptional
		}
		CONSTRAINT
		{
			type = SPEEDENV
			test = GT
			value = 20
			prestige = Exceptional
		}
	}
	MODULE
	{
		name = ModuleSurfaceFX
		thrustProviderModuleIndex = 0
		fxMax = 0.8
		maxDistance = 50
		falloff = 2
		thrustTransformName = thrustTransform
	}
}

 

Link to comment
Share on other sites

powerEffectName = running
  1. shouldn't this be runningEffectName?
  2. each needs to be named differently so 'runningHe3' and 'runningTritrium' unless you want both to be the same - and I don't know if that will work.

 

here is a working example from OrbitalTug (just updated it)

Spoiler

PART:NEEDS[!Interstellar]
{
	// --- general parameters ---
	name = engineOnArm
	module = Part
	author = nli2work

	// --- asset parameters ---
	MODEL
	{
		model = OrbitalTug/engine/extendEngine
		texture = extendNuke_DIF, OrbitalTug/engine/extendNuke_DIF
		texture = extendNuke_EMI, OrbitalTug/engine/extendNuke_EMI
		texture = grapplerArms_DIF, OrbitalTug/core/grapplerArms_DIF
		texture = grapplerMain_DIF, OrbitalTug/core/grapplerMain_DIF
	}
	rescaleFactor = 1

	// --- node definitions ---
	node_attach = 0.0, 0.0, 0.340, 0.0, 0.0, -1, 1

	// --- editor parameters ---
	TechRequired = nuclearPropulsion
	entryCost = 42000
	cost = 8500
	category = Engine
	subcategory = 0
	title = Orbital Tug Extendable Nuclear Engine
	manufacturer = Ark Propulsions 
	description = A small nuclear thermal rocket engine; mounted on extendable arm for that extra clearance around whatever you're towing/pushing. Reversible thrust provides extra utility. 

	// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
	attachRules = 1,1,1,1,0
	
	// --- standard part parameters ---
	mass = 2.0
	dragModelType = default
	maximum_drag = 0.2
	minimum_drag = 0.2
	angularDrag = 2
	crashTolerance = 12
	breakingForce = 200 // from spark
	breakingTorque = 200 // from spark

	maxTemp = 2500
	thermalMassModifier = 1.0
	heatConductivity = 0.06
	emissiveConstant = 0.85 // engine nozzles are good at radiating, NTRs even better
	skinInternalConductionMult = 4.0
	radiatorMax = 0.35 //Default = 0.25 but nuke engines are meant to run hot

	fuelCrossFeed = True

	stagingIcon = LIQUID_ENGINE
	explosionPotential = 0.5

	bulkheadProfiles = size0, srf

	tags = active atom efficient engine inter liquid nuclear nuke orbit propuls radio reactor vacuum cck-tug arm extend

	EFFECTS
	{
		runningLF
		{
			AUDIO
			{
				channel = Ship
				clip = sound_rocket_spurts
				volume = 0.0 0.0
				volume = 1.0 1.0
				pitch = 0.0 0.2
				pitch = 1.0 1.0
				loop = true
			}
			MODEL_MULTI_PARTICLE
			{
				name = LFO
				modelName = OrbitalTug/FX/orbitalNukeLFO
				transformName = thrustTransform
				emission = 0.0 0.0
				emission = 0.05 0.0
				emission = 0.075 0.25
				emission = 1.0 1.25
				speed = 0.0 0.5
				speed = 1.0 1.2
			}
			MODEL_MULTI_PARTICLE
			{
				name = LFOCore
				modelName = OrbitalTug/FX/orbitalNukeCore
				transformName = thrustTransform
				emission = 0.0 0.0
				emission = 0.05 0.0
				emission = 0.075 0.25
				emission = 1.0 1.25
				speed = 0.0 0.5
				speed = 1.0 1.2
			}
		}
		runningMONO
		{
			AUDIO
			{
				channel = Ship
				clip = sound_rocket_mini
				volume = 0.0 0.0
				volume = 1.0 1.0
				pitch = 0.0 0.2
				pitch = 1.0 1.0
				loop = true
			}
			MODEL_MULTI_PARTICLE
			{
				name = Mono
				modelName = OrbitalTug/FX/orbitalNukeMono
				transformName = thrustTransform
				emission = 0.0 0.0
				emission = 0.05 0.0
				emission = 0.075 0.25
				emission = 1.0 1.25
				speed = 0.0 0.5
				speed = 1.0 1.2
			}
			MODEL_MULTI_PARTICLE
			{
				name = MonoCore
				modelName = OrbitalTug/FX/orbitalNukeCore
				transformName = thrustTransform
				emission = 0.0 0.0
				emission = 0.05 0.0
				emission = 0.075 0.25
				emission = 1.0 1.25
				speed = 0.0 0.5
				speed = 1.0 1.2
			}
		}
		engage
		{
			AUDIO
			{
				channel = Ship
				clip = sound_vent_medium
				volume = 1.0
				pitch = 2.0
				loop = false
			}
		}
		disengage
		{
			AUDIO
			{
				channel = Ship
				clip = sound_vent_soft
				loop = false
			}
		}
		flameout
		{
			PREFAB_PARTICLE
			{
			prefabName = fx_exhaustSparks_flameout_2
			transformName = thrustTransform
			oneShot = true
			}
			AUDIO
			{
			channel = Ship
			clip = sound_explosion_low
			volume = 1.0
			pitch = 2.0
			loop = false
			}
		}
	}

	MODULE
	{
		name = MultiModeEngine
		primaryEngineID = LF
		secondaryEngineID = MONO
	}
	
	MODULE
	{
		name = ModuleEnginesFX
		engineID = LF
		EngineType = Nuclear
		thrustVectorTransformName = thrustTransform
		runningEffectName = runningLF
		exhaustDamage = True
		ignitionThreshold = 0.1
		minThrust = 0
		maxThrust = 29 // 40
		heatProduction = 150 //250

		PROPELLANT
		{
			name = LiquidFuel
			ratio = 0.9
			DrawGauge = True
		}
		atmosphereCurve
		{
			key = 0 800 0 0
			key = 1 180 0 0
			key = 2 50
	 		key = 5 1
		}
	}

	MODULE
	{
		name = ModuleEnginesFX
		engineID = MONO
		EngineType = MonoProp
		thrustVectorTransformName = thrustTransform
		runningEffectName = runningMONO
		exhaustDamage = False
		ignitionThreshold = 0.1
		minThrust = 0
		maxThrust = 26
		heatProduction = 100 // 170

		PROPELLANT
		{
			name = MonoPropellant
			ratio = 0.9
			DrawGauge = True
		}
		atmosphereCurve
		{
			key = 0 750 0 0
			key = 1 150 0 0
			key = 2 50
	 		key = 5 1
		}
	}
	
	MODULE
	{
		name = ModuleAnimateHeat
		ThermalAnim = engineHeat 
	}

	MODULE
	{
		name = ModuleAlternator
		RESOURCE
		{
		name = ElectricCharge
			rate = 5.0
		}
	}

	//
	// These ModuleAnimateGeneric are replaced when AllYAll is installed
	// by AYA_ModuleAnimateGeneric.
	//
	MODULE
	{
		name = ModuleAnimateGeneric
		animationName = extendArm
		layer = 11
		startEventGUIName = Extend Engine Arm
		endEventGUIName = Retract Engine Arm
		actionGUIName = Toggle Engine Arm
		allowAnimationWhileShielded = False
		animSwitch = True
	}

	MODULE
	{
		name = ModuleAnimateGeneric
		animationName = rotateThrust
		layer = 13
		startEventGUIName = Set Reverse Thrust
		endEventGUIName = Set Normal Thrust
		actionGUIName = Toggle Thrust Direction
		animSpeed = 1000
		animSwitch = True
		allowAnimationWhileShielded = false
	}

	MODULE
	{
		name = ModuleGimbal
		gimbalTransformName = thrustTransform
		gimbalRange = 7.5
	}	

	MODULE
	{
		name = ModuleSurfaceFX
		thrustProviderModuleIndex = 1
		fxMax = 0.6
		maxDistance = 10
		falloff = 1.6
		thrustTransformName = thrustTransform
	}

	MODULE
	{
		name = ModuleSurfaceFX
		thrustProviderModuleIndex = 2
		fxMax = 0.5
		maxDistance = 5
		falloff = 2
		thrustTransformName = thrustTransform
	}

	RESOURCE
	{
		name = LiquidFuel
		amount = 50
		maxAmount = 50
	}

	DRAG_CUBE
	{
		cube = A, 1.099,0.7675,0.7452, 1.099,0.7681,0.7452, 0.3542,0.7092,2.176, 0.3542,0.6798,2.176, 1.188,0.7389,0.7549, 1.188,0.7087,0.6303, -2.98E-08,-0.1809,0.006315, 0.7408,2.074,0.6831
		cube = B, 1.099,2.7675,0.7952, 1.099,2.7681,0.7952, 0.5542,0.7092,2.176, 0.5542,0.6798,2.176, 1.888,0.7389,0.7949, 1.888,0.7087,0.7949, -2.98E-08,-0.1809,0.006315, 0.7408,2.074,0.6831
	}

}

 

 

Edited by zer0Kerbal
Link to comment
Share on other sites

@zer0Kerbal I changed powerEffectName with runningEffectName but the flame still not appear. I have added a flameout effect and when there is not fuel anymore the flameout effect work, but not in the right direction. After, i had looked at the OrbitalTug's code but i dont see big difference that can prevent the apparition of the flame.

Edited by Lgg159
Link to comment
Share on other sites

19 minutes ago, Lgg159 said:

@zer0Kerbal I changed powerEffectName with runningEffectName but the flame still not appear. I have added a flameout effect and when there is not fuel anymore the flameout effect work, but not in the right direction. After, i had looked at the OrbitalTug's code but i dont see big difference that can prevent the apparition of the flame.

sometimes it can be a simple thing like capitalization or a misplaced space - not much else I can say to help.

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