Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clearscreen.
- clearvecdraws().
- gear on.
- gear off.
- sas off.
- set radius to .7.
- set strength to 0.001.
- set control to ship:control.
- lock foreVec to SHIP:FACING:VECTOR.
- lock starVec to SHIP:FACING:STARVECTOR.
- lock topVec to SHIP:FACING:TOPVECTOR.
- set targHeading to 90.
- lock targDir to heading(targHeading, 0).
- lock targVec to targDir:VECTOR.
- set pTargVec to 0.
- lock pTargVec to pTargDir:VECTOR.
- lock pitchPower to cos(vang(starVec, pTargVec)) * strength.
- lock yawPower to -cos(vang(topVec, pTargVec)) * strength.
- lock rollPower to cos(vang(foreVec, pTargVec)) * strength.
- on AG8 {
- if targHeading < 315 {
- set targHeading to targHeading + 45.
- } else {
- set targHeading to targHeading - 315.
- } preserve.
- clearscreen.
- }
- on AG7 {
- if targHeading >= 45 {
- set targHeading to targHeading - 45.
- } else {
- set targHeading to targHeading + 315.
- } preserve.
- clearscreen.
- }
- on AG10 {
- if targHeading < 355 {
- set targHeading to targHeading + 5.
- } else {
- set targHeading to targHeading - 355.
- } preserve.
- clearscreen.
- }
- on AG9 {
- if targHeading >= 5 {
- set targHeading to targHeading - 5.
- } else {
- set targHeading to targHeading + 355.
- } preserve.
- clearscreen.
- }
- on AG5 {
- if strength > 0.1 {
- set strength to strength - 0.1.
- } else {
- set strength to 0.01.
- } preserve.
- clearscreen.
- }
- on AG6 {
- if strength < 0.9 {
- set strength to strength + 0.1.
- } else {
- set strength to 1.
- } preserve.
- clearscreen.
- }
- on AG3 {
- if radius > 0.1 {
- set radius to radius - 0.1.
- } else {
- set radius to 0.01.
- } preserve.
- }
- on AG4 {
- set radius to radius + 0.1.
- preserve.
- }
- until gear {
- if targHeading > 90 {
- set pTargDir to heading(targHeading - 90, 0).
- } else {
- set pTargDir to heading(targHeading + 270, 0).
- }
- set targArr to vecDraw(V(0,0,0), targVec, RGB(1,1,1), "Target", radius * 1.2, true).
- set velArr to vecDraw(V(0,0,0), VELOCITY:SURFACE, RGB(0.5,0.5,0.5), "Velocity", radius * .3, true).
- set foreArr to vecDraw(V(0,0,0), foreVec, RGB(1,0.5,0.5), "Fore", radius, true).
- set starArr to vecDraw(V(0,0,0), starVec, RGB(0.5,1,0.5), "Star", radius, true).
- set topArr to vecDraw(V(0,0,0), topVec, RGB(0.5,0.5,1), "Top", radius, true).
- print "=== Ball Control System ===" at (0,0).
- print "Pitch Power: " + round(pitchPower,2) at (1,2).
- print "Yaw Power: " + round(yawPower,2) at (1,3).
- print "Roll Power: " + round(rollPower,2) at (1,4).
- print "Target Heading: " + targHeading at (1,6).
- print "Degrees from target: " + round(vang(vxcl(UP:VECTOR,VELOCITY:SURFACE),targVec),1) at (1,7).
- print "Throttle level: " + round(strength,1) at (1,9).
- print "Gear to disable system" at (1,11).
- print "SAS to temporarily override" at (1,12).
- print "Use AG3 to decrease arrow size" at (1,13).
- print "Use AG4 to increase arrow size" at (1,14).
- print "Use AG5 to throttle down" at (1,15).
- print "Use AG6 to throttle up" at (1,16).
- print "Use AG7 for -45 heading" at (1,17).
- print "Use AG8 for +45 heading" at (1,18).
- print "Use AG9 for -5 heading" at (1,19).
- print "Use AG10 for +5 heading" at (1,20).
- set control:pitch to pitchPower.
- set control:yaw to yawPower.
- set control:roll to rollPower.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement