Jump to content

ImAKerbal

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by ImAKerbal

  1. On 1/29/2021 at 6:18 AM, Kielm said:

    If you're using windows and steam's version of KSP, you can find the log here

    C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP.log

    The log file should tell you why it's not loading. 

    Thanks, I checked the logs and when I got to the error area it said something about not being able to load a certain sound for Real Solar System. I was told that this shouldn't change anything. I checked multiple tutorials and asked many RO users how to install it and did exactly what they did and no fix. What should I do? Do you want me to post my logs?

  2. 14 hours ago, jimmymcgoochie said:

    When the game stops working on the loading screen it’s usually due to an exception that prevents the game from loading any further. You’ll probably find the cause in the log files, here’s how to find them:

    https://forum.kerbalspaceprogram.com/index.php?/topic/83212-how-to-get-support-read-first/

    Grab the logs and share them here (use a file sharing site and post links, please don’t copy and paste the logs here as it’s almost impossible to read them that way especially on tablets/mobiles) as well as a mod list and your system specs- OS, CPU, RAM and GPU being the most useful. 

    Thanks, I can only find the Kopernicus and Module Manger logs but my spec are this:

    Manufacturer: Acer

    Model: Nitro AN515-54

    Processor: Intel (R) Core (TM) i5-9300H CPU @ 2.40GHz    2.40 GHz

    Installed Ram: 8.00 GB (7.85 GB usable)

    System type: 64-bit operating system, x64-based processor 

    no pen and touch

    The only mods im using is RO, RSS, RSS 2048-1080 textures, and Scatterer

  3. Not to sure were to put this but i'm pretty sure this is were I should.

    I have a problem with my Kos script where it wont launch my falcon 9. I'm using the tundra mod and the script should be able to run it. What it's supposed to do it launch the rocket get the other stages to orbit while the first stage does a boost back and lands back on the launch pad. When I press 2 (the action group to toggle the control thingy for KOS) nothing happens. BTW I did not make this script I watched a tutorial for space x landings here are the scripts

    Script 1: 

    // Ah yes
    // Mission Setup


    wait until ag6.

    missionSetup(

        // Will change depending on mission

        "ASDS",  // ["ASDS"] | ["RTLS"] | ["AOTL"] | ["EEHL"]
        500000,  // Target Orbit (Meters) (Station Freedom - 210000)
        28.6,       // Target Inclination (Degrees)
        "Cargo",  // ["Cargo"]
        false // Wait for launch window? (true / false)

    ).

    function missionSetup {

        parameter lMode, tOrbit, tInc, pType, window.

        clearscreen.

        // LandingMode Setup
        print "Landing Mode: " + lMode.
        if (lMode = "ASDS" or lMode = "AOTL") {global a is 120. global fuelToLand is 5000.} // 80
        else {set a to 130. set fuelToLand to 5800.}

        // TargetOrbit Setup
        if (tOrbit < 100000) {print "Target Orbit too low: " + tOrbit. abort on.}
        else {print "Target Orbit: " + tOrbit.}
        global atmosphericAlt is body:atm:height.
        global targetOrbit is tOrbit.

        // TargetInclination Setup
        if (tInc > 90) {print "Target Inclination too high: " + tInc. abort on.}
        else if (tInc < -90) {print "Target Inclination too low: " + tInc. abort on.}
        else {print "Target Inclination: " + tInc.}
        global targetInclination is tInc.

        lights on.

        // PayloadType Setup
        print "Payload Type: " + pType.
        if (pType = "Cargo") {global hasFairings is true. global fairingSepAlt is 80000. cargoFlight().} // 90 timer

    }

    // Other Variables

    function pitchOfVector {

        parameter vecT.
        return 90 - vang(ship:up:vector, vecT).

    }

    // Cargo Ascent Functions

    function cargoFlight {

        // Steeringmanager Setup
        set steeringmanager:rollts to 25.
        set steeringmanager:maxstoppingtime to 10.

        set orbitalInsertionBurnLock to true.

        // Script Setup

        runOncePath("0:/lib_lazcalc").

        // Liftoff  

        toggle ag2.
        wait 10.
        stage.
        lock throttle to 1.
        wait 2.
        stage.
        lock steering to up.
        wait 8.

        print "Liftoff".

        wait 1.5.
        if verticalSpeed > 1 {
            print "Nominal liftoff".
        } else {
            print "Abort activated".
            abort on.
            shutdown.
        }

        // Functions

        cargoAscent().
        cargoMeco().
        cargoSecondStage().
        cargoOrbitalBurn().

    }

    function cargoAscent {

        local azimuth_data is LAZcalc_init(targetOrbit, targetInclination).

        local slope is (0-90) / (1000 * (a - 10 - a * 0.05) - 0).

        until (ship:liquidfuel <= fuelToLand + 100) {

            local pitch is slope * ship:apoapsis + 90.

            if pitch < 0 {

                set pitch to 0.

            }

            if pitch > pitchOfVector(velocity:surface) + 5 {

                set pitch to pitchOfVector(velocity:surface) + 5.

            } else if pitch < pitchOfVector(velocity:surface) - 5 {

                set pitch to pitchOfVector(velocity:surface) -5.

            }

            local azimuth is LAZcalc(azimuth_data).

            lock steering to heading(azimuth, pitch).

        }

    }

    function cargoMeco {

        wait until (ship:liquidfuel <= fuelToLand + 100).
            rcs on.
            set currentFacing to facing.
            lock steering to currentFacing.
            wait until (ship:oxidizer <= fuelToLand).
                lock throttle to 0.
                lock steering to currentFacing.
                wait 0.5.
                print "MECO".
                rcs on.
                toggle ag8.
                stage.
                print "STAGE SEP".
                wait 3.5.
                lock throttle to 1.
                print "SSI1".

    }

    function cargoSecondStage {

        lock steering to currentFacing.
        wait 5.
        lock steering to prograde.

        when (ship:altitude >= fairingSepAlt and hasFairings = true) then {

            stage.
            print "Fairing sep".

        }

        when missionTime >= 280 then {
            print "Signal Kermuda, Stage 2 FTS Safed".
        }

        wait until (ship:apoapsis >= targetOrbit).
            lock throttle to 0.
            print "SECO1".

        wait until (ship:altitude >= atmosphericAlt).
            set orbitalInsertionBurnLock to false.
            print "Atmospheric Exit".
            print eta:apoapsis.

    }

    function cargoOrbitalBurn {

        set targetVel to sqrt(ship:body:mu / (ship:orbit:body:radius + ship:orbit:apoapsis)).
        set apVel to sqrt(((1 - ship:orbit:eccentricity) * ship:orbit:body:mu) / ((1 + ship:orbit:eccentricity) * ship:orbit:semimajoraxis)).
        set dv to targetVel - apVel.
        set myNode to node(time:seconds + eta:apoapsis, 0, 0, dv).
        add myNode.

        lock steering to lookdirup(ship:prograde:vector, heading(180, 0):vector).

        set nd to nextNode.
        set max_acc to ship:maxthrust / ship:mass.
        set burn_duration to nd:deltav:mag / max_acc.
        wait until nd:eta <= (burn_duration / 2 + 60).

        set np to nd:deltav.
        lock steering to np.
        wait until vang(np, ship:facing:vector) < 0.33.

        wait until nd:eta <= (burn_duration / 2).

        set dv0 to nd:deltav.
        set done to false.

        until done {

            wait 0.
            set max_acc to ship:maxthrust / ship:mass.

            lock throttle to min(nd:deltav:mag / max_acc, 1).

            print "SSI2".

            if vdot(dv0, nd:deltav) < 0 {

                lock throttle to 0.
                print "SECO2".
                break.

            }

            if nd:deltav:mag < 0.1 {

                wait until vdot(dv0, nd:deltav) < 0.5.
                lock throttle to 0.
                print "SECO2".
                shutdown.
                sas on.

            }

        }

    }

     

    Script 2:

    // Elixer Space Company - ASDS Script [version 0.3.1]


    // Landing Parameters


    parameter landingZone is latlng(-0.0972081051142032, -74.5576756827403).


    // Initialization


    wait until ag8.
    rcs on.
    set currentFacing to facing.
    lock steering to currentFacing.
    wait 3.


    // ASDS & AOTL Functions


        clearscreen.
        print "Elixer Landing Software".
        print "-".

        set steeringManager:maxstoppingtime to 5.
        set steeringManager:rollts to 20.


        // Landing Variables


        set radarOffset to 21.15. // This must be changed to the height of the landing vehicle (on gear)
        lock trueRadar to alt:radar - radarOffset.
        lock g to constant:g * body:mass / body:radius^2.
        lock maxDecel to (ship:availablethrust / ship:mass) - g.
        lock stopDist to ship:verticalspeed^2 / (2 * maxDecel).
        lock idealThrottle to stopDist / trueRadar.
        lock impactTime to trueRadar / abs(ship:verticalspeed).
        lock aoa to 30.
        lock errorScaling to 1.


        // Guidance Functions


        function getImpact {
            if addons:tr:hasimpact { return addons:tr:impactpos. }
                return ship:geoposition.
            }

        function lngError {
            return getImpact():lng - landingZone:lng.
            }

        function latError {
            return getImpact():lat - landingZone:lat.
            }

        function errorVector {
            return getImpact():position - landingZone:position.
            }

        function getSteering {
            local errorVector is errorVector().
            local velVector is -ship:velocity:surface.
            local result is velVector + errorVector*errorScaling.

            if vang(result, velVector) > aoa
            {
                set result to velVector:normalized
                            + tan(aoa)*errorVector:normalized.
            }

            return lookdirup(result, facing:topvector).
        }

    rcs on.
    lock steering to srfretrograde. 
    brakes on.
    wait until ship:verticalspeed <-700.
        lock throttle to 1.
        lock aoa to -5.
        lock steering to getSteering().
        toggle ag1.
        toggle ag7.
        rcs off.

    wait until ship:verticalspeed > -200.
        lock throttle to 0.
        lock aoa to 17.5. 
        lock steering to getSteering().
        steeringManager:resettodefault().
        rcs on.

    wait until alt:radar < 12000.
        lock aoa to 10.

    wait until alt:radar < 7000.
        lock aoa to 5.

    WAIT UNTIL ship:verticalspeed < -10. 
        rcs on.
        when impactTime < 2.75 then {gear on.} 

    WAIT UNTIL trueRadar < stopDist. 
        lock throttle to 1.
        lock aoa to -3.
        lock steering to getSteering().

    wait until ship:verticalspeed > -45.
        toggle ag1.
        lock throttle to idealThrottle.
        lock aoa to -2.
        lock steering to getSteering().

    when impactTime < 0.75 then {lock steering to heading(90, 90).}
       
    WAIT UNTIL ship:verticalspeed > -0.1.
        lock steering to up.
        set ship:control:pilotmainthrottle to 0.
        RCS off.

     

    Script 3:

    //This file is distributed under the terms of the MIT license, (c) the KSLib team
    //=====LAUNCH AZIMUTH CALCULATOR=====
    //~~LIB_LAZcalc.ks~~
    //~~Version 2.2~~
    //~~Created by space-is-hard~~
    //~~Updated by TDW89~~
    //~~Auto north/south switch by undercoveryankee~~

    @LAZYGLOBAL OFF.

    FUNCTION LAZcalc_init {
        PARAMETER
            desiredAlt, //Altitude of desired target orbit (in *meters*)
            desiredInc. //Inclination of desired target orbit

        PARAMETER autoNodeEpsilon IS 10. // How many m/s north or south
            // will be needed to cause a north/south switch. Pass zero to disable
            // the feature.
        SET autoNodeEpsilon to ABS(autoNodeEpsilon).
        
        //We'll pull the latitude now so we aren't sampling it multiple times
        LOCAL launchLatitude IS SHIP:LATITUDE.
        
        LOCAL data IS LIST().   // A list is used to store information used by LAZcalc
        
        //Orbital altitude can't be less than sea level
        IF desiredAlt <= 0 {
            PRINT "Target altitude cannot be below sea level".
            SET launchAzimuth TO 1/0.        //Throws error
        }.
        
        //Determines whether we're trying to launch from the ascending or descending node
        LOCAL launchNode TO "Ascending".
        IF desiredInc < 0 {
            SET launchNode TO "Descending".
            
            //We'll make it positive for now and convert to southerly heading later
            SET desiredInc TO ABS(desiredInc).
        }.
        
        //Orbital inclination can't be less than launch latitude or greater than 180 - launch latitude
        IF ABS(launchLatitude) > desiredInc {
            SET desiredInc TO ABS(launchLatitude).
            // HUDTEXT("Inclination impossible from current latitude, setting for lowest possible inclination.", 10, 2, 30, RED, FALSE).
        }.
        
        IF 180 - ABS(launchLatitude) < desiredInc {
            SET desiredInc TO 180 - ABS(launchLatitude).
            // HUDTEXT("Inclination impossible from current latitude, setting for highest possible inclination.", 10, 2, 30, RED, FALSE).
        }.
        
        //Does all the one time calculations and stores them in a list to help reduce the overhead or continuously updating
        LOCAL equatorialVel IS (2 * CONSTANT():Pi * BODY:RADIUS) / BODY:ROTATIONPERIOD.
        LOCAL targetOrbVel IS SQRT(BODY:MU/ (BODY:RADIUS + desiredAlt)).
        data:ADD(desiredInc).       //[0]
        data:ADD(launchLatitude).   //[1]
        data:ADD(equatorialVel).    //[2]
        data:ADD(targetOrbVel).     //[3]
        data:ADD(launchNode).       //[4]
        data:ADD(autoNodeEpsilon).  //[5]
        RETURN data.
    }.

    FUNCTION LAZcalc {
        PARAMETER
            data. //pointer to the list created by LAZcalc_init
        LOCAL inertialAzimuth IS ARCSIN(MAX(MIN(COS(data[0]) / COS(SHIP:LATITUDE), 1), -1)).
        LOCAL VXRot IS data[3] * SIN(inertialAzimuth) - data[2] * COS(data[1]).
        LOCAL VYRot IS data[3] * COS(inertialAzimuth).
        
        // This clamps the result to values between 0 and 360.
        LOCAL Azimuth IS MOD(ARCTAN2(VXRot, VYRot) + 360, 360).

        IF data[5] {
            LOCAL NorthComponent IS VDOT(SHIP:VELOCITY:ORBIT, SHIP:NORTH:VECTOR).
            IF NorthComponent > data[5] {
                SET data[4] TO "Ascending".
            } ELSE IF NorthComponent < -data[5] {
                SET data[4] to "Descending".
            }.
        }.
        
        //Returns northerly azimuth if launching from the ascending node
        IF data[4] = "Ascending" {
            RETURN Azimuth.
            
        //Returns southerly azimuth if launching from the descending node
        } ELSE IF data[4] = "Descending" {
            IF Azimuth <= 90 {
                RETURN 180 - Azimuth.
                
            } ELSE IF Azimuth >= 270 {
                RETURN 540 - Azimuth.
                
            }.
        }.
    }.

  4. I have a problem with my Kos script where it wont launch my falcon 9. I'm using the tundra mod and the script should be able to run it. What it's supposed to do it launch the rocket get the other stages to orbit while the first stage does a boost back and lands back on the launch pad. When I press 2 (the action group to toggle the control thingy for KOS) nothing happens. BTW I did not make this script I watched a tutorial for space x landings here are the scripts

    Script 1: 

    // Ah yes
    // Mission Setup


    wait until ag6.

    missionSetup(

        // Will change depending on mission

        "ASDS",  // ["ASDS"] | ["RTLS"] | ["AOTL"] | ["EEHL"]
        500000,  // Target Orbit (Meters) (Station Freedom - 210000)
        28.6,       // Target Inclination (Degrees)
        "Cargo",  // ["Cargo"]
        false // Wait for launch window? (true / false)

    ).

    function missionSetup {

        parameter lMode, tOrbit, tInc, pType, window.

        clearscreen.

        // LandingMode Setup
        print "Landing Mode: " + lMode.
        if (lMode = "ASDS" or lMode = "AOTL") {global a is 120. global fuelToLand is 5000.} // 80
        else {set a to 130. set fuelToLand to 5800.}

        // TargetOrbit Setup
        if (tOrbit < 100000) {print "Target Orbit too low: " + tOrbit. abort on.}
        else {print "Target Orbit: " + tOrbit.}
        global atmosphericAlt is body:atm:height.
        global targetOrbit is tOrbit.

        // TargetInclination Setup
        if (tInc > 90) {print "Target Inclination too high: " + tInc. abort on.}
        else if (tInc < -90) {print "Target Inclination too low: " + tInc. abort on.}
        else {print "Target Inclination: " + tInc.}
        global targetInclination is tInc.

        lights on.

        // PayloadType Setup
        print "Payload Type: " + pType.
        if (pType = "Cargo") {global hasFairings is true. global fairingSepAlt is 80000. cargoFlight().} // 90 timer

    }

    // Other Variables

    function pitchOfVector {

        parameter vecT.
        return 90 - vang(ship:up:vector, vecT).

    }

    // Cargo Ascent Functions

    function cargoFlight {

        // Steeringmanager Setup
        set steeringmanager:rollts to 25.
        set steeringmanager:maxstoppingtime to 10.

        set orbitalInsertionBurnLock to true.

        // Script Setup

        runOncePath("0:/lib_lazcalc").

        // Liftoff  

        toggle ag2.
        wait 10.
        stage.
        lock throttle to 1.
        wait 2.
        stage.
        lock steering to up.
        wait 8.

        print "Liftoff".

        wait 1.5.
        if verticalSpeed > 1 {
            print "Nominal liftoff".
        } else {
            print "Abort activated".
            abort on.
            shutdown.
        }

        // Functions

        cargoAscent().
        cargoMeco().
        cargoSecondStage().
        cargoOrbitalBurn().

    }

    function cargoAscent {

        local azimuth_data is LAZcalc_init(targetOrbit, targetInclination).

        local slope is (0-90) / (1000 * (a - 10 - a * 0.05) - 0).

        until (ship:liquidfuel <= fuelToLand + 100) {

            local pitch is slope * ship:apoapsis + 90.

            if pitch < 0 {

                set pitch to 0.

            }

            if pitch > pitchOfVector(velocity:surface) + 5 {

                set pitch to pitchOfVector(velocity:surface) + 5.

            } else if pitch < pitchOfVector(velocity:surface) - 5 {

                set pitch to pitchOfVector(velocity:surface) -5.

            }

            local azimuth is LAZcalc(azimuth_data).

            lock steering to heading(azimuth, pitch).

        }

    }

    function cargoMeco {

        wait until (ship:liquidfuel <= fuelToLand + 100).
            rcs on.
            set currentFacing to facing.
            lock steering to currentFacing.
            wait until (ship:oxidizer <= fuelToLand).
                lock throttle to 0.
                lock steering to currentFacing.
                wait 0.5.
                print "MECO".
                rcs on.
                toggle ag8.
                stage.
                print "STAGE SEP".
                wait 3.5.
                lock throttle to 1.
                print "SSI1".

    }

    function cargoSecondStage {

        lock steering to currentFacing.
        wait 5.
        lock steering to prograde.

        when (ship:altitude >= fairingSepAlt and hasFairings = true) then {

            stage.
            print "Fairing sep".

        }

        when missionTime >= 280 then {
            print "Signal Kermuda, Stage 2 FTS Safed".
        }

        wait until (ship:apoapsis >= targetOrbit).
            lock throttle to 0.
            print "SECO1".

        wait until (ship:altitude >= atmosphericAlt).
            set orbitalInsertionBurnLock to false.
            print "Atmospheric Exit".
            print eta:apoapsis.

    }

    function cargoOrbitalBurn {

        set targetVel to sqrt(ship:body:mu / (ship:orbit:body:radius + ship:orbit:apoapsis)).
        set apVel to sqrt(((1 - ship:orbit:eccentricity) * ship:orbit:body:mu) / ((1 + ship:orbit:eccentricity) * ship:orbit:semimajoraxis)).
        set dv to targetVel - apVel.
        set myNode to node(time:seconds + eta:apoapsis, 0, 0, dv).
        add myNode.

        lock steering to lookdirup(ship:prograde:vector, heading(180, 0):vector).

        set nd to nextNode.
        set max_acc to ship:maxthrust / ship:mass.
        set burn_duration to nd:deltav:mag / max_acc.
        wait until nd:eta <= (burn_duration / 2 + 60).

        set np to nd:deltav.
        lock steering to np.
        wait until vang(np, ship:facing:vector) < 0.33.

        wait until nd:eta <= (burn_duration / 2).

        set dv0 to nd:deltav.
        set done to false.

        until done {

            wait 0.
            set max_acc to ship:maxthrust / ship:mass.

            lock throttle to min(nd:deltav:mag / max_acc, 1).

            print "SSI2".

            if vdot(dv0, nd:deltav) < 0 {

                lock throttle to 0.
                print "SECO2".
                break.

            }

            if nd:deltav:mag < 0.1 {

                wait until vdot(dv0, nd:deltav) < 0.5.
                lock throttle to 0.
                print "SECO2".
                shutdown.
                sas on.

            }

        }

    }

     

    Script 2:

    // Elixer Space Company - ASDS Script [version 0.3.1]


    // Landing Parameters


    parameter landingZone is latlng(-0.0972081051142032, -74.5576756827403).


    // Initialization


    wait until ag8.
    rcs on.
    set currentFacing to facing.
    lock steering to currentFacing.
    wait 3.


    // ASDS & AOTL Functions


        clearscreen.
        print "Elixer Landing Software".
        print "-".

        set steeringManager:maxstoppingtime to 5.
        set steeringManager:rollts to 20.


        // Landing Variables


        set radarOffset to 21.15. // This must be changed to the height of the landing vehicle (on gear)
        lock trueRadar to alt:radar - radarOffset.
        lock g to constant:g * body:mass / body:radius^2.
        lock maxDecel to (ship:availablethrust / ship:mass) - g.
        lock stopDist to ship:verticalspeed^2 / (2 * maxDecel).
        lock idealThrottle to stopDist / trueRadar.
        lock impactTime to trueRadar / abs(ship:verticalspeed).
        lock aoa to 30.
        lock errorScaling to 1.


        // Guidance Functions


        function getImpact {
            if addons:tr:hasimpact { return addons:tr:impactpos. }
                return ship:geoposition.
            }

        function lngError {
            return getImpact():lng - landingZone:lng.
            }

        function latError {
            return getImpact():lat - landingZone:lat.
            }

        function errorVector {
            return getImpact():position - landingZone:position.
            }

        function getSteering {
            local errorVector is errorVector().
            local velVector is -ship:velocity:surface.
            local result is velVector + errorVector*errorScaling.

            if vang(result, velVector) > aoa
            {
                set result to velVector:normalized
                            + tan(aoa)*errorVector:normalized.
            }

            return lookdirup(result, facing:topvector).
        }

    rcs on.
    lock steering to srfretrograde. 
    brakes on.
    wait until ship:verticalspeed <-700.
        lock throttle to 1.
        lock aoa to -5.
        lock steering to getSteering().
        toggle ag1.
        toggle ag7.
        rcs off.

    wait until ship:verticalspeed > -200.
        lock throttle to 0.
        lock aoa to 17.5. 
        lock steering to getSteering().
        steeringManager:resettodefault().
        rcs on.

    wait until alt:radar < 12000.
        lock aoa to 10.

    wait until alt:radar < 7000.
        lock aoa to 5.

    WAIT UNTIL ship:verticalspeed < -10. 
        rcs on.
        when impactTime < 2.75 then {gear on.} 

    WAIT UNTIL trueRadar < stopDist. 
        lock throttle to 1.
        lock aoa to -3.
        lock steering to getSteering().

    wait until ship:verticalspeed > -45.
        toggle ag1.
        lock throttle to idealThrottle.
        lock aoa to -2.
        lock steering to getSteering().

    when impactTime < 0.75 then {lock steering to heading(90, 90).}
       
    WAIT UNTIL ship:verticalspeed > -0.1.
        lock steering to up.
        set ship:control:pilotmainthrottle to 0.
        RCS off.

     

    Script 3:

    //This file is distributed under the terms of the MIT license, (c) the KSLib team
    //=====LAUNCH AZIMUTH CALCULATOR=====
    //~~LIB_LAZcalc.ks~~
    //~~Version 2.2~~
    //~~Created by space-is-hard~~
    //~~Updated by TDW89~~
    //~~Auto north/south switch by undercoveryankee~~

    @LAZYGLOBAL OFF.

    FUNCTION LAZcalc_init {
        PARAMETER
            desiredAlt, //Altitude of desired target orbit (in *meters*)
            desiredInc. //Inclination of desired target orbit

        PARAMETER autoNodeEpsilon IS 10. // How many m/s north or south
            // will be needed to cause a north/south switch. Pass zero to disable
            // the feature.
        SET autoNodeEpsilon to ABS(autoNodeEpsilon).
        
        //We'll pull the latitude now so we aren't sampling it multiple times
        LOCAL launchLatitude IS SHIP:LATITUDE.
        
        LOCAL data IS LIST().   // A list is used to store information used by LAZcalc
        
        //Orbital altitude can't be less than sea level
        IF desiredAlt <= 0 {
            PRINT "Target altitude cannot be below sea level".
            SET launchAzimuth TO 1/0.        //Throws error
        }.
        
        //Determines whether we're trying to launch from the ascending or descending node
        LOCAL launchNode TO "Ascending".
        IF desiredInc < 0 {
            SET launchNode TO "Descending".
            
            //We'll make it positive for now and convert to southerly heading later
            SET desiredInc TO ABS(desiredInc).
        }.
        
        //Orbital inclination can't be less than launch latitude or greater than 180 - launch latitude
        IF ABS(launchLatitude) > desiredInc {
            SET desiredInc TO ABS(launchLatitude).
            // HUDTEXT("Inclination impossible from current latitude, setting for lowest possible inclination.", 10, 2, 30, RED, FALSE).
        }.
        
        IF 180 - ABS(launchLatitude) < desiredInc {
            SET desiredInc TO 180 - ABS(launchLatitude).
            // HUDTEXT("Inclination impossible from current latitude, setting for highest possible inclination.", 10, 2, 30, RED, FALSE).
        }.
        
        //Does all the one time calculations and stores them in a list to help reduce the overhead or continuously updating
        LOCAL equatorialVel IS (2 * CONSTANT():Pi * BODY:RADIUS) / BODY:ROTATIONPERIOD.
        LOCAL targetOrbVel IS SQRT(BODY:MU/ (BODY:RADIUS + desiredAlt)).
        data:ADD(desiredInc).       //[0]
        data:ADD(launchLatitude).   //[1]
        data:ADD(equatorialVel).    //[2]
        data:ADD(targetOrbVel).     //[3]
        data:ADD(launchNode).       //[4]
        data:ADD(autoNodeEpsilon).  //[5]
        RETURN data.
    }.

    FUNCTION LAZcalc {
        PARAMETER
            data. //pointer to the list created by LAZcalc_init
        LOCAL inertialAzimuth IS ARCSIN(MAX(MIN(COS(data[0]) / COS(SHIP:LATITUDE), 1), -1)).
        LOCAL VXRot IS data[3] * SIN(inertialAzimuth) - data[2] * COS(data[1]).
        LOCAL VYRot IS data[3] * COS(inertialAzimuth).
        
        // This clamps the result to values between 0 and 360.
        LOCAL Azimuth IS MOD(ARCTAN2(VXRot, VYRot) + 360, 360).

        IF data[5] {
            LOCAL NorthComponent IS VDOT(SHIP:VELOCITY:ORBIT, SHIP:NORTH:VECTOR).
            IF NorthComponent > data[5] {
                SET data[4] TO "Ascending".
            } ELSE IF NorthComponent < -data[5] {
                SET data[4] to "Descending".
            }.
        }.
        
        //Returns northerly azimuth if launching from the ascending node
        IF data[4] = "Ascending" {
            RETURN Azimuth.
            
        //Returns southerly azimuth if launching from the descending node
        } ELSE IF data[4] = "Descending" {
            IF Azimuth <= 90 {
                RETURN 180 - Azimuth.
                
            } ELSE IF Azimuth >= 270 {
                RETURN 540 - Azimuth.
                
            }.
        }.
    }.

  5. 1 hour ago, ImAKerbal said:

    Thanks ill try it, also yes I'm using tundra

    3 hours ago, Cavscout74 said:

    I've never used it but it seems to offer what you are looking for

     

    Thanks for that, it works way better than mech jeb but its still inaccurate sometimes. Is there a better mod out somewhere?

  6. 35 minutes ago, CBase said:

    Actually I did combine Trajectories for better prediction with MechJeb for this in a personal test build. However even Trajectories is not precise enough to really pinpoint the launchpad as good as SpaceX does. With enough aero control surfaces my atmospheric MechJeb landing can compensate for most of it.

    But the final landing is still too tricky: You would need to fine tune a couple of PID controllers for your booster design to land with thrust alone within few meters of your target. Since I am playing with various boosters this was a killer for me, so I stopped pursuing this idea. SpaceX did this for Falcon 9, but are you really willing stay with a single booster after you took 10-20 landings to tune all parameters ?

    Adding a drogue chute helped equally: Easy to control, the booster descends at a rate slow enough to have time for corrections and yet fast enough for aero surfaces to generate enough sideway lift. But now it is not a Falcon 9 style landing anymore.

     

     

    Yes I am willing to stay but I also use rockets such as falcon heavy and starship which come from the same mod the Falcon 9 comes from but I don't want to add any drogue shoots because I want the most realistic Space X landing in ksp.

  7. I don't really know where else to put this in so I put it here. Anyway I was checking some Starship SN8 tutorials and saw that a fairing size 8 was needed for basically every tutorial. When I went to place the fairing I noticed that I don't have a fairing size 8. Anyone one know how to get it or if its a bug? (I am on ksp 1.10.1)

     

  8. I'm doing the tutorial on getting to the Mun part 1. It tells me to place a maneuver node so I do, I also then find where I need to plane the node to get to the Mun, I do. Then it says my burn time will be about 2 minutes and 30 seconds, so I start my burn at 1 minute 15 seconds. The thing is, my Delta V barely goes down and I end up passing the node because my Delta V didn't finish, this is also happening on a science save file I have were im trying to get to Minmus but the maneuver node and Delta V aren't cooperating with me. How do I fix this?

×
×
  • Create New...