sumguytwitches

tarspeed display

Apr 4th, 2022 (edited)
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set cam to addons:camera:flightcamera.
  2. set camflag to false.
  3. wait 1.
  4. set camflag to true.
  5. set cam:mode to "orbital".
  6. lock cx to 0.
  7. set cy to -25.
  8. Set cz to 0.
  9. Set cd to cam:distance.
  10. on time:seconds { set cam:position to (-target:position:normalized*cd)*r(cx,cy,cz). return camflag and target:distance > 200.}
  11.  
  12. lock dv to Round(800 * 9.81 * ln(ship:mass / (ship:mass - (ship:liquidfuel * 0.005))), 5).
  13. lock relvel to ship:velocity:orbit - target:velocity:orbit.
  14. lock tarSpeed to min(target:distance / ((relvel:mag + 10)/(maxthrust/mass)), relvel:mag).
  15. lock tarVel to target:position:normalized * tarSpeed.
  16. lock steering to tarVel - relvel.
  17. lock throttle to choose (steering:mag / (ship:availablethrust/ship:mass))/2 if steering:mag > 0.01 and vang(steering,ship:facing:vector) < 2.5 else 0.
  18.  
  19.  
  20.  
  21. set sgp to 0.
  22. set sggo to true.
  23. set sgf to 8.
  24. set sgpr to 4.
  25. function sgd {
  26. parameter l. parameter d.
  27. If l:length > sgpr set sgpr to l:length.
  28. print (l:padleft(sgpr) + ": " +round(d,2)):padright(terminal:width) at (0, sgp).
  29. set sgp to sgp + 1.
  30. }.
  31. set sggo to false. wait 1. set sggo to true.
  32. On round(kuniverse:realtime * sgf) {
  33. set sgp to 0.
  34. sgd("Tarspeed", tarspeed).
  35. sgd("dv", dv).
  36.  
  37. sgd("Distance", target:distance).
  38. sgd("relvel", relvel:mag).
  39.  
  40. Print "":padright(terminal:width) at (0,sgp).
  41. Set sgp to sgp + 1.
  42. Print "":padright(terminal:width) at (0,sgp).
  43. return sggo.
  44. }
  45.  
Add Comment
Please, Sign In to add comment