Advertisement
Guest User

Untitled

a guest
Oct 18th, 2015
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. clearscreen.
  2. clearvecdraws().
  3. gear on.
  4. gear off.
  5. sas off.
  6.  
  7. set radius to .7.
  8. set strength to 0.001.
  9.  
  10. set control to ship:control.
  11.  
  12. lock foreVec to SHIP:FACING:VECTOR.
  13. lock starVec to SHIP:FACING:STARVECTOR.
  14. lock topVec to SHIP:FACING:TOPVECTOR.
  15.  
  16. set targHeading to 90.
  17. lock targDir to heading(targHeading, 0).
  18. lock targVec to targDir:VECTOR.
  19. set pTargVec to 0.
  20. lock pTargVec to pTargDir:VECTOR.
  21.  
  22. lock pitchPower to cos(vang(starVec, pTargVec)) * strength.
  23. lock yawPower to -cos(vang(topVec, pTargVec)) * strength.
  24. lock rollPower to cos(vang(foreVec, pTargVec)) * strength.
  25.  
  26. on AG8 {
  27. if targHeading < 315 {
  28. set targHeading to targHeading + 45.
  29. } else {
  30. set targHeading to targHeading - 315.
  31. } preserve.
  32. clearscreen.
  33. }
  34.  
  35. on AG7 {
  36. if targHeading >= 45 {
  37. set targHeading to targHeading - 45.
  38. } else {
  39. set targHeading to targHeading + 315.
  40. } preserve.
  41. clearscreen.
  42. }
  43.  
  44. on AG10 {
  45. if targHeading < 355 {
  46. set targHeading to targHeading + 5.
  47. } else {
  48. set targHeading to targHeading - 355.
  49. } preserve.
  50. clearscreen.
  51. }
  52.  
  53. on AG9 {
  54. if targHeading >= 5 {
  55. set targHeading to targHeading - 5.
  56. } else {
  57. set targHeading to targHeading + 355.
  58. } preserve.
  59. clearscreen.
  60. }
  61.  
  62. on AG5 {
  63. if strength > 0.1 {
  64. set strength to strength - 0.1.
  65. } else {
  66. set strength to 0.01.
  67. } preserve.
  68. clearscreen.
  69. }
  70.  
  71. on AG6 {
  72. if strength < 0.9 {
  73. set strength to strength + 0.1.
  74. } else {
  75. set strength to 1.
  76. } preserve.
  77. clearscreen.
  78. }
  79.  
  80. on AG3 {
  81. if radius > 0.1 {
  82. set radius to radius - 0.1.
  83. } else {
  84. set radius to 0.01.
  85. } preserve.
  86. }
  87.  
  88. on AG4 {
  89. set radius to radius + 0.1.
  90. preserve.
  91. }
  92.  
  93. until gear {
  94. if targHeading > 90 {
  95. set pTargDir to heading(targHeading - 90, 0).
  96. } else {
  97. set pTargDir to heading(targHeading + 270, 0).
  98. }
  99. set targArr to vecDraw(V(0,0,0), targVec, RGB(1,1,1), "Target", radius * 1.2, true).
  100. set velArr to vecDraw(V(0,0,0), VELOCITY:SURFACE, RGB(0.5,0.5,0.5), "Velocity", radius * .3, true).
  101.  
  102. set foreArr to vecDraw(V(0,0,0), foreVec, RGB(1,0.5,0.5), "Fore", radius, true).
  103. set starArr to vecDraw(V(0,0,0), starVec, RGB(0.5,1,0.5), "Star", radius, true).
  104. set topArr to vecDraw(V(0,0,0), topVec, RGB(0.5,0.5,1), "Top", radius, true).
  105.  
  106. print "=== Ball Control System ===" at (0,0).
  107.  
  108. print "Pitch Power: " + round(pitchPower,2) at (1,2).
  109. print "Yaw Power: " + round(yawPower,2) at (1,3).
  110. print "Roll Power: " + round(rollPower,2) at (1,4).
  111.  
  112. print "Target Heading: " + targHeading at (1,6).
  113. print "Degrees from target: " + round(vang(vxcl(UP:VECTOR,VELOCITY:SURFACE),targVec),1) at (1,7).
  114.  
  115. print "Throttle level: " + round(strength,1) at (1,9).
  116.  
  117. print "Gear to disable system" at (1,11).
  118. print "SAS to temporarily override" at (1,12).
  119. print "Use AG3 to decrease arrow size" at (1,13).
  120. print "Use AG4 to increase arrow size" at (1,14).
  121. print "Use AG5 to throttle down" at (1,15).
  122. print "Use AG6 to throttle up" at (1,16).
  123. print "Use AG7 for -45 heading" at (1,17).
  124. print "Use AG8 for +45 heading" at (1,18).
  125. print "Use AG9 for -5 heading" at (1,19).
  126. print "Use AG10 for +5 heading" at (1,20).
  127.  
  128.  
  129. set control:pitch to pitchPower.
  130. set control:yaw to yawPower.
  131. set control:roll to rollPower.
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement