Advertisement
sumguytwitches

SG-22 Control no servo

Jul 13th, 2022
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //!runscript
  2. fuelcells on.
  3. set tweak to 0.
  4. set steeringmanager:pitchtorquefactor to 0.2.
  5. set steeringmanager:yawtorquefactor to 0.5.
  6. set steeringmanager:rollcontrolanglerange to 180.
  7.  
  8. set propcutout to 99999.
  9. lock deploy to max(3,airspeed^0.7) + tweak.
  10. lock torque to max((100-ship:electriccharge),throttle * 100).
  11. set blades to ship:partsdubbedpattern("fanblade").
  12. set rotors to ship:modulesnamed("ModuleRoboticServoRotor").
  13. //set servos to ship:modulesnamed("ModuleRoboticRotationServo").
  14. //set angle to 0.
  15. set bladeMods to list().
  16. For b in blades {
  17. set bmod to b:getmodule("ModuleControlSurface").
  18. bmod:setfield("deploy", true).
  19. bladeMods:add(bmod).
  20. }
  21.  
  22. set adjust to true.
  23. //lock angle to max(0,min(90,90-alt:radar*10)).
  24. when true then {
  25.  
  26. set deploycopy to deploy.
  27. //set anglecopy to angle.
  28. if airspeed > propcutout {
  29. set torquecopy to 0.
  30. if bays bays off.
  31. } else {
  32. if not bays bays on.
  33. set torquecopy to torque.
  34. }
  35.  
  36.  
  37.  
  38. For b in bladeMods b:setfield("deploy angle", deploycopy).
  39. for rt in rotors rt:setfield("torque limit(%)", torquecopy).
  40. //for s in servos if s:hasfield("target angle") s:setfield("target angle", anglecopy).
  41. return adjust.
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement