Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- core:doevent("open terminal").
- wait 4.
- brakes on.
- wait 1.
- lock torque to 0.
- when vang(sun:position, up:vector) < 10 then {
- set warp to 0.
- brakes off.
- steeringmanager:resetpids().
- wait 1.
- lock torque to max((100-ship:electriccharge),throttle * 100).
- }
- set warpmode to "rails". set warp to 5.
- set steeringmanager:pitchtorquefactor to 0.2.
- set steeringmanager:yawtorquefactor to 0.5.
- set steeringmanager:rollcontrolanglerange to 180.
- set blades to ship:partsdubbedpattern("blade").
- set rotors to ship:modulesnamed("ModuleRoboticServoRotor").
- set proprad to 5.8.
- set aoatopressure to 9.//4.387475597 / body:atm:altitudepressure(4997).
- set taralt to 5.
- set taraoa to 3.333.
- lock relativeAirspeed to airspeed.
- lock deploy to taraoa + arctan(relativeAirspeed/(2 * constant:pi * proprad * 459/60)).
- set bladeMods to list().
- For b in blades {
- set bmod to b:getmodule("ModuleControlSurface").
- bmod:setfield("deploy", true).
- bladeMods:add(bmod).
- }
- lock mach to sqrt(2 / 1.4 * ship:q / body:atm:altitudepressure(altitude)).
- set x to 90.
- lock p to min(15,max(-3, -verticalSpeed*1.7 + (taralt - alt:radar)/2.5)).
- lock steering to heading(x,p).
- lock throttle to 1.
- when verticalSpeed > 1 or airspeed > 200 then gear off.
- when true then {
- set torquecopy to torque.
- set deploycopy to deploy.
- for rt in rotors rt:setfield("torque limit(%)", torquecopy).
- For b in bladeMods b:setfield("deploy angle", deploycopy).
- return true.
- }
- set sgp to 0.
- set sggo to true.
- set sgf to 8.
- set sgpr to 4.
- function sgd {
- parameter l. parameter d.
- If l:length > sgpr set sgpr to l:length.
- print (l:padleft(sgpr) + ": " +round(d,2)):padright(terminal:width) at (0, sgp).
- set sgp to sgp + 1.
- }.
- set sggo to false. wait 0. set sggo to true.
- On round(kuniverse:realtime * sgf) {
- set sgp to 0.
- sgd("torque", torque).
- sgd("deploy", deploy).
- sgd("Verticalspeed", verticalspeed).
- sgd("target aoa",taraoa).
- sgd("altitude",altitude).
- sgd("airspeed", airspeed).
- sgd("aoa", vang(ship:facing:vector,ship:velocity:surface)).
- sgd("mach", mach).
- sgd("EC", ship:electriccharge).
- Print "":padright(terminal:width) at (0,sgp).
- Set sgp to sgp + 1.
- Print "":padright(terminal:width) at (0,sgp).
- return sggo.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement