ColKlonk2

Members
  • Content Count

    81
  • Joined

  • Last visited

Community Reputation

17 Good

About ColKlonk2

  • Rank
    Rocketry Enthusiast

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. [LOG 20:08:48.032] Loading data opt-out preferences from PlayerPrefs [LOG 20:08:48.083] Requesting data opt-out preferences from https://data-optout-service.uca.cloud.unity3d.com/player/opt_out?appid='blanked out'&userid='blanked out'&deviceid='blanked out' And why are we doing this ??
  2. Only reference (so far) to SpaceX parts I could find is the Merlin1_Config.cfg from RO Version 11.0.5.1 https://github.com/KSP-RO/RealismOverhaul/releases/download/v11.5.1/RealismOverhaul-v11.5.1.zip // ================================================== // Merlin 1 series global engine configuration (all versions). // Gross Mass: 760 Kg (baseline Merlin 1 variant) // Throttle Range: 39% to 100% (throttleable variants) // O/F Ratio: ~2.17 (differs between versions) // Burn Time: ~170 s (ASL variants), ~400 s (VAC variants) // Sources: // [1] http://spaceflight101.com/spacerockets/falcon-9-v1-1-f9r/ // [2] http://www.spacex.com/falcon9 (2015-09-21) // [3] http://www.spacex.com/falcon9 (2016-05-14) // [4] https://www.quora.com/Is-SpaceXs-Merlin-1Ds-thrust-to-weight-ratio-of-150+-believable // [5] https://twitter.com/elonmusk/status/728753234811060224 (min thrust of Merlin1D+ is ~40%) // [6] http://www.spacex.com/press/2012/12/19/spacex-falcon-9-upper-stage-engine-successfully-completes-full-mission-duration // [7] http://www.spacex.com/press/2012/12/19/spacex-completes-development-merlin-regeneratively-cooled-rocket-engine // Used by: // * LazTek // * RealFuels // * StarShine Industries // * SSTU // Notes: // * None of the Merlin 1 engines ever really failed, with the // exception of the SpX-1/CRS-1 flight anomaly. The TF configs // should not be considered complete by any means. // ================================================== @PART[*]:HAS[#engineType[Merlin1]]:FOR[RealismOverhaulEngines] { %category = Engine %title = Merlin 1 Series %manufacturer = SpaceX %description = The whole family of Merlin 1 rocket engines, made by SpaceX. Diameter: 1.75 m. @MODULE[ModuleEngines*] { @minThrust = 369.2 @maxThrust = 369.2 %heatProduction = 58 @useEngineResponseTime = False !engineAccelerationSpeed = NULL @allowShutdown = True %EngineType = LiquidFuel @useThrustCurve = False %ullage = True %pressureFed = False %ignitions = 1 !IGNITOR_RESOURCE,*{} !thrustCurve,*{} } !MODULE[ModuleEngineConfigs],*{} MODULE { name = ModuleEngineConfigs type = ModuleEngines configuration = Merlin1A origMass = 0.76 CONFIG { name = Merlin1A minThrust = 369.2 maxThrust = 369.2 heatProduction = 58 massMult = 1.0 PROPELLANT { name = Kerosene ratio = 0.3907 DrawGauge = True } PROPELLANT { name = LqdOxygen ratio = 0.6093 DrawGauge = False } atmosphereCurve { key = 0 288.5 key = 1 253.7 } ullage = True pressureFed = False ignitions = 1 IGNITOR_RESOURCE { name = ElectricCharge amount = 0.5 } IGNITOR_RESOURCE { name = TEATEB amount = 4.0 } } CONFIG { name = Merlin1B minThrust = 394 maxThrust = 394 heatProduction = 64 massMult = 1.0 // From Wikipedia: turbopump weight was unchanged at 150 lbs. PROPELLANT { name = Kerosene ratio = 0.3907 DrawGauge = True } PROPELLANT { name = LqdOxygen ratio = 0.6093 DrawGauge = False } atmosphereCurve { key = 0 302.3 key = 1 260.8 } ullage = True pressureFed = False ignitions = 1 IGNITOR_RESOURCE { name = ElectricCharge amount = 0.5 } IGNITOR_RESOURCE { name = TEATEB amount = 4.0 } } CONFIG { name = Merlin1BVac minThrust = 421.6 maxThrust = 421.6 heatProduction = 63 massMult = 1.2 // No good source but it should be heavier than the SL version. PROPELLANT { name = Kerosene ratio = 0.3907 DrawGauge = True } PROPELLANT { name = LqdOxygen ratio = 0.6093 DrawGauge = False } atmosphereCurve { key = 0 332.1 key = 1 195.5 } ullage = True pressureFed = False ignitions = 1 IGNITOR_RESOURCE { name = ElectricCharge amount = 0.5 } IGNITOR_RESOURCE { name = TEATEB amount = 4.0 } } CONFIG { name = Merlin1C minThrust = 482.63 maxThrust = 482.63 heatProduction = 96 massMult = 0.829 PROPELLANT { name = Kerosene ratio = 0.3907 DrawGauge = True } PROPELLANT { name = LqdOxygen ratio = 0.6093 DrawGauge = False } atmosphereCurve { key = 0 304.8 key = 1 267 } ullage = True pressureFed = False ignitions = 1 IGNITOR_RESOURCE { name = ElectricCharge amount = 0.5 } IGNITOR_RESOURCE { name = TEATEB amount = 4.0 } cost = 0 entryCost = 15000 techRequired = experimentalRocketry maxSubtraction = 12000 entryCostSubtractors { Merlin1CVac = 12000 } } CONFIG { name = Merlin1CVac minThrust = 246.9 maxThrust = 411.5 // [6] heatProduction = 76 massMult = 1.0 PROPELLANT { name = Kerosene ratio = 0.3907 DrawGauge = True } PROPELLANT { name = LqdOxygen ratio = 0.6093 DrawGauge = False } atmosphereCurve { key = 0 342 // [6] key = 1 173 } ullage = True pressureFed = False ignitions = 4 IGNITOR_RESOURCE { name = ElectricCharge amount = 0.500 } IGNITOR_RESOURCE { name = TEATEB amount = 1.0 } cost = 0 entryCost = 18000 techRequired = experimentalRocketry maxSubtraction = 12000 entryCostSubtractors { Merlin1C = 12000 } } CONFIG { name = Merlin1D minThrust = 290 maxThrust = 722 heatProduction = 196 massMult = 0.6184 PROPELLANT { name = Kerosene ratio = 0.3729 DrawGauge = True } PROPELLANT { name = LqdOxygen ratio = 0.6271 DrawGauge = False } atmosphereCurve { key = 0 311 key = 1 282 } ullage = True pressureFed = False ignitions = 4 IGNITOR_RESOURCE { name = ElectricCharge amount = 0.5 } IGNITOR_RESOURCE { name = TEATEB amount = 1.0 } cost = 0 entryCost = 20000 techRequired = giganticRocketry maxSubtraction = 12000 entryCostSubtractors { Merlin1C = 12000 Merlin1CVac = 12000 } } CONFIG { name = Merlin1D+ minThrust = 330 maxThrust = 825 //[2] heatProduction = 225 massMult = 0.6184 PROPELLANT { name = Kerosene ratio = 0.3729 DrawGauge = True } PROPELLANT { name = LqdOxygen ratio = 0.6271 DrawGauge = False } atmosphereCurve { key = 0 311 // FIXME: M1D+ Isp is not same as M1D, exact spec difficult to pin down. key = 1 282 } ullage = True pressureFed = False ignitions = 4 IGNITOR_RESOURCE { name = ElectricCharge amount = 0.5 } IGNITOR_RESOURCE { name = TEATEB amount = 1.0 } cost = 0 entryCost = 28000 techRequired = giganticRocketry maxSubtraction = 18000 entryCostSubtractors { Merlin1D = 18000 Merlin1DVac = 18000 } } CONFIG { name = Merlin1D++ // Uprated again, slated to fly in mid/late 2016. minThrust = 330 // [5] maxThrust = 914.12 // [3] heatProduction = 248 massMult = 0.6184 PROPELLANT { name = Kerosene ratio = 0.3729 DrawGauge = True } PROPELLANT { name = LqdOxygen ratio = 0.6271 DrawGauge = False } atmosphereCurve { key = 0 311 // FIXME: M1D+ Isp is not same as M1D, exact spec difficult to pin down. key = 1 288.5 } ullage = True pressureFed = False ignitions = 4 IGNITOR_RESOURCE { name = ElectricCharge amount = 0.5 } IGNITOR_RESOURCE { name = TEATEB amount = 1.0 } cost = 0 entryCost = 20000 // Just a small uprating, so low entry cost with subtractors. techRequired = giganticRocketry maxSubtraction = 18000 entryCostSubtractors { Merlin1D+ = 18000 Merlin1DVac+ = 18000 } } CONFIG { name = Merlin1DVac minThrust = 360 maxThrust = 805 heatProduction = 233 massMult = 0.6447 PROPELLANT { name = Kerosene ratio = 0.3709 DrawGauge = True } PROPELLANT { name = LqdOxygen ratio = 0.6291 } atmosphereCurve { key = 0 345 key = 1 200 } ullage = True pressureFed = False ignitions = 4 IGNITOR_RESOURCE { name = ElectricCharge amount = 0.5 } IGNITOR_RESOURCE { name = TEATEB amount = 1.0 } entryCost = 23000 techRequired = giganticRocketry maxSubtraction = 15000 entryCostSubtractors { Merlin1C = 12000 Merlin1CVac = 15000 } } CONFIG { name = Merlin1DVac+ minThrust = 360 maxThrust = 934.12 // [2] heatProduction = 225 massMult = 0.6447 PROPELLANT { name = Kerosene ratio = 0.3709 DrawGauge = True } PROPELLANT { name = LqdOxygen ratio = 0.6291 DrawGauge = False } atmosphereCurve { key = 0 348 key = 1 200 } ullage = True pressureFed = False ignitions = 4 IGNITOR_RESOURCE { name = ElectricCharge amount = 0.5 } IGNITOR_RESOURCE { name = TEATEB amount = 1.0 } cost = 0 entryCost = 30000 techRequired = giganticRocketry maxSubtraction = 20000 entryCostSubtractors { Merlin1DVac = 20000 } } } @MODULE[ModuleGimbal],* { @gimbalRange = 5.0 //FIXME: Any real numbers for gimbal? %useGimbalResponseSpeed = True %gimbalResponseSpeed = 16 } !MODULE[ModuleAlternator],*{} !RESOURCE,*{} RESOURCE { name = TEATEB amount = 4.0 maxAmount = 4.0 isTweakable = False } } // ================================================== // TestFlight compatibility. // ================================================== @PART[*]:HAS[@MODULE[ModuleEngineConfigs]:HAS[@CONFIG[Merlin1A]],!MODULE[TestFlightInterop]]:BEFORE[zTestFlight] { TESTFLIGHT { name = Merlin1A ratedBurnTime = 170 ignitionReliabilityStart = 0.98 ignitionReliabilityEnd = 0.995 cycleReliabilityStart = 0.98 cycleReliabilityEnd = 0.995 } } @PART[*]:HAS[@MODULE[ModuleEngineConfigs]:HAS[@CONFIG[Merlin1B]],!MODULE[TestFlightInterop]]:BEFORE[zTestFlight] { TESTFLIGHT { name = Merlin1B ratedBurnTime = 170 ignitionReliabilityStart = 0.98 ignitionReliabilityEnd = 0.995 cycleReliabilityStart = 0.98 cycleReliabilityEnd = 0.995 techTransfer = Merlin1A:50 } } @PART[*]:HAS[@MODULE[ModuleEngineConfigs]:HAS[@CONFIG[Merlin1BVac]],!MODULE[TestFlightInterop]]:BEFORE[zTestFlight] { TESTFLIGHT { name = Merlin1BVac ratedBurnTime = 345 ignitionReliabilityStart = 0.98 ignitionReliabilityEnd = 0.995 cycleReliabilityStart = 0.98 cycleReliabilityEnd = 0.995 techTransfer = Merlin1A,Merlin1B:50 } } @PART[*]:HAS[@MODULE[ModuleEngineConfigs]:HAS[@CONFIG[Merlin1C]],!MODULE[TestFlightInterop]]:BEFORE[zTestFlight] { TESTFLIGHT { name = Merlin1C ratedBurnTime = 170 ignitionReliabilityStart = 0.98 ignitionReliabilityEnd = 0.995 cycleReliabilityStart = 0.98 cycleReliabilityEnd = 0.995 techTransfer = Merlin1A,Merlin1B,Merlin1BVac:50 } } @PART[*]:HAS[@MODULE[ModuleEngineConfigs]:HAS[@CONFIG[Merlin1CVac]],!MODULE[TestFlightInterop]]:BEFORE[zTestFlight] { TESTFLIGHT { name = Merlin1CVac ratedBurnTime = 345 ignitionReliabilityStart = 0.98 ignitionReliabilityEnd = 0.995 cycleReliabilityStart = 0.98 cycleReliabilityEnd = 0.995 techTransfer = Merlin1A,Merlin1B,Merlin1BVac,Merlin1C:50 } } @PART[*]:HAS[@MODULE[ModuleEngineConfigs]:HAS[@CONFIG[Merlin1D]],!MODULE[TestFlightInterop]]:BEFORE[zTestFlight] { TESTFLIGHT { name = Merlin1D ratedBurnTime = 180 ignitionReliabilityStart = 0.98 ignitionReliabilityEnd = 0.995 cycleReliabilityStart = 0.98 cycleReliabilityEnd = 0.995 techTransfer = Merlin1A,Merlin1B,Merlin1BVac,Merlin1C,Merlin1CVac:50 } } @PART[*]:HAS[@MODULE[ModuleEngineConfigs]:HAS[@CONFIG[Merlin1D+]],!MODULE[TestFlightInterop]]:BEFORE[zTestFlight] { TESTFLIGHT { name = Merlin1D+ ratedBurnTime = 162 ignitionReliabilityStart = 0.98 ignitionReliabilityEnd = 0.995 cycleReliabilityStart = 0.98 cycleReliabilityEnd = 0.995 techTransfer = Merlin1A,Merlin1B,Merlin1BVac,Merlin1C,Merlin1CVac,Merlin1D:50 } } @PART[*]:HAS[@MODULE[ModuleEngineConfigs]:HAS[@CONFIG[Merlin1D++]],!MODULE[TestFlightInterop]]:BEFORE[zTestFlight] { TESTFLIGHT { name = Merlin1D++ ratedBurnTime = 162 ignitionReliabilityStart = 0.98 ignitionReliabilityEnd = 0.995 cycleReliabilityStart = 0.98 cycleReliabilityEnd = 0.995 techTransfer = Merlin1A,Merlin1B,Merlin1BVac,Merlin1C,Merlin1CVac,Merlin1D,Merlin1D+:50 } } @PART[*]:HAS[@MODULE[ModuleEngineConfigs]:HAS[@CONFIG[Merlin1DVac]],!MODULE[TestFlightInterop]]:BEFORE[zTestFlight] { TESTFLIGHT { name = Merlin1DVac ratedBurnTime = 375 ignitionReliabilityStart = 0.98 ignitionReliabilityEnd = 0.995 cycleReliabilityStart = 0.98 cycleReliabilityEnd = 0.995 techTransfer = Merlin1A,Merlin1B,Merlin1BVac,Merlin1C,Merlin1CVac,Merlin1D,Merlin1D+,Merlin1D++:50 } } @PART[*]:HAS[@MODULE[ModuleEngineConfigs]:HAS[@CONFIG[Merlin1DVac+]],!MODULE[TestFlightInterop]]:BEFORE[zTestFlight] { TESTFLIGHT { name = Merlin1DVac+ ratedBurnTime = 400 ignitionReliabilityStart = 0.98 ignitionReliabilityEnd = 0.995 cycleReliabilityStart = 0.98 cycleReliabilityEnd = 0.995 techTransfer = Merlin1A,Merlin1B,Merlin1BVac,Merlin1C,Merlin1CVac,Merlin1D,Merlin1D+,Merlin1D++,Merlin1DVac:50 } }
  3. Mr Mading:- Any chance of a Cubed Root function (or n'th root). I'll try an exponent X^(1/3), but not sure on how the speed compares between the two.
  4. I know, just speculating the use of 'runmode = 4' which is outside 'Physics' mode parameters, offering options of ellimination. OP was providing minimal info.
  5. What is runmode linked to.. or where is runmode applied. You might have not set time acceleration correctly ? Set kuniverse:timewarp:mode to "PHYSICS". Set kuniverse:timewarp:warp to 3. If you don't set 'Physics' mode, AFAIK you have no control.
  6. It's a well know problem, that's got to do with KSP itself. You have to use the Stage command to keep on steering
  7. Here's an improved version. Pushing first stage of My_ISS to 400Km, polar orbit. LAN and Inclination within 0.02 ish. Uses holman transfers for burntime calcs. Kos400 (approx 9 Minutes at 4x speed) I only attend to the code every so often, so have no interest in cleaning it up at the moment. got to much else to do // For K3 Rocket - The first stage of My_ISS //=========================================== @lazyglobal off. //****************************************************************************** // SHIP PARTS //****************************************************************************** //*** STAGE 1+2 *** DECLARE GLOBAL ThisShip is "". DECLARE GLOBAL Stg1Thrust is "". DECLARE GLOBAL Stg2Thrust is "". DECLARE GLOBAL Stg2Wheel is "". //*** LARGE DOCKING PORTS *** DECLARE GLOBAL K3CBM_Top is "". DECLARE GLOBAL K3CBM_1200 is "". DECLARE GLOBAL K3CBM_0300 is "". DECLARE GLOBAL K3CBM_0600 is "". DECLARE GLOBAL K3CBM_0900 is "". DECLARE GLOBAL K3BPort is "". //*** NAVIGATION LIGHTS *** DECLARE GLOBAL K3NavF_Red is "". DECLARE GLOBAL K3NavM_Red is "". DECLARE GLOBAL K3NavA_Red is "". DECLARE GLOBAL K3NavF_Grn is "". DECLARE GLOBAL K3NavM_Grn is "". DECLARE GLOBAL K3NavA_Grn is "". DECLARE GLOBAL K3NavF_Wht is "". DECLARE GLOBAL K3NavM_Wht is "". DECLARE GLOBAL K3NavA_Wht is "". //*** BLUE LIGHTS *** DECLARE GLOBAL K3BluF_1030 is "". DECLARE GLOBAL K3BluF_0130 is "". DECLARE GLOBAL K3BluF_0430 is "". DECLARE GLOBAL K3BluF_0730 is "". DECLARE GLOBAL K3BluM_1030 is "". DECLARE GLOBAL K3BluM_0130 is "". DECLARE GLOBAL K3BluM_0430 is "". DECLARE GLOBAL K3BluM_0730 is "". DECLARE GLOBAL K3BluA_1030 is "". DECLARE GLOBAL K3BluA_0130 is "". DECLARE GLOBAL K3BluA_0430 is "". DECLARE GLOBAL K3BluA_0730 is "". //*** STAGE-3 ENGINES *** DECLARE GLOBAL K3Eng_A1 is "". DECLARE GLOBAL K3Eng_A2 is "". DECLARE GLOBAL K3Eng_B1 is "". DECLARE GLOBAL K3Eng_B2 is "". DECLARE GLOBAL K3Eng_C1 is "". DECLARE GLOBAL K3Eng_C2 is "". DECLARE GLOBAL K3Eng_D1 is "". DECLARE GLOBAL K3Eng_D2 is "". DECLARE GLOBAL K3Eng_E1 is "". DECLARE GLOBAL K3Eng_E2 is "". DECLARE GLOBAL K3Eng_F1 is "". DECLARE GLOBAL K3Eng_F2 is "". DECLARE GLOBAL K3Eng_A is "". DECLARE GLOBAL K3Eng_B is "". DECLARE GLOBAL K3Eng_C is "". DECLARE GLOBAL K3Eng_D is "". DECLARE GLOBAL K3Eng_E is "". DECLARE GLOBAL K3Eng_F is "". //*** OXYGEN TANK (UP TOP) *** DECLARE GLOBAL K3TankO2_01 is "". //*** CENTRAL HUB FOR THIS UNIT *** //K3_HUB_01 DECLARE GLOBAL K3HUB_01 is "". //*** PROBE UNIT REQUIRED FOR PROBE-CONTROL-ROOM *** DECLARE GLOBAL K3RGU_01 is "". //*** KOS PROCESSOR UNITS *** DECLARE GLOBAL K3KAL9K_1200 is "". DECLARE GLOBAL K3KAL9K_0300 is "". DECLARE GLOBAL K3KAL9K_0600 is "". DECLARE GLOBAL K3KAL9K_0900 is "". //*** G-SENSORS *** DECLARE GLOBAL K3GSens_1200 is "". DECLARE GLOBAL K3GSens_0300 is "". DECLARE GLOBAL K3GSens_0600 is "". DECLARE GLOBAL K3GSens_0900 is "". //*** WHIP AERIALS *** DECLARE GLOBAL K3COM32_1030 is "". DECLARE GLOBAL K3COM32_0130 is "". DECLARE GLOBAL K3COM32_0430 is "". DECLARE GLOBAL K3COM32_0730 is "". //*** LITHIUM PEROXIDE TANK *** DECLARE GLOBAL K3LitParox_01 is "". //*** WATER TANK *** DECLARE GLOBAL K3WaterTank_01 is "". //*** FOOD TANK *** DECLARE GLOBAL K3FoodTank_01 is "". //*** MMH NTO TANK *** DECLARE GLOBAL K3MMHNTO_01 is "". //*** BATTERY - 1 *** DECLARE GLOBAL K3BATT_01 is "". //*** HABITAT WHEEL *** DECLARE GLOBAL K3WHEEL_01 is "". DECLARE GLOBAL K3WHEEL_01 is "". //*** LITHIUM PREOXIDE SCRUBBER *** DECLARE GLOBAL K3Scrubber_01 is "". //*** WATER SPLITTER *** DECLARE GLOBAL K3Splitter_01 is "". //*** WATER PURIFIER *** DECLARE GLOBAL K3Purifier_01 is "". //*** RADIATOR PANELS *** DECLARE GLOBAL K3RadM_0130D is "". DECLARE GLOBAL K3RadM_0130A is "". DECLARE GLOBAL K3RadM_0430D is "". DECLARE GLOBAL K3RadM_0430A is "". DECLARE GLOBAL K3RadM_0730D is "". DECLARE GLOBAL K3RadM_0730A is "". DECLARE GLOBAL K3RadM_1030D is "". DECLARE GLOBAL K3RadM_1030A is "". //*** SOLAR PANELS *** DECLARE GLOBAL K3XT4_0130 is "". DECLARE GLOBAL K3XT4_0430 is "". DECLARE GLOBAL K3XT4_0730 is "". DECLARE GLOBAL K3XT4_1030 is "". DECLARE GLOBAL K3NIV18_1200 is "". DECLARE GLOBAL K3NIV18_0300 is "". DECLARE GLOBAL K3NIV18_0600 is "". DECLARE GLOBAL K3NIV18_0900 is "". //*** HABITAT MODULE *** DECLARE GLOBAL K3HabM_DOCK is "". DECLARE GLOBAL K3HabM_DOCKL is "". //****************************************************************************** // OTHER BITS //****************************************************************************** DECLARE GLOBAL Lunars is "". //****************************************************************************** // TARGET PARAMETERS //****************************************************************************** GLOBAL TargName is "NONE". GLOBAL TargInclination IS 90. GLOBAL TargApoapsisHgt IS 415000. GLOBAL TargPeriapsisHgt IS 405000. GLOBAL TargLan IS 210. GLOBAL TargLanLong IS 0. GLOBAL TargLatitude IS 0. GLOBAL TargLongitude IS 0. GLOBAL TargAltitude IS 415000. GLOBAL TargStationHgt IS 415000. GLOBAL TargMaxHeight IS 0. GLOBAL TargMinHeight IS 900000. GLOBAL ParkingOrbit IS 200000. GLOBAL TargPos_V IS V(0.0,0.0,0.0). //SHIP:POSITION GLOBAL TargBPos_V IS V(0.0,0.0,0.0). GLOBAL TargApoapsis_V IS V(0.0,0.0,0.0). GLOBAL TargPeriapsis_V IS V(0.0,0.0,0.0). GLOBAL LastDistance IS 0.0. GLOBAL T_ApoapsisAngle IS 0.0. GLOBAL T_PeriapsisAngle IS 0.0. GLOBAL D1_Angle IS 0.0. GLOBAL D2_Angle IS 0.0. GLOBAL D_Wangle IS 0.0. GLOBAL M_Wangle IS 0.0. GLOBAL DistanceFlag IS 0. //****************************************************************************** // SHIP PARAMETERS //****************************************************************************** GLOBAL ShipAltitude IS 0.0. GLOBAL ShipPitch IS 0.0. GLOBAL ShipExitPitch is 10.0. GLOBAL ShipPitchRange is 90. GLOBAL ShipPosV IS V(0.0,0.0,0.0). GLOBAL ShipPos_V IS V(0.0,0.0,0.0). GLOBAL ShipBPos_V IS V(0.0,0.0,0.0). GLOBAL ShipVelocity_V IS V(0.0,0.0,0.0). GLOBAL ShipFore_V IS V(0.0,0.0,0.0). GLOBAL ShipTop_V IS V(0.0,0.0,0.0). GLOBAL ShipStar_V IS V(0.0,0.0,0.0). GLOBAL ShipPos_DV IS V(0.0,0.0,0.0). GLOBAL ShipDirection is 0.0. GLOBAL ShipLaunchHead is 0.0. GLOBAL ShipInclination IS 0.0. GLOBAL ShipLan IS 0.0. GLOBAL ShipLanLong IS 0.0. GLOBAL ShipLaunchLong is 0.0. GLOBAL ShipLatitude IS 0. GLOBAL ShipLongitude IS 0. GLOBAL ShipPeriapisHgt IS 0.0. GLOBAL ShipApoapsisHgt IS 0.0. GLOBAL ShipOrbitalPeriod IS 0.0. GLOBAL ShipEtaApoapsis IS 0.0. GLOBAL ShipEtaApoapsisLast IS 0.0. GLOBAL ShipEtaPeriapsis IS 0.0. GLOBAL ShipEtaPeriapsisLast IS 0.0. GLOBAL ShipDApoapsis IS 0.0. GLOBAL ShipDPeriapsis IS 0.0. GLOBAL i_RollHeight is 300. GLOBAL f_StageFuel is 100.0. GLOBAL i_PitchAtAlt is 85000. GLOBAL i_PitchStartAlt is 500. GLOBAL DDINC is 0.0. GLOBAL ThisStage is 0. GLOBAL ShipBurnTime is 0.0. GLOBAL ShipApoVelocity is 0.0. //*** HABITAT ENGINE SPECS ************* GLOBAL HabEngine_ISP is 320.824. // Vacuum ISP GLOBAL HabEngine_NEWTONS is 1780. // Newtons Thrust GLOBAL HabEngine_MMH is 0.2137. // Consumption rate - kg persec GLOBAL HabEngine_NTO is 0.3521. // Consumption rate - kg persec //*** HABITAT RCS SPECS **************** GLOBAL HabRCS_Aerozine50 is 0.1669. // Consumption rate - kg?? persec GLOBAL HabRCS_NTO is 0.1669. // Consumption rate - kg?? persec //****************************************************************************** // EARTH PARAMETERS //****************************************************************************** GLOBAL EarthRotang IS 0.0. GLOBAL ShipLatitude IS 0.0. GLOBAL ShipLongitude IS 0.0. GLOBAL HgtAtmosphere IS 0. GLOBAL Hgt01 IS 0.0. GLOBAL Hgt02 IS 0.0. GLOBAL Hgt03 IS 0.0. GLOBAL TimetoLaunch IS 0. GLOBAL Count is 0. GLOBAL Tangle IS 0.0. GLOBAL DVreq is 0.0. GLOBAL Vreq is 0.0. //****************************************************************************** // //****************************************************************************** //*** GENERAL *** GLOBAL b_TMP IS FALSE. GLOBAL b_Targ IS FALSE. GLOBAL b_Roll IS FALSE. //*** LAUNCH *** GLOBAL b_LaunchAscNode IS FALSE. GLOBAL b_PitchUP IS FALSE. GLOBAL b_PitchDWN IS FALSE. //*** ORBIT *** GLOBAL b_HaveINC IS FALSE. GLOBAL b_HaveLAN IS FALSE. GLOBAL b_ShipApoAlt IS FALSE. GLOBAL b_ShipPeriAlt IS FALSE. GLOBAL b_ProGrade IS FALSE. GLOBAL b_TangleNDelay IS FALSE. GLOBAL b_TangleSDelay IS FALSE. GLOBAL b_RenTime IS TRUE. GLOBAL b_INC_Reduction IS FALSE. //****************************************************************************** // Start of Program //****************************************************************************** Set ThisShip to VESSEL("K_3"). Set ShipAltitude to ThisShip:ALTITUDE. //Set ShipPitch to ThisShip:PITCH. Set ShipPitch to 90. Set ShipPos_V to SHIP:POSITION. Set ShipBPos_V to SHIP:BODY:POSITION. Set ShipVelocity_V to ThisShip:VELOCITY:ORBIT. Set ShipFore_V to ThisShip:FACING:FOREVECTOR. Set ShipTop_V to ThisShip:FACING:TOPVECTOR. Set ShipStar_V to ThisShip:FACING:STARVECTOR. Set ShipInclination to ThisShip:ORBIT:INCLINATION. Set ShipLan to ThisShip:ORBIT:LAN. Set ShipPeriapisHgt to ThisShip:ORBIT:PERIAPSIS. Set ShipApoapsisHgt to ThisShip:ORBIT:APOAPSIS. Set ShipOrbitalPeriod to ThisShip:ORBIT:PERIOD. Set ShipEtaApoapsis to ETA:APOAPSIS. Set ShipEtaPeriapsis to ETA:PERIAPSIS. Set EarthRotang to ThisShip:ORBIT:BODY:ROTATIONANGLE. Set Lunars to ThisShip:BODY. Set ShipLatitude TO ThisShip:GEOPOSITION:LAT. Set ShipLongitude TO ThisShip:GEOPOSITION:LNG. Set Hgt01 to 0.0. Set Hgt02 to 0.0. Set Hgt03 to 0.0. //****************************************************************************** // //****************************************************************************** // GENERAL FLAG Set b_TMP to FALSE. // INCLINATION AND LAN - USED FOR ALIGNMENT Set b_HaveINC to FALSE. Set b_HaveLAN to FALSE. // APSIDE FLAGS - USED FOR ALTITUDES Set b_ShipApoAlt to FALSE. Set b_ShipPeriAlt to FALSE. // UP/DOWN FLAGS - USED FOR PITCH Set b_PitchUP to FALSE. Set b_PitchDWN to FALSE. // ORIENTATION LOCK FLAGS Set b_ProGrade to FALSE. Set b_TangleNDelay to FALSE. // Node Delay flags Set b_TangleSDelay to FALSE. // Set b_RenTime to TRUE. // TRUE = At next node Run IF ShipLongitude < 0 {Set ShipLongitude to ShipLongitude + 360.} // Adjust for [0,360] //****************************************************************************** //****************************************************************************** // SCREENS //****************************************************************************** //****************************************************************************** //------------------------------------------------------------------------------ // PRE-LAUNCH SCREEN //------------------------------------------------------------------------------ Function Screenie_0 { Print "---TARGET-------------------------------" AT(1,1). Print "Name : " + TargName AT (1,2). Print "Inclination : " + TargInclination AT (1,3). Print "LAN : " + TargLan AT (1,4). Print "Apoapsis : " + TargApoapsisHgt AT (1,5). Print "Periapsis : " + TargPeriapsisHgt AT (1,6). Print "Latitude : " + TargLatitude AT (1,7). Print "Longitude : " + TargLongitude AT (1,8). Print "Altitude : " + TargAltitude AT (1,9). Print "---SHIP---------------------------------" AT (1,11). Print "Name : " + ThisShip:SHIPNAME AT (1,12). Print "Inclination : " + ShipInclination AT (1,13). Print "LAN : " + ShipLan AT (1,14). Print "Apoapsis : " + ShipApoapsisHgt AT (1,15). Print "Periapsis : " + ShipPeriapisHgt AT (1,16). Print "Latitude : " + ShipLatitude AT (1,17). Print "Longitude : " + ShipLongitude AT (1,18). Print "Altitude : " + ShipAltitude AT (1,19). Print "---STATUS-------------------------------" AT (1,21). } //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ Function Screenie_01 { Print " WAITING FOR LAUNCH " AT (21,21). Print "Launch Time : " AT (1,23). Print "Main Engines : OFF " AT (1,24). Print "Base Clamps : SECURED " AT (1,25). Print "Tower Clamps : SECURED " AT (1,26). } //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ Function Screenie_02 { Print "COUNTDOWN COMMENCING" AT (21,21). } //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ Function Screenie_1 { Print " <== STAGE-1 ==> " AT (21,21). Print "Thrust Level : " AT (1,23). Print "Pitch : " AT (1,24). Print "Course : " AT (1,25). Print "Apoapsis Time : " AT (1,26). } //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ Function Screenie_2 { Print " <== STAGE-2 ==> " AT (21,21). } //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ Function Screenie_3A { Print " <== STAGE-3 ==> " AT (21,21). Print "Thrust Level : " AT (1,23). Print "DeltaV Required: " AT (1,24). Print "Start Time : " AT (1,25). Print "Apoapsis Time : " AT (1,26). } //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ Function Screenie_3B { Print "DeltaV Required: " AT (1,23). Print "Burn Time : " AT (1,24). Print "Time Left : " AT (1,25). Print " " AT (1,26). } //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ Function Screenie_4A { Print " <== STAGE-4A ==> " AT (21,21). Print "DeltaV Required: " AT (1,23). Print "Burn Time : " AT (1,24). Print "Time Left : " AT (1,25). Print " " AT (1,26). } //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ Function Screenie_4B { Print " <== STAGE-4B ==> " AT (21,21). Print "DeltaV Required: " AT (1,23). Print "Burn Time : " AT (1,24). Print "Time Left : " AT (1,25). Print " " AT (1,26). } //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ Function Screenie_3ADBG { Print " <== DEBUG ==> " AT (21,21). Print "mU : " AT (1,23). Print "Earth Radius : " AT (1,24). Print "ApoapsisHgt : " AT (1,25). Print "ApoVelReq : " AT (1,26). Print "Apoapsis Velo : " AT (1,27). Print "DeltaV Required: " AT (1,28). Print "Start Mass : " AT (1,29). Print "End Mass : " AT (1,30). Print "Avg Mass : " AT (1,31). Print "Avg Accel : " AT (1,32). Print "Burntime : " AT (1,33). } //****************************************************************************** // PROGRAM START - LAUNCH TO ORBIT //****************************************************************************** Set Terminal:WIDTH to 42. Set Terminal:HEIGHT to 30. ClearScreen. Screenie_0(). Stage_0(). Screenie_1(). Stage_1(). Screenie_2(). Stage_2(). Screenie_3A(). Stage_3(). IF b_Targ = FALSE { Stage_4(). } Cruise(). //****************************************************************************** // Stage_0 //****************************************************************************** FUNCTION Stage_0 { LOCAL Count is 0. Screenie_01(). RCS OFF. SAS OFF. MakeShipParts(). Set_Heights(). Set_ShipLaunchPosInfo(). Set_ShipLaunchAngle(). DO_Params0(). Until PreLaunch_Longitude() = TRUE { Print TimetoLaunch at (18,23). DO_Params0(). } // We're at 5 seconds to launch - start countdown Screenie_02(). Set Count to 5. UNTIL Count = 0 { PRINT " " AT (17,23). PRINT Count AT (18,23). IF Count = 4 { Set THROTTLE to 1. STAGE. Print " ACTIVATED " AT (17,24). } SET Count to Count - 1. WAIT 1. } wait 0.001. Set STEERING to HEADING(ShipDirection,ShipPitch). STAGE. Print " RELEASED " AT (17,25). Print " RELEASED " AT (17,26). WAIT 1. } //****************************************************************************** // Stage_1 //****************************************************************************** FUNCTION Stage_1 { LOCAL b_Busy1 is TRUE. LOCAL b_Pro is FALSE. Set ThisStage to 1. Until b_Busy1 = FALSE { DO_Params(). If Stg1Thrust:thrust < 10 { STAGE. Set b_Busy1 to FALSE. } ELSE { DO_PitchProgram(). DO_SteeringProgram(). IF b_Pro = FALSE { IF b_Prograde = TRUE { SAS ON. Set SASMODE to "PROGRADE". Set b_Pro to TRUE. } } DO_Screenies(). } IF b_Prograde = FALSE { Set STEERING to HEADING(ShipDirection,ShipPitch). } } } //****************************************************************************** // Stage_2 //****************************************************************************** FUNCTION Stage_2 { LOCAL b_Busy2 is TRUE. LOCAL b_Pro is FALSE. LOCAL BCount is 500. LOCAL CCount is 1000. Set ThisStage to 2. RCS ON. SAS OFF. K3NIV18_1200:DOACTION("deploy panels",TRUE). K3NIV18_0300:DOACTION("deploy panels",TRUE). K3NIV18_0600:DOACTION("deploy panels",TRUE). K3NIV18_0900:DOACTION("deploy panels",TRUE). Until b_Busy2 = FALSE { //*** CURRENT SHIP STATE *** DO_Params(). Set BCount to BCount - 1. IF BCount < 1 { Set BCount to 0. If Stg2Thrust:thrust < 10 { STAGE. Set b_Busy2 to FALSE. } } IF b_Busy2 = TRUE { DO_PitchProgram(). DO_SteeringProgram(). IF b_Pro = FALSE { IF b_Prograde = TRUE { SAS ON. Set b_Pro to TRUE. } } } DO_Screenies(). Set CCount to CCount - 1. If CCount < 1 {Set CCount to 0.} If CCount = 900{COMM32_Antenna_ON().} If CCount = 700{NAV_Lights_ON().} If CCount = 500{BLU_Lights_ON().} IF b_Prograde = FALSE { Set STEERING to HEADING(ShipDirection,ShipPitch). } } } //****************************************************************************** // Stage_3 //****************************************************************************** FUNCTION Stage_3 { LOCAL StartTime is 0.0. LOCAL b_Burn is FALSE. LOCAL ThisTime is 0.0. LOCAL b_OnOff is FALSE. LOCAL b_Time is FALSE. Run_Stg3_Engs(1). wait 2. Run_Stg3_Engs(0). RCS OFF. SAS ON. SolarPanelsON(). RadiatorPanelsON(). Set ThisTime to 7. Until ThisTime < 1 { Set Steering to Thisship:VELOCITY:ORBIT. Set ThisTime to ThisTime - 1. Wait 1. } CalcBurnTime(). Set ThisTime to (ShipBurnTime * 0.5). Set ShipEtaApoapsis to ETA:APOAPSIS. Set kuniverse:timewarp:mode to "PHYSICS". Set kuniverse:timewarp:warp to 3. Until ShipEtaApoapsis < ThisTime { Set Steering to Thisship:VELOCITY:ORBIT. Set ShipEtaApoapsis to ETA:APOAPSIS. Set StartTime to ShipEtaApoapsis - ThisTime. If b_OnOff = FALSE { If b_Time = FALSE. { IF StartTime < 25 { Set kuniverse:timewarp:warp to 0. Set b_Time to TRUE. } } IF StartTime < 20 { SolarPanelsOFF(). RadiatorPanelsOFF(). Set b_OnOff to TRUE. } } Print StartTime at (18,25). Print ShipEtaApoapsis at (18,26). DO_Params3(). CalcDeltaV(). } Screenie_3B(). RCS ON. SAS OFF. Run_Stg3_Engs(6). Set ThisTime to TIME:SECONDS + ShipBurnTime. Set StartTime to TIME:SECONDS. Until StartTime < 0.1 { Set Steering to Thisship:VELOCITY:ORBIT. DO_Params3(). Set ShipEtaApoapsis to ETA:APOAPSIS. Set StartTime to (ThisTime - TIME:SECONDS). PRINT StartTime AT (18,24). PRINT (Vreq - ThisShip:VELOCITY:Orbit:MAG) at (18,23). } Run_Stg3_Engs(0). SolarPanelsON(). RadiatorPanelsON(). } //****************************************************************************** // Stage_4 //****************************************************************************** Function Stage_4 { LOCAL b_Stage is TRUE. LOCAL A is 0.0. LOCAL B is 0.0. LOCAL Va is 0.0. LOCAL Vb is 0.0. LOCAL DVa is 0.0. LOCAL DVb is 0.0. LOCAL Bt is 0.0. Screenie_4A(). RCS OFF. SAS ON. Set kuniverse:timewarp:mode to "PHYSICS". Set kuniverse:timewarp:warp to 3. Until b_Stage = FALSE { DO_Params3(). Set Steering to Thisship:VELOCITY:ORBIT. IF ShipLatitude > 86 { Set kuniverse:timewarp:warp to 0. } IF ShipLatitude > 87 { Set b_Stage to FALSE. SolarPanelsOFF(). RadiatorPanelsOFF(). Set A to ThisShip:BODY:RADIUS + ((TargAltitude + ShipAltitude)/2). Set Va to SQRT(ThisShip:BODY:MU / (ThisShip:BODY:RADIUS + ShipAltitude)). Set Vb to SQRT(ThisShip:BODY:MU / (ThisShip:BODY:RADIUS + TargAltitude)). Set DVa to ((2 / (ThisShip:BODY:RADIUS + ShipAltitude)) - (1 / A)). Set DVa to SQRT(ThisShip:BODY:MU * DVa). Set DVa to ABS(DVa - Va). Set DVb to ((2 / (ThisShip:BODY:RADIUS + TargAltitude)) - (1 / A)). Set DVb to SQRT(ThisShip:BODY:MU * DVb). Set DVb to ABS(DVb - Vb). } } Set b_Stage to TRUE. Print DVa at (18,23). Set Bt to ABS(CalcBurnTime2(DVa)). Print Bt at (18,24). Until b_Stage = FALSE { DO_Params3(). Set Steering to Thisship:VELOCITY:ORBIT. IF ShipLatitude > 88 { Set b_Stage to FALSE. Set A to TIME:SECONDS + Bt. } } RCS ON. SAS OFF. Run_Stg3_Engs(6). Set b_Stage to TRUE. Until b_Stage = FALSE { Set Steering to Thisship:VELOCITY:ORBIT. DO_Params3(). Set B to A - TIME:SECONDS. Print B at (18,25). IF B < 0.1 { Set b_Stage to FALSE. Run_Stg3_Engs(0). } } Screenie_4B(). RCS OFF. SAS ON. SolarPanelsON(). RadiatorPanelsON(). Set b_Stage to TRUE. wait 5. Set Bt to ABS(CalcBurnTime2(DVb)). Print DVb at (18,23). Print Bt at (18,24). Set kuniverse:timewarp:mode to "PHYSICS". Set kuniverse:timewarp:warp to 3. Until b_Stage = FALSE { DO_Params3(). Set Steering to Thisship:VELOCITY:ORBIT. IF ShipLatitude < -86 { Set kuniverse:timewarp:warp to 0. } IF ShipLatitude < -87 { Set b_Stage to FALSE. SolarPanelsOFF(). RadiatorPanelsOFF(). } } Set b_Stage to TRUE. Until b_Stage = FALSE { DO_Params3(). Set Steering to Thisship:VELOCITY:ORBIT. IF ShipLatitude < -88 { Set b_Stage to FALSE. Set A to TIME:SECONDS + Bt. } } RCS ON. SAS OFF. Run_Stg3_Engs(6). Set b_Stage to TRUE. Until b_Stage = FALSE { Set Steering to Thisship:VELOCITY:ORBIT. DO_Params3(). Set B to A - TIME:SECONDS. Print B at (18,25). IF B < 0.1 { Set b_Stage to FALSE. Run_Stg3_Engs(0). } } SolarPanelsON(). RadiatorPanelsON(). } //****************************************************************************** // //****************************************************************************** Function Cruise { Unlock Steering. RCS OFF. SAS ON. Set SASMODE to "PROGRADE". } //****************************************************************************** // DO_Params0 //****************************************************************************** FUNCTION DO_Params0 { Set EarthRotang to SHIP:ORBIT:BODY:ROTATIONANGLE. IF b_Targ = TRUE { Set TargPos_V to Target:POSITION. Set TargBPos_V to Target:BODY:POSITION. Set TargLatitude to Target:GEOPOSITION:LAT. } Set ShipPos_V to ThisShip:POSITION. Set ShipBPos_V to ThisShip:BODY:POSITION. } //****************************************************************************** // DO_Params //****************************************************************************** Function DO_Params { Set ShipInclination to ThisShip:ORBIT:INCLINATION. Set ShipLan to ThisShip:ORBIT:LAN. Set ShipApoapsisHgt to ThisShip:ORBIT:APOAPSIS. Set ShipPeriapisHgt to ThisShip:ORBIT:PERIAPSIS. Set ShipLatitude TO ThisShip:GEOPOSITION:LAT. Set ShipLongitude TO ThisShip:GEOPOSITION:LNG. Set ShipAltitude to ThisShip:ALTITUDE. Set ShipEtaApoapsisLast to ShipEtaApoapsis. Set ShipEtaApoapsis to ETA:APOAPSIS. Set ShipDApoapsis to ShipEtaApoapsis - ShipEtaApoapsisLast. Set ShipPos_V to ThisShip:POSITION. Set ShipBPos_V to ThisShip:BODY:POSITION. Set ShipPos_DV to ShipPos_V - ShipBPos_V. IF b_Targ = TRUE { Set TargPos_V to Target:POSITION. Set TargBPos_V to Target:BODY:POSITION. Set TargPos_DV to TargPos_V - TargBPos_V. Set TargLatitude to Target:GEOPOSITION:LAT. } } //****************************************************************************** // DO_Params3 //****************************************************************************** Function DO_Params3 { Set ShipInclination to ThisShip:ORBIT:INCLINATION. Set ShipLan to ThisShip:ORBIT:LAN. Set ShipApoapsisHgt to ThisShip:ORBIT:APOAPSIS. Set ShipPeriapisHgt to ThisShip:ORBIT:PERIAPSIS. Set ShipLatitude TO ThisShip:GEOPOSITION:LAT. Set ShipLongitude TO ThisShip:GEOPOSITION:LNG. IF ShipLongitude < 0{Set ShipLongitude to ShipLongitude + 360.} IF ShipLongitude > 360 {Set ShipLongitude to ShipLongitude - 360.} Set ShipAltitude to ThisShip:ALTITUDE. Print ShipInclination AT (18,13). Print ShipLan AT (18,14). Print ShipApoapsisHgt AT (18,15). Print ShipPeriapisHgt AT (18,16). Print ShipLatitude AT (18,17). Print ShipLongitude AT (18,18). Print ShipAltitude AT (18,19). } //****************************************************************************** // DO_PitchProgram //****************************************************************************** Function DO_PitchProgram { LOCAL P is 0.0. IF b_ProGrade = FALSE { Set P to ShipPitch. IF ShipAltitude > i_PitchStartAlt { IF ShipAltitude < Hgt01 { Set P TO ShipPitchRange - ((ShipPitchRange * ShipAltitude) / Hgt01). If ABS(P) < ShipExitPitch { Set P to ShipExitPitch. } } ELSE { IF ShipEtaApoapsis < 60 { IF ShipDApoapsis < 0 { Set P to P + 0.01. } } ELSE { IF ShipDApoapsis > 0 { Set P to P - 0.01. } } If P > ShipExitPitch {Set P to ShipExitPitch.} If P < 0 {Set P to 0.} } } ELSE { Set P to 90. } Set ShipPitch to P. } } //****************************************************************************** // DO_SteeringProgram //****************************************************************************** Function DO_SteeringProgram { LOCAL B is 0.0. LOCAL d_Inc is 0.0. //*** ROLL PROGRAM *** IF b_Roll = FALSE { IF ShipAltitude > i_RollHeight { Set ShipDirection to ShipLaunchHead. Set b_Roll to TRUE. } } ELSE { IF b_ProGrade = FALSE { //*** FOLLOW INCLINATION DIFFERENCE *** IF ShipAltitude > i_PitchStartAlt { Set d_Inc to (TargInclination - ShipInclination). //*** NOT LOCKED TO PROGRADE ? *** IF b_ProGrade = FALSE { //*** WITHIN CONTROL RANGE ? *** IF ABS(d_Inc) < DDINC { Set B to 90 - (TargInclination + (5 * d_Inc)). IF B < 0 {Set B to B + 360.} IF B > 360 {Set B to B - 360.} //*** EFFECT COURSE CHANGE *** Set ShipDirection to B. //*** WITHIN PROGRADE LOCK LIMIT *** IF ABS(d_Inc) < 0.02 { Set b_ProGrade to TRUE. } } } } } } } //****************************************************************************** // //****************************************************************************** Function MakeShipParts { LOCAL PRT is "". LOCAL PrtMod is "". Set ThisShip to Vessel("K_3"). For Prt in ThisShip:PARTS { //********************************* // STAGE-1 ENGINES * // * // KSPAction is "activate engine" * // KSPAction is "shutdown engine" * //********************************* IF Prt:TAG = "Stg1_Eng_L" { // For PrtMod in Prt:MODULES // { // if PrtMod = "ModuleEnginesRF" // { // Set Stg1Thrust to Prt:GETMODULE(PrtMod). // } // } Set Stg1Thrust to Prt. } //********************************* // STAGE-2 ENGINES * // * // KSPAction is "activate engine" * // KSPAction is "shutdown engine" * //********************************* IF Prt:TAG = "Stg2_Eng" { // For PrtMod in Prt:MODULES // { // if PrtMod = "ModuleEnginesRF" // { // Set Stg2Thrust to Prt:GETMODULE(PrtMod). // } // } Set Stg2Thrust to Prt. } //*********************************** // STAGE-2 REACTION WHEEL * // * // KSPAction is "activate wheel" * // KSPAction is "deactivate wheel" * //*********************************** IF Prt:TAG = "Stg2_Wheel" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleReactionWheel" { Set Stg2Wheel to Prt:GETMODULE(PrtMod). } } } //********************************* // STAGE-3 ENGINES * // 12 Engines operated in 6 pairs * // * // KSPAction is "activate engine" * // KSPAction is "shutdown engine" * //********************************* IF Prt:TAG = "K3_Eng_A1" { Set K3Eng_A to Prt. For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_A1 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_Eng_A2" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_A2 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_Eng_B1" { Set K3Eng_B to Prt. For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_B1 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_Eng_B2" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_B2 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_Eng_C1" { Set K3Eng_C to Prt. For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_C1 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_Eng_C2" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_C2 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_Eng_D1" { Set K3Eng_D to Prt. For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_D1 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_Eng_D2" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_D2 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_Eng_E1" { Set K3Eng_E to Prt. For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_E1 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_Eng_E2" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_E2 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_Eng_F1" { Set K3Eng_F to Prt. For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_F1 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_Eng_F2" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleEnginesRF" { Set K3Eng_F2 to Prt:GETMODULE(PrtMod). } } } //*************************************** // Probe - probeStackSmall * //(Probe control Room needs a probe) * // * // KSPAction is "orbit prograde" * // KSPAction is "orbit retrograde" * // KSPAction is "orbit normal" * // KSPAction is "orbit antinormal," * // KSPAction is "orbit radial in" * // KSPAction is "orbit radial out" * // KSPAction is "orbit kill rotation" * // KSPAction is "deactivate smartacs" * // KSPAction is "panic!" * // KSPAction is "translatron off" * // KSPAction is "translatron keep vert" * // KSPAction is "translatron zero speed"* // KSPAction is "translatron +1 speed" * // KSPAction is "translatron -1 speed" * // KSPAction is "translatron toggle h/s"* //*************************************** IF Prt:TAG = "K3_RGU_01" { For PrtMod in Prt:MODULES { if PrtMod = "MechJebCore" { Set K3RGU_01 to Prt:GETMODULE(PrtMod). } } } //*************************************** // Avionics Wheel * // (Habitat main gyro wheel) * // * // KSPAction is "orbit prograde" * // KSPAction is "orbit retrograde" * // KSPAction is "orbit normal" * // KSPAction is "orbit antinormal," * // KSPAction is "orbit radial in" * // KSPAction is "orbit radial out" * // KSPAction is "orbit kill rotation" * // KSPAction is "deactivate smartacs" * // KSPAction is "panic!" * // KSPAction is "translatron off" * // KSPAction is "translatron keep vert" * // KSPAction is "translatron zero speed"* // KSPAction is "translatron +1 speed" * // KSPAction is "translatron -1 speed" * // KSPAction is "translatron toggle h/s"* //*************************************** IF Prt:TAG = "K3_WHEEL_01" { For PrtMod in Prt:MODULES { if PrtMod = "MechJebCore" { Set K3WHEEL_01 to Prt:GETMODULE(PrtMod). } } } //*********************************** // Antenna - RTLongAntenna2 * // (communotron32) * // * // KSPAction is "activate" * // KSPAction is "deactivate" * //*********************************** IF Prt:TAG = "K3_COM32_1030" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleRTAntenna" { Set K3COM32_1030 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_COM32_0130" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleRTAntenna" { Set K3COM32_0130 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_COM32_0430" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleRTAntenna" { Set K3COM32_0430 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_COM32_0730" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleRTAntenna" { Set K3COM32_0730 to Prt:GETMODULE(PrtMod). } } } //*********************************** // NAV Lights - indicatorLightSmall * // (Indicator Light) * // * // KSPAction is "light toggle" * // KSPAction is "flash toggle" * // KSPAction is "double flash toggle"* // KSPAction is "interval toggle" * // KSPAction is "cycle modes" * //*********************************** IF Prt:TAG = "K3_NavF_Red" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3NavF_Red to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_NavM_Red" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3NavM_Red to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_NavA_Red" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3NavA_Red to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_NavF_Grn" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3NavF_Grn to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_NavM_Grn" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3NavM_Grn to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_NavA_Grn" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3NavA_Grn to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_NavF_Wht" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3NavF_Wht to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_NavM_Wht" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3NavM_Wht to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_NavA_Wht" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3NavA_Wht to Prt:GETMODULE(PrtMod). } } } //*********************************** // BLU Lights - indicatorLightSmall * // (Indicator Light) * // * // KSPAction is "light toggle" * // KSPAction is "flash toggle" * // KSPAction is "double flash toggle"* // KSPAction is "interval toggle" * // KSPAction is "cycle modes" * //*********************************** IF Prt:TAG = "K3_BluF_1030" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluF_1030 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_BluF_0130" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluF_0130 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_BluF_0430" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluF_0430 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_BluF_0730" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluF_0730 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_BluM_1030" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluM_1030 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_BluM_0130" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluM_0130 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_BluM_0430" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluM_0430 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_BluM_0730" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluM_0730 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_BluA_1030" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluA_1030 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_BluA_0130" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluA_0130 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_BluA_0430" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluA_0430 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_BluA_0730" { For PrtMod in Prt:MODULES { if PrtMod = "ModuleNavLight" { Set K3BluA_0730 to Prt:GETMODULE(PrtMod). } } } //*********************************** // SSTU HABITAT MODULE * //*********************************** IF Prt:TAG = "K3_HabM_01" { For PrtMod in Prt:MODULES { //*************************************** // KSPAction is "undock node" * // KSPAction is "decouple node" * // KSPAction is "enable crossfeed" * // KSPAction is "disable crossfeed" * // KSPAction is "toggle crossfeed * //*************************************** if PrtMod = "ModuleDockingNode" { Set K3HabM_DOCK to Prt:GETMODULE(PrtMod). } //*********************************** // KSPAction is "toggle lights" * //*********************************** if PrtMod = "SSTUAnimateLight" { Set K3HabM_DOCKL to Prt:GETMODULE(PrtMod). } } } //*********************************** // RADIATOR MODULES * //*********************************** IF Prt:TAG = "K3_RadM_0130" { For PrtMod in Prt:MODULES { //*********************************** // KSPAction is "toggle radiator" * // KSPAction is "extend radiator" * // KSPAction is "retract radiator" * //*********************************** if PrtMod = "ModuleDeployableRadiator" { Set K3RadM_0130D to Prt:GETMODULE(PrtMod). } //*********************************** // KSPAction is "toggle radiator" * // KSPAction is "activate radiator" * // KSPAction is "shutdown radiator" * //*********************************** if PrtMod = "ModuleActiveRadiator" { Set K3RadM_0130A to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_RadM_0430" { For PrtMod in Prt:MODULES { //*********************************** // KSPAction is "toggle radiator" * // KSPAction is "extend radiator" * // KSPAction is "retract radiator" * //*********************************** if PrtMod = "ModuleDeployableRadiator" { Set K3RadM_0430D to Prt:GETMODULE(PrtMod). } //*********************************** // KSPAction is "toggle radiator" * // KSPAction is "activate radiator" * // KSPAction is "shutdown radiator" * //*********************************** if PrtMod = "ModuleActiveRadiator" { Set K3RadM_0430A to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_RadM_0730" { For PrtMod in Prt:MODULES { //*********************************** // KSPAction is "toggle radiator" * // KSPAction is "extend radiator" * // KSPAction is "retract radiator" * //*********************************** if PrtMod = "ModuleDeployableRadiator" { Set K3RadM_0730D to Prt:GETMODULE(PrtMod). } //*********************************** // KSPAction is "toggle radiator" * // KSPAction is "activate radiator" * // KSPAction is "shutdown radiator" * //*********************************** if PrtMod = "ModuleActiveRadiator" { Set K3RadM_0730A to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_RadM_1030" { For PrtMod in Prt:MODULES { //*********************************** // KSPAction is "toggle radiator" * // KSPAction is "extend radiator" * // KSPAction is "retract radiator" * //*********************************** if PrtMod = "ModuleDeployableRadiator" { Set K3RadM_1030D to Prt:GETMODULE(PrtMod). } //*********************************** // KSPAction is "toggle radiator" * // KSPAction is "activate radiator" * // KSPAction is "shutdown radiator" * //*********************************** if PrtMod = "ModuleActiveRadiator" { Set K3RadM_1030A to Prt:GETMODULE(PrtMod). } } } //*********************************** // SOLAR PANELS LARGE * //*********************************** IF Prt:TAG = "K3_XT4_0130" { For PrtMod in Prt:MODULES { //***ALLFIELDS************************ // Single is "sun exposure" * // Single is "energy flow" * // String is "status" * //************************************ // KSPAction is "toggle solar panel" * // KSPAction is "extend solar panel" * // KSPAction is "retract solar panel"* //************************************ if PrtMod = "KopernicusSolarPanel" { Set K3XT4_0130 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_XT4_0430" { For PrtMod in Prt:MODULES { //***ALLFIELDS************************ // Single is "sun exposure" * // Single is "energy flow" * // String is "status" * //************************************ // KSPAction is "toggle solar panel" * // KSPAction is "extend solar panel" * // KSPAction is "retract solar panel"* //************************************ if PrtMod = "KopernicusSolarPanel" { Set K3XT4_0430 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_XT4_0730" { For PrtMod in Prt:MODULES { //***ALLFIELDS************************ // Single is "sun exposure" * // Single is "energy flow" * // String is "status" * //************************************ // KSPAction is "toggle solar panel" * // KSPAction is "extend solar panel" * // KSPAction is "retract solar panel"* //************************************ if PrtMod = "KopernicusSolarPanel" { Set K3XT4_0730 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_XT4_1030" { For PrtMod in Prt:MODULES { //***ALLFIELDS************************ // Single is "sun exposure" * // Single is "energy flow" * // String is "status" * //************************************ // KSPAction is "toggle solar panel" * // KSPAction is "extend solar panel" * // KSPAction is "retract solar panel"* //************************************ if PrtMod = "KopernicusSolarPanel" { Set K3XT4_1030 to Prt:GETMODULE(PrtMod). } } } //*********************************** // SOLAR PANELS CURVED * //*********************************** IF Prt:TAG = "K3_NIV18_1200" { For PrtMod in Prt:MODULES { //**ALLFIELDS************************ // String (RO) is "sun exposure" * // String (RO) is "energy flow" * //*********************************** // KSPAction is "deploy panels" * // KSPAction is "retract panels" * // KSPAction is "toggle panels" * //*********************************** if PrtMod = "Curved Solar Panel" { Set K3NIV18_1200 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_NIV18_0300" { For PrtMod in Prt:MODULES { //**ALLFIELDS************************ // String (RO) is "sun exposure" * // String (RO) is "energy flow" * //*********************************** // KSPAction is "deploy panels" * // KSPAction is "retract panels" * // KSPAction is "toggle panels" * //*********************************** if PrtMod = "Curved Solar Panel" { Set K3NIV18_0300 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_NIV18_0600" { For PrtMod in Prt:MODULES { //**ALLFIELDS************************ // String (RO) is "sun exposure" * // String (RO) is "energy flow" * //*********************************** // KSPAction is "deploy panels" * // KSPAction is "retract panels" * // KSPAction is "toggle panels" * //*********************************** if PrtMod = "Curved Solar Panel" { Set K3NIV18_0600 to Prt:GETMODULE(PrtMod). } } } IF Prt:TAG = "K3_NIV18_0900" { For PrtMod in Prt:MODULES { //**ALLFIELDS************************ // String (RO) is "sun exposure" * // String (RO) is "energy flow" * //*********************************** // KSPAction is "deploy panels" * // KSPAction is "retract panels" * // KSPAction is "toggle panels" * //*********************************** if PrtMod = "Curved Solar Panel" { Set K3NIV18_0900 to Prt:GETMODULE(PrtMod). } } } } } //************************************************************* // Set_Heights: Determines if a body has an atmosphere. // Calculates parking orbit height. // Defaults to 15000m. //************************************************************* Function Set_Heights { SET b_TMP TO Lunars:ATM:EXISTS. IF b_TMP = TRUE { SET HgtAtmosphere TO Lunars:ATM:HEIGHT. } ELSE { Set HgtAtmosphere to ThisShip:BODY:Raduis. Set HgtAtmosphere to HgtAtmosphere * 0.25. } Set Hgt01 to HgtAtmosphere * 0.65. Set Hgt02 to HgtAtmosphere * 1.0. Set Hgt03 to HgtAtmosphere * 1.1. } //****************************************************************************** //Stg0_ShipLaunchPosInfo: // // DETERMINES LAUNCH DIRECTION - NORTH OR SOUTH. // //****************************************************************************** Function Set_ShipLaunchPosInfo { If ShipLatitude < 0 { Set b_LaunchAscNode to FALSE. } ELSE { Set b_LaunchAscNode to TRUE. } IF ShipLongitude < 0 { Set ShipLongitude to ShipLongitude + 360. } IF ShipLongitude > 360 { Set ShipLongitude to ShipLongitude - 360. } // DYNAMIC Set ShipLanLong to (ShipLan - EarthRotang). IF ShipLanLong < 0 {Set ShipLanLong to 360 + ShipLanLong.} IF ShipLanLong > 360 {Set ShipLanLong to ShipLanLong - 360.} } //****************************************************************************** // CALCULATE LAUNCH ANGLE // // TARGET INCLINATION HAS TO BE GREATER THAN THE ABSOLUTE LATITUDE OF THE LAUNCH // BASE, AS MINIMUM INCLINATION, WITHOUT ANY MAJOR INC ADJUSTMENTS IS EQUAL TO // THE LAUNCH LATITUDE. // IF THE TARGET INCLINATION IS LOWER THAN THE LATITUDE, WE LAUNCH DUE EAST/WEST // AND ADJUST INCLINATION AT ASCENDING/DESCENDING NODES. //****************************************************************************** Function Set_ShipLaunchAngle { Local V_Orb is 0. Local V_xrot is 0. Local V_yrot is 0. Local f_TmpA is 0. Local f_TmpB is 0. Set f_TmpA to ABS(ShipLatitude). IF TargInclination > f_TmpA { // DESIRED ANGLE AT BASE LATITUDE Set f_TmpB to ARCSIN(COS(TargInclination)/COS(f_TmpA)). // VELOCITY AT END OF STAGE-2 (APPROXIMATE) Set V_Orb to SQRT(LUNARS:Mu/(LUNARS:Radius + ParkingOrbit)). // X-VELOCITY MINUS LATITUDE SURFACE VELOCITY Set V_xrot to (V_Orb * SIN(f_TmpB)) - (465.9 * COS(f_TmpA)). // Y-VELOCITY COMPONENT Set V_yrot to (V_Orb * COS(f_TmpB)). // ASCENDING NODE TO BASE LONGITUDES Set f_TmpA to ARCCOS(COS(f_TmpB)/SIN(TargInclination)). // LAUNCH ANGLE Set f_TmpB to ARCTAN(V_xrot/V_yrot). // ASCENDING NODE LAUNCH LONGITUDE IF b_LaunchAscNode = TRUE { // CHECK 2PI LIMIT IF f_TmpB < 0 {Set f_TmpB to f_TmpB + 360.} IF f_TmpB > 360 {Set f_TmpB to f_TmpB - 360.} IF ShipLatitude > 0 { Set ShipLaunchLong to (ShipLongitude - f_TmpA). } ELSE { Set ShipLaunchLong to (ShipLongitude + f_TmpA). } } // DESCENDING NODE LAUNCH LONGITUDE ELSE { Set f_TmpB to 180 - f_TmpB. // CHECK 2PI LIMIT IF f_TmpB < 0 {Set f_TmpB to f_TmpB + 360.} IF f_TmpB > 360 {Set f_TmpB to f_TmpB - 360.} IF ShipLatitude < 0 { Set ShipLaunchLong to (ShipLongitude - f_TmpA). } ELSE { Set ShipLaunchLong to (ShipLongitude + f_TmpA). } } // ADJUST LAUNCH HEADING Set ShipLaunchHead to f_TmpB - 0.9. // ADJUST LAUNCH LONGITUDE RANGE IF ShipLaunchLong < 0 { Set ShipLaunchLong to ShipLaunchLong + 360.} IF ShipLaunchLong > 360 { Set ShipLaunchLong to ShipLaunchLong - 360.} // SET INCLINATION LOCK ANGLE Set DDINC to ABS(ShipLaunchHead - (90 - TargInclination)). IF DDINC > 10 {Set DDINC to 360 - DDINC.} Set DDINC to DDINC/5. // IF NO TARGET -> PARKING ORBIT = 400KM IF b_Targ = FALSE {Set ParkingOrbit to TargStationHgt.} } // TARGET INCLINATION < BASE LATITUDE = GO 90!! ELSE { Set b_INC_Reduction to TRUE. Set ShipLaunchHead to 90. } } //****************************************************************************** // DETERMINES LAUNCH TIME //****************************************************************************** Function PreLaunch_Longitude { local m_Wop is 0. // CURRENT TARGET LONGITUDE Set TargLanLong to (TargLan - EarthRotang). IF TargLanLong < 0 {Set TargLanLong to TargLanLong + 360.} IF TargLanLong > 360 {Set TargLanLong to TargLanLong - 360.} // DEGREES TO LAUNCH Set TimetoLaunch to TargLanLong - ShipLaunchLong. Set TimetoLaunch to TimetoLaunch - 1. IF TimetoLaunch < 0 {Set TimetoLaunch to TimetoLaunch + 360.} IF TimetoLaunch > 360 {Set TimetoLaunch to TimetoLaunch - 360.} // DEGREES TO SECONDS Set TimetoLaunch to TimetoLaunch * 240. // LAUNCH SEQUENCE STARTS AT 5 If ABS(TimetoLaunch) < 5 { Set Tangle to 0. // IF THERE IS A TARGET DETERMINE LEAD ANGLE IF b_Targ = TRUE { Set ShipPos_V to ShipPos_V - ShipBPos_V. Set TargPos_V to TargPos_V - TargBPos_V. Set Tangle to Vang(ShipPos_V, TargPos_V). } // IF NO TARGET, LAUNCH ANYWAY ELSE { Return TRUE. } // // DETERMINE LAUNCH WINDOW // Set m_Wop to TargLatitude - ShipLatitude. // IF m_Wop > 30 // { // IF m_Wop < 80 // { // IF Tangle < 80 // { // Return TRUE. // } // } // } // PRINT " LAUNCH ABORTED" AT (20,21). } // LAUNCH TIME DETERMINES WARP FACTOR IF TimetoLaunch < 10 {Set WARP to 0.} ELSE IF TimetoLaunch < 50 {Set WARP to 1.} ELSE IF TimetoLaunch < 500 {Set WARP to 2.} ELSE IF TimetoLaunch < 2000 {Set WARP to 3.} ELSE {Set WARP to 4.} Return FALSE. } //****************************************************************************** // //****************************************************************************** Function DO_Screenies { Print ShipInclination AT (18,13). Print ShipLan AT (18,14). Print ShipApoapsisHgt AT (18,15). Print ShipPeriapisHgt AT (18,16). Print ShipLatitude AT (18,17). Print ShipLongitude AT (18,18). Print ShipAltitude AT (18,19). IF ThisStage = 1 {Print Stg1Thrust:thrust AT (18,23).} IF ThisStage = 2 {Print Stg2Thrust:thrust AT (18,23).} Print ShipPitch AT (18,24). Print ShipDirection AT (18,25). Print ShipEtaApoapsis AT (18,26). } //****************************************************************************** // NAV LIGHTS ON //****************************************************************************** Function NAV_Lights_ON { K3NavF_Red:DOACTION("light toggle",TRUE). K3NavM_Red:DOACTION("light toggle",TRUE). K3NavA_Red:DOACTION("light toggle",TRUE). K3NavF_Grn:DOACTION("light toggle",TRUE). K3NavM_Grn:DOACTION("light toggle",TRUE). K3NavA_Grn:DOACTION("light toggle",TRUE). K3NavF_Wht:DOACTION("light toggle",TRUE). K3NavM_Wht:DOACTION("light toggle",TRUE). K3NavA_Wht:DOACTION("light toggle",TRUE). } //****************************************************************************** // BLUE LIGHTS ON //****************************************************************************** Function BLU_Lights_ON { K3BluF_1030:DOACTION("light toggle",TRUE). K3BluF_0130:DOACTION("light toggle",TRUE). K3BluF_0430:DOACTION("light toggle",TRUE). K3BluF_0730:DOACTION("light toggle",TRUE). K3BluM_1030:DOACTION("light toggle",TRUE). K3BluM_0130:DOACTION("light toggle",TRUE). K3BluM_0430:DOACTION("light toggle",TRUE). K3BluM_0730:DOACTION("light toggle",TRUE). K3BluA_1030:DOACTION("light toggle",TRUE). K3BluA_0130:DOACTION("light toggle",TRUE). K3BluA_0430:DOACTION("light toggle",TRUE). K3BluA_0730:DOACTION("light toggle",TRUE). } //****************************************************************************** // WHIP AERIALS = ON //****************************************************************************** Function COMM32_Antenna_ON { K3COM32_1030:DOACTION("activate",TRUE). K3COM32_0130:DOACTION("activate",TRUE). K3COM32_0430:DOACTION("activate",TRUE). K3COM32_0730:DOACTION("activate",TRUE). } //****************************************************************************** // WHIP AERIALS = OFF //****************************************************************************** Function COMM32_Antenna_OFF { K3COM32_1030:DOACTION("deactivate",TRUE). K3COM32_0130:DOACTION("deactivate",TRUE). K3COM32_0430:DOACTION("deactivate",TRUE). K3COM32_0730:DOACTION("deactivate",TRUE). } //****************************************************************************** // SOLAR PANELS = ON //****************************************************************************** Function SolarPanelsON { K3XT4_0130:DOACTION("extend solar panel",TRUE). K3XT4_0430:DOACTION("extend solar panel",TRUE). K3XT4_0730:DOACTION("extend solar panel",TRUE). K3XT4_1030:DOACTION("extend solar panel",TRUE). } //****************************************************************************** // SOLAR PANELS = OFF //****************************************************************************** Function SolarPanelsOFF { K3XT4_0130:DOACTION("retract solar panel",TRUE). K3XT4_0430:DOACTION("retract solar panel",TRUE). K3XT4_0730:DOACTION("retract solar panel",TRUE). K3XT4_1030:DOACTION("retract solar panel",TRUE). } //****************************************************************************** // RADIATORS = ON //****************************************************************************** Function RadiatorPanelsON { K3RadM_0130D:DOACTION("extend radiator",TRUE). K3RadM_0430D:DOACTION("extend radiator",TRUE). K3RadM_0730D:DOACTION("extend radiator",TRUE). K3RadM_1030D:DOACTION("extend radiator",TRUE). K3RadM_0130A:DOACTION("activate radiator",TRUE). K3RadM_0430A:DOACTION("activate radiator",TRUE). K3RadM_0730A:DOACTION("activate radiator",TRUE). K3RadM_1030A:DOACTION("activate radiator",TRUE). } //****************************************************************************** // RADIATORS = OFF //****************************************************************************** Function RadiatorPanelsOFF { K3RadM_0130A:DOACTION("shutdown radiator",TRUE). K3RadM_0430A:DOACTION("shutdown radiator",TRUE). K3RadM_0730A:DOACTION("shutdown radiator",TRUE). K3RadM_1030A:DOACTION("shutdown radiator",TRUE). K3RadM_0130D:DOACTION("retract radiator",TRUE). K3RadM_0430D:DOACTION("retract radiator",TRUE). K3RadM_0730D:DOACTION("retract radiator",TRUE). K3RadM_1030D:DOACTION("retract radiator",TRUE). } //****************************************************************************** // STAGE-3 ENGINE CONTROL //****************************************************************************** Function Run_Stg3_Engs { Parameter EngCount. IF EngCount > 0 { IF K3Eng_A:thrust < 0.1 { K3Eng_A1:DOACTION("activate engine",TRUE). K3Eng_A2:DOACTION("activate engine",TRUE). } } ELSE { IF K3Eng_A:thrust > 0.1 { K3Eng_A1:DOACTION("shutdown engine",TRUE). K3Eng_A2:DOACTION("shutdown engine",TRUE). } } IF EngCount > 1 { IF K3Eng_B:thrust < 0.1 { K3Eng_B1:DOACTION("activate engine",TRUE). K3Eng_B2:DOACTION("activate engine",TRUE). } } ELSE { IF K3Eng_B:thrust > 0.1 { K3Eng_B1:DOACTION("shutdown engine",TRUE). K3Eng_B2:DOACTION("shutdown engine",TRUE). } } IF EngCount > 2 { IF K3Eng_C:thrust < 0.1 { K3Eng_C1:DOACTION("activate engine",TRUE). K3Eng_C2:DOACTION("activate engine",TRUE). } } ELSE { IF K3Eng_C:thrust > 0.1 { K3Eng_C1:DOACTION("shutdown engine",TRUE). K3Eng_C2:DOACTION("shutdown engine",TRUE). } } IF EngCount > 3 { IF K3Eng_D:thrust < 0.1 { K3Eng_D1:DOACTION("activate engine",TRUE). K3Eng_D2:DOACTION("activate engine",TRUE). } } ELSE { IF K3Eng_D:thrust > 0.1 { K3Eng_D1:DOACTION("shutdown engine",TRUE). K3Eng_D2:DOACTION("shutdown engine",TRUE). } } IF EngCount > 4 { IF K3Eng_E:thrust < 0.1 { K3Eng_E1:DOACTION("activate engine",TRUE). K3Eng_E2:DOACTION("activate engine",TRUE). } } ELSE { IF K3Eng_E:thrust > 0.1 { K3Eng_E1:DOACTION("shutdown engine",TRUE). K3Eng_E2:DOACTION("shutdown engine",TRUE). } } IF EngCount > 5 { IF K3Eng_F:thrust < 0.1 { K3Eng_F1:DOACTION("activate engine",TRUE). K3Eng_F2:DOACTION("activate engine",TRUE). } } ELSE { IF K3Eng_F:thrust > 0.1 { K3Eng_F1:DOACTION("shutdown engine",TRUE). K3Eng_F2:DOACTION("shutdown engine",TRUE). } } } //****************************************************************************** // Calculate Burn Time //****************************************************************************** Function CalcBurnTime { Local VatApo is V(0.0,0.0,0.0). Local Mend is 0.0. Local Mavg is 0.0. Local ShipAccelAvg is 0.0. Set Vreq to SQRT(ThisShip:BODY:MU/(ThisShip:BODY:RADIUS + ShipApoapsisHgt)). Set VatApo to VELOCITYAT(ThisShip,(Time:SECONDS + ShipEtaApoapsis)). Set DVreq to (Vreq - VatApo:ORBIT:MAG). Print DVreq at (18,24). Set Mend to (ThisShip:MASS / 2.71828^(DVreq / (9.802 * HabEngine_ISP))). Set Mavg to ((ThisShip:MASS + Mend) / 2). Set ShipAccelAvg to ((HabEngine_NEWTONS * 12 ) / Mavg). Set ShipBurnTime to ((DVreq*1000)/ ShipAccelAvg ). } //****************************************************************************** // Calculate Burn Time 2 //****************************************************************************** Function CalcBurnTime2 { PARAMETER ThisDV. LOCAL A is 0.0. //--- CALCULATE MASS AT END OF DELTA-V ---// Set A to (ThisShip:MASS / 2.71828^(ThisDV / (9.802 * HabEngine_ISP))). //--- CALCULATE AVERAGE MASS ---// Set A to ((ThisShip:MASS + A) / 2). //--- CALCULATE AVERAGE ACCELERATION ---// Set A to ((HabEngine_NEWTONS * 12 ) / A). //--- CALCULATE BURN TIME ---// Set A to ((ThisDV * 1000)/ A ). //--- SEND IT BACK ---// Return A. } //****************************************************************************** // Calculate DeltaV //****************************************************************************** Function CalcDeltaV { Local VatApo is V(0.0,0.0,0.0). Set Vreq to SQRT(ThisShip:BODY:MU/(ThisShip:BODY:RADIUS + ShipApoapsisHgt)). Set VatApo to VELOCITYAT(ThisShip,(Time:SECONDS + ShipEtaApoapsis)). Set DVreq to (Vreq - VatApo:ORBIT:MAG). Print DVreq at (18,24). } //****************************************************************************** // Orpoodleange_DeltaV //****************************************************************************** //Function Holman //{ //PARAMETER NewHeight. //PARAMETER ThisHeight. //LOCAL A is 0. //LOCAL V is 0. //LOCAL B is 0. // // Set A to ThisShip:BODY:RADIUS + ((NewHeight + ThisHeight)/2). // Set V to SQRT(ThisShip:BODY:MU / ThisHeight). // Set B to ((2 / (ThisShip:BODY:RADIUS + ThisHeight)) - (1 / A)). // Set B to SQRT(ThisShip:BODY:MU * B). // Set B to B - V. // Return B //} //****************************************************************************** // Burn Time Debug //****************************************************************************** Function BT_DEBUG { Local VatApo is V(0.0,0.0,0.0). Local Mend is 0.0. Local Mavg is 0.0. Local ShipAccelAvg is 0.0. Set Vreq to SQRT(ThisShip:BODY:MU/(ThisShip:BODY:RADIUS + ShipApoapsisHgt)). Set VatApo to VELOCITYAT(ThisShip,(Time:SECONDS + ShipEtaApoapsis)). Set DVreq to (Vreq - VatApo:ORBIT:MAG). Set Mend to (ThisShip:MASS / 2.71828^(DVreq / (9.802 * HabEngine_ISP * 0.866))). Set Mavg to ((ThisShip:MASS + Mend) / 2). Set ShipAccelAvg to ((HabEngine_NEWTONS * 0.866) / Mavg). Set ShipBurnTime to (DVreq / ShipAccelAvg). Print ThisShip:BODY:MU at (18,23). Print ThisShip:BODY:RADIUS at (18,24). Print ShipApoapsisHgt at (18,25). Print Vreq at (18,26). Print VatApo:ORBIT:MAG at (18,27). Print DVreq at (18,28). Print ThisShip:MASS at (18,29). Print Mend at (18,30). Print Mavg at (18,31). Print ShipAccelAvg at (18,32). Print ShipBurnTime at (18,33). }
  8. Decided to do a check.. afraid it is embedded in code. Most likely in setting the background window colour in some API I changed those three images to just blank colours.. one can still see the window border is still grey ? While the three colours are seen in the screen active area
  9. SteveM: KOs doesn't seem to like a transparent terminal background pic for some reason and still produces the shade. Rocket details: Both LHLOX engines RD-0120s from the Russian Engines pack LR87s for upper stage use.. RD-0120s are too powerful and would pancake everything in the payload The payload is SSTUs habitat with it's own engines and goodies. I had to factor a Cos(30) into the burntime calcs as these engines point outwards.
  10. ..Playing around and too lazy to edit it out.. for sake of continuity. Recorded video at 6 fps and accelerated (compressed) final result to 24 fps.. so yes.. whooooooooosh I've just blanked the terminal background images, as I would like to get only a green text overlay. KOS seems to have the grey background embedded in code, so cannot get rid of it. I'll look at KOSs dialog boxes next.
  11. KOS automatic launch to orbit with burntime calculation - not bad ... within 4Km of Eccentricity = 0. https://www.youtube.com/watch?v=a1VB07B4hrg&feature=youtu.be I'll try next with pure vectors and calcs.
  12. Yes.. but I'm just looking at placing my hot posterior on one seat BTW where does one get all that unity editor ? Thanks
  13. I'm just editing the cfg files, and looking at which numbers to changes in this section.. rotation = 0.4353384, -0.5572078, 0.5572078, 0.4353383 I thought it might be rotation =X, Y, Z, ? But it seems to be some other axis..