Jump to content

Ev1I_

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by Ev1I_

  1. 6 hours ago, MrSystems said:

    I don't know how to answer the specific question you asked, but I do know how to use KOS to get a ship into orbit.

    First, why are you using multiple kOS processors when just one (on the upper stage) would work fine?

    Second, I think KSP treats a vessel as a single vessel when it's joined together, so forcesetactivevessel might not work.

    Third, it's easier if you can put all your "steps" in one file, and make use of the WAIT UNTIL control before the next step happens.  As in:

    
    DECLARE FUNCTION launch {
      // some code goes here
    }
    DECLARE FUNCTION orbit {
      // some code goes here
    }
    
    launch.
    WAIT UNTIL ALTITUDE > 70000.
    orbit.

    Or you could make them run sequentially like:

    
    set launching_is_done to FALSE.
    DECLARE FUNCTION launch {
      // some code goes here
      return(TRUE).
    }
    DECLARE FUNCTION orbit {
      // some code goes here
    }
    
    WAIT UNTIL launch. // won't proceed until the last line of launch is executed, which returns TRUE
    orbit.

    My kOS launching code is set up like:

    
    DECLARE some_constants.
    DECLARE some_logging_functions.
    WHEN ALTITUDE > 70000 then { stage fairings, etc. } // this won't trigger until much later
    SET some_steering_parameters.
    LOCK steering to some_steering_parameters.
    stage. // launches ship
    WHEN stage:liquidfuel < 0.1 THEN { 
                               stage. 
                               and do some other things. 
                               PRESERVE. // allows the WHEN to repeat next time youre out of fuel
                               }
    WHEN ALTITUDE > 25000 THEN { lock steering to different_steering_parameters. }
    WAIT UNTIL APOAPSIS > target_apoapsis.
    set throttle to 0.
    unlock steering.
    run circularize_high // a different file that creates a maneuver node for circularization burn
    run burnnode // a different file that executes the next maneuver node
    // end of file; the real version is about 450 lines long, not counting circularize_high and burnnode

     

    Yeh I know how to get to orbit with single processor and script. But I want land my booster back to Earth/Kerbin, and here's the catch. 

  2. I want make my scrip to perform actions depend on ship name. When rocket is on launch pad  I programing lower kos processor with kos tag "Booster" to perform for example step "launch", then when its staging, using command "kuniverse:forcesetactivevessel" I wanna switch to Upper Stage of my rocket with kos processor tag "UpperStage"  and make him run step "Orbit", with construction like this:

    "if Ship("Booster") {

    runstep ("launch")"

    }

    "if Ship("UpperStage") {

    runstep ("Orbit")"

    }

    Can someone help please?

    Thanks 

     

     

  3. Got a problem with flacon heavy script, its saying "Cannot find sensor for ACC", and sending to this lines of script:

    SET vertAcc TO sProj(SHIP:SENSORS:ACC, UP:VECTOR).
        SET dragAcc TO g + vertAcc. //vertical acceleration due to drag. Same as g at terminal velocity

    What is ACC, and how to fix this error ?

    KSP version 1.5.1 (macOS), and latest kos. 

    P. S. Its not my script I just download it so don't be very mad for my stupidness. 

     

×
×
  • Create New...