Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set sl to 1.
- lock steering to heading(90,90).
- set tgt to ship:geoposition.
- lock tv to tgt:position:normalized * min(10,(tgt:distance/6) ^ 0.85).
- lock steering to heading(90,90).
- set talt to 100.
- set taltpid to pidloop(4, 1, 2, 0, 460).
- lock deploy to max(3,airspeed^0.7).
- lock tilt to max(75,min(90,alt:radar*90/talt)).
- set blades to ship:partsdubbedpattern("blade").
- Set servos to ship:partsdubbedpattern("servo").
- set rotors to ship:partsdubbedpattern("rotor").
- for rotor in rotors rotor:getmodulebyindex(1):setfield("torque limit(%)",100).
- set taltpid:setpoint to talt.
- on talt {set taltpid:setpoint to talt. return true. }
- lock rpmlimit to taltpid:update(time:Seconds, altitude).
- set adjust to true.
- when true then {
- For b in blades b:getmodule("ModuleControlSurface"):setfield("deploy angle",deploy).
- for rotor in rotors rotor:getmodulebyindex(1):setfield("rpm limit",rpmlimit).
- set relVelVec to vxcl(up:vector, tv - velocity:surface) / 3.5.
- set relVelVec:mag to min(sl,relVelVec:mag).
- lock steering to lookdirup(up:vector * 10 + relVelVec, facing:topvector).
- return adjust.
- }
Add Comment
Please, Sign In to add comment