Im having trouble with this. AnotherFireFox put up a post providing a program that (I think) originaly worked for KSP.
I have taken this program and put it all in Vizzy, everything works fine. only that KSP doesnt account for throttle up time, its instant.
But now I have a problem because it takes some to throttle up so the program thinks its time to burn, when in fact, its already to late.
Anyone knows how to fix this problem? I just started with programming in this game a few days ago. If anyone made a suicide burn program or knows a craft with a suicide program in it, I would be happy to look at it see what I can do better.
Thank you!
If you're still interested in making the program tho, take a reference of this craft.
Basic Idea is starting the suicide burn at
DistanceTravel
, adjusting your throttle by comparing AGL andDistanceLeft
, and turning off your engine atDistanceTerminal
. I tested it with the electric engine(almost instant throttle) and gas generator engine(2 seconds thtottle) and they all worked fine.It might crash or not land for the slight error, smaller than few meters. it's because in SR2 height is measured from your craft's CoM and CoM changes as you burn the fuel.