Adding Blueshift Support‐ Warp Engines - Angel-125/Blueshift GitHub Wiki

Blueshift comes with a variety of Restock-quality parts, but what if you want to add Blueshift support to other parts? Here's how to turn a part into a warp core capable of moving your craft faster than light:

  1. In the part's config file, add the following MODEL node:
	MODEL
	{
		model = WildBlueIndustries/Blueshift/Parts/Engine/genericWarpEngine
	}

This node adds an invisible model (actually just two transforms) to the new part to handle Waterfall warp effects.

  1. In the part's config file, add the following WBIWarpEngine node:
	// Warp engines provide faster than light travel but require resources to do so.
	MODULE
	{
		name = WBIWarpEngine
//		debugEnabled = true

		// Short description of the module as displayed in the editor.
		moduleDescription = Enables faster than light travel.

		EngineType = Generic
		exhaustDamage = False
		heatProduction = 0
		fxOffset = 0, 0, 0
		ignitionThreshold = 0.01
		minThrust = 0

		// Optional bow shock transform for the warp effects
		bowShockTransformName = bowShock

		// We need a non-significant value so that KSP won't flip out when the flight scene is loaded.
		maxThrust = 0.000001

		// Warp engines need a small amount of electric charge to operate.
		PROPELLANT
		{
			name = ElectricCharge
			resourceFlowMode = STAGE_STACK_FLOW_BALANCE
			ratio = 1.8
			DrawGauge = True
			minResToLeave = 1.0
		}

		// Minimum planetary radii needed to go to warp.
		minPlanetaryRadius = 1.0

		// When the powerMultiplier drops below this value, the engine will flame out.
		warpIgnitionThreshold = 0.25

		// In hours, the mean time between failures. Assumes that parts require maintenance.
		mtbf = 100

		// The minimum level of skill required to repair the part.
		// You can also change repairSkill, which defaults to "RepairSkill" (Engineers have this).
		// You can also change the repairKitName, which defaults to "evaRepairKit" (the stock EVA Repair Kit).
		minimumSkillLevel = 1

		// When parts require maintenance, how many repair kits are required to repair the part.
		repairKitsRequired = 1

		// While in orbit around a planet or moon, limit top speed by this multiplier so that we don't blow past the celestial body.
		// Think of this as a speed limit while in the harbor.
		// Out in interplanetary space, we can really open up the throttle.
		// The first number represents how close to the SOI edge the vessel is (1 = right at the edge, 0.1 = 10% of the distance to the SOI edge)
		// The second number is the top speed multiplier.
		planetarySOISpeedCurve
		{
			key = 1 0.1
			key = 0.5 0.05
			key = 0.25 0.01
			key = 0.1 0.005
		}

		// In addition to any specified PROPELLANT resources, warp engines require warpCapacity. Only parts with
		// a WBIWarpCoil part module can generate warpCapacity.
		// The warp curve controls how much warpCapacity is neeeded to go light speed or faster.
		// The first number represents the available warpCapacity, while the second number gives multiples of C.
		// You can apply any kind of warp curve you want, but the baseline uses the Fibonacci sequence * 10.
		// It may seem steep, but in KSP's small scale, 1C is plenty fast.
		// This curve is modified by the engine's displacementImpulse and current vessel mass.
		// effectiveWarpCapacity = warpCapacity * (displacementImpulse / vessel mass)
		warpCurve
		{
			key = 1 0
			key = 10 1
			key = 30 2
			key = 50 3
			key = 80 4
			key = 130 5
			key = 210 6
			key = 340 7
			key = 550 10
			key = 890 12
			key = 1440 16
			key = 2330 21
			key = 3770 27
			key = 6100 35
			key = 9870 45
			key = 15970 58
			key = 28540 76
		}

		// Name of the waterfall effect controller
		waterfallEffectController = warpEffectController

		// Waterfall Warp Effects Curve. This is used to control the Waterfall warp field effects based on the vessel's current warp speed.
		// The first number represents multiples of C, and the second number represents the level at which to drive the warp effects.
		// The effects value ranges from 0 to 1, while there's no upper limit to multiples of C, so keep that in mind.
		waterfallWarpEffectsCurve
		{
			key = 0 0
			key = 0.001 0.1
			key = 0.01 0.25
			key = 0.1 0.25
			key = 0.5 0.375
			key = 1.0 0.5
			key = 1.5 1
		}

		// ISP is important even for a warp engine since it affects propellant consumption. But we're unconcerned about atmosphere.
		atmosphereCurve
		{
			key = 0 100
			key = 1 100
		}

		// Engines can drive WBIModuleGeneratorFX that produce resources needed for warp travel.
		warpPowerGeneratorID = warpPower

		// Effects
		flameoutEffectName = flameout
		powerEffectName = power
		engageEffectName = engage
		disengageEffectName = disengage
		runningEffectName = running
		
		// An optional effect to play when the ship exceeds light speed.
		photonicBoomEffectName = photonicBoom

		// Also used as warp effects spool time.
		engineSpoolTime = 0.05
	}
  1. In the part's config file, add the following Waterfall part module node:
	MODULE:NEEDS[Waterfall]
	{
		name = ModuleWaterfallFX
		engineID = warpEngine
		CONTROLLER
		{
			name = warpEffectController
			linkedTo = custom
		}
		TEMPLATE
		{
			// This is the name of the template to use
			templateName = ftlWarpField
			position = 0,0,0
			rotation = 0, 0, 0
			scale = 1, 1, 1
		}
		TEMPLATE
		{
			templateName = ftlWarpBowShock
			position = 0,0,0
			rotation = 0, 0, 0
			scale = 1, 1, 1
		}
	}
  1. In the part's config file, add the following RESOURCE nodes:
	RESOURCE
	{
		name = Graviolium
		amount = 0
		maxAmount = 32
	}

	RESOURCE
	{
		name = GravityWaves
		amount = 0
		maxAmount = 500
	}
	RESOURCE:NEEDS[WildBlueIndustries/FlyingSaucers]
	{
		name = StaticCharge
		amount = 0
		maxAmount = 300
	}
  1. In the part's config file, add the following EFFECTS node:
	EFFECTS
	{	
		running
		{
			AUDIO
			{
				channel = Ship
				clip = WildBlueIndustries/Blueshift/FX/WarpDriveRunning
				volume = 0.0 0.0
				volume = 1.0 2.5
				loop = true
			}
		}
		power
		{
			AUDIO
			{
				channel = Ship
				clip = WildBlueIndustries/Blueshift/FX/WarpDrive
				volume = 0.0 0.0
				volume = 0.05 0.1
				volume = 0.1 0.25
				volume = 1.0 0.6
				pitch = 0.0 1.0
				pitch = 1.0 1.95
				loop = true
			}
		}
		engage
		{
			AUDIO
			{
				channel = Ship
				clip = sound_vent_medium
				volume = 1.0
				pitch = 2.0
				loop = false
			}
		}
		disengage
		{
			AUDIO
			{
				channel = Ship
				clip = sound_vent_soft
				volume = 1.0
				pitch = 2.0
				loop = false
			}
		}
		flameout
		{
			AUDIO
			{
				channel = Ship
				clip = sound_explosion_low
				volume = 1.0
				pitch = 2.0
				loop = false
			}
		}
		photonicBoom
		{
			AUDIO
			{
				channel = Ship
				clip = WildBlueIndustries/Blueshift/FX/PhotonicBoom
				volume = 2.0
				pitch = 1.0
				loop = false
			}
		}	
	}