Jump to content

How do i determine surface velocity in KOS. NOTHING WORKS IT IS SO FRUSTRATING


Recommended Posts

I am trying to start the gravity turn when the velocity of the ship is greater than 98. Look at this and tell me whats wrong

sas off.
rcs on.
gears off.
lights off.

set targetvelocity to 98.
set runmode to 1.

until runmode = 0 {

 if runmode = 1 {
  lock throttle to 1.
  lock steering to up.
  stage.
  if ship:GROUNDSPEED > targetvelocity {
   set runmode to 2.
   }
 }

 else if runmode = 2 {
  lock steering to up (90,85).
  until ship:altitude = 5000.
  lock steering to up (90,75).
  set runmode to 0.
  }
 }

it's spams the stage action group straight away when i start the program, it's wasting my rocket! 

 

please help me!

Link to comment
Share on other sites

11 hours ago, Chocolat Oreos said:

I am trying to start the gravity turn when the velocity of the ship is greater than 98. Look at this and tell me whats wrong

sas off.
rcs on.
gears off.
lights off.

set targetvelocity to 98.
set runmode to 1.

until runmode = 0 {

 if runmode = 1 {
  lock throttle to 1.
  lock steering to up.
  stage.
  if ship:GROUNDSPEED > targetvelocity {
   set runmode to 2.
   }
 }

 else if runmode = 2 {
  lock steering to up (90,85).
  until ship:altitude = 5000.
  lock steering to up (90,75).
  set runmode to 0.
  }
 }

it's spams the stage action group straight away when i start the program, it's wasting my rocket! 

 

please help me!

The complaint in the title of this thread has nothing to do with the complaint in the body of the message.

Which is it?  Is it that you can't get the surface velocity or that it stages again and again?  They've got nothing to do with each other.

It stages repeatedly on the launchpad because your script told it to.  It starts in runmode=1, and in runmode=1 each iteration it will execute the stage command unconditionally, outside of the if-check for groundspeed.

 

Link to comment
Share on other sites

Runmode starts at 1 and you get into the loop. In the loop you stage when runmode is 1 and switch to runmode = 2 only when the groundspeed is high enough. So what you actually wrote is : "stage until the ground velocity is superior to targetvelocity"

 

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...