1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Copter time - I introduce the script to control copters in SE

Discussion in 'Programming Released Codes' started by conKORD, Feb 15, 2018.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. conKORD

    conKORD Trainee Engineer

    Messages:
    27
    What is copter? Unlike most of the ships in SE copters have only one thrust vector available. And this cause some problems.
    If you need to move forward you cannot just turn on thruster facing backwards. Because you don't have it :) In case of copter you'll need to decrease pitch, wait until copter reach enough velocity and then set pitch to zero. Seems complicated, right?
    If you piloted copter in flightsims you know that it's difficult to land copters on specified location.
    Back to the topic - this script work as smart pilot assistant helping to stabilize copter and hover it in place. In addition - it transforms WASD input to pitch and roll allowing to move in specified direction.

    Script features:
    1) Auto-hover:
    -Set vertical velocity to 0
    -Control pitch and roll to decrease horizontal velocity and hover in place.
    2) Limit pitch and roll to prevent turn over.
    3) Limit pitch and roll assuming thrust/weight ratio. So on max allowed pitch or roll vehicle will have enough thrust to keep altitude.
    4) On press movement key (WASD) vehicle lean towards this direction and start move
    5) Control thrust to keep altitude. When pitch or roll are not 0 - script increase thrust assuming this angle to keep altitude.



    Commands:
    1) toggleMoveForward -if you put something heavy on your "W" key - you'll get same result
    2) togglePreciseMode - limit max pitch and roll. Vehicle will accelerate an deccelerate slower.
    3) toggleGyroControl - shut down gyro override. WASD won't work anymore, but you'll be able to control your copter with mouse or joystick. Thruster control will continue working. Use it if you want to shoot someone.



    Usage:
    1) Past this script into programmable block
    2) Get in your cockpit or remote control
    ...
    Don't forget to land before exiting cockpit. Script will shut down if no one piloting ship.

    PS this script work even with vehicles unstable by design


    Link: https://steamcommunity.com/sharedfiles/filedetails/?id=1302070658
     
    Last edited: Feb 15, 2018
  2. conKORD

    conKORD Trainee Engineer

    Messages:
    27
    Update.
    New command - toggleHoverMode - by default is ON. Vehicle will keep elevation over terrain.


    New safety feature - when script feel that vertical velocity is too high - it will commit suicide burn to prevent crash.
     
Thread Status:
This last post in this thread was made more than 31 days old.