Space Engineers

Space Engineers

Not enough ratings
Stick & Throttle
2
3
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
417.914 KB
2 Dec, 2022 @ 5:48pm
1 Change Note ( view )

Subscribe to download
Stick & Throttle

Description
Configurable Stick and Throttle bindings for your Space Engineers ships.

Pre-requisites

This script requires wolfe_br's SE-AnalogThrottlePlugin[github.com] plugin to deliver stick and throttle events to the game, and cannot function without it. To install the plugin, use the Plugin Loader mod, following its directions to set up launch options.

Setup

Your ship must have a single main cockpit, to use as a reference for the vehicle's orientation. If your ship only has one cockpit, the script will use it. Otherwise, use the terminal options to enable "main cockpit" on exactly one of them. Note that remote control blocks count as cockpits.

Once the plugin is installed and a main cockpit is selected, this script can be installed in a programmable block. It will control thrusters, wheels, gyros, and other features on the same grid as the programmable block only (and will not control anything on attached subgrids).

The programmable block must have the tag
[AnalogThrottle]
in its name. The script will try to add it automatically if it's not present, but if this fails, add it by hand. The plugin uses this tag to route controller inputs.

Bindings are stored in the programmable block's custom data. When installed, if there are no bindings present, the script will initialize itself with a default set of bindings. These bindings are appropriate for the Saitek X-56 HOTAS stick and throttle and the Logitech Warthog throttle (since these are the devices I have handy to test with). Bindings can be customized using the block's custom data.

The script must be recompiled in order for it to detect changes to the bindings or to the grid. Input states will be lost when the script is recompiled, so any ongoing inputs (throttle selections, reversers, and so on) will need to be reapplied by moving the associated control.

Bindings

Bindings are described using the INI format.

  • Each device must be described in its own section. The section name must match the name of the device reported by the AnalogThrottle plugin exactly.
  • Each key under a section describes an axis or button on the device. The value of the key determines what controls the axis or button will be bound to. The key of the axis must match the name of the axis as reported by the plugin exactly.
  • Each axis can also have an optional customization section, to control parameters such as deadzone, sensitivity, or reversing the axis. A customization section's name is the name of the device, a dot, and the name of the axis.

Available Bindings

Name
Type
Description
Forward
Range
Controls forward thrust. Forward and reverse thrusters are cut off at idle, to prevent unintended deceleration.
Forward.Reverse
Held Button
When held, the `Forward` axis instead controls reverse thrust.
Forward.Suppress
Held Button
When held, the `Forward` axis is disconnected, and the thrusters are returned to the game's default controls.
Up
Range
Controls upwards thrust. Upwards and downwards thrusters are cut off at idle.
Up.Reverse
Held Button
When held, the `Up` axis instead controls downward thrusters.
Up.Suppress
Held Button
When held, the `Up` axis is disconnected, and the thrusters are returned to the game's default controls.
Axial
Range
Controls forward and reverse thrust, with thrusters left idle at the midpoint. Thrusters are _not_ cut off at idle; the built-in inertial dampener will kick in unless disabled.
Axial.Suppress
Held Button
When held, the `Axial` axis is set to idle.
Vertical
Range
Controls upwards and downwards thrust, with thrusters left idle at the midpoint. Thrusters are not cut off at idle.
Vertical.Suppress
Held Button
When held, the `Vertical` axis is set to idle.
Lateral
Range
Controls leftwards and rightwards thrust, with thrusters left idle at the midpoint. Thrusters are not cut off at idle.
Lateral.Suppress
Held Button
When held, the `Lateral` axis is set to idle.
Throttle
Range
Controls forward acceleration on wheels.
Throttle.Reverse
Held Button
When held, the `Drive` axis instead controls revese acceleration.
Throttle.Suppress
Held Button
When held, the `Drive` axis is set to idle.
Wheels
Range
Controls forward and reverse acceleration on wheels, with neutral at the idle position.
Wheels.Suppress
Held Button
When held, the `Engine` axis is set to idle.
Steering
Range
Controls left and right turns using the ship's wheels. Wheels must be mounted with their shock absorbers upwards in order for this to function correctly.
Steering.Suppress
Held Button
When held, the `Steering` axis is set to idle.
Roll
Range
Controls counterclockwise and clockwise rotation around the reference block's forward axis.
Pitch
Range
Controls forwards and backwards rotation around the reference block's lateral axis.
Yaw
Range
Controls counterclockwise and clockwise rotation around the reference block's vertical axis.
LinkedYaw
Range
Controls both `Yaw` and `Steering` axes.

Customizing an axis

The following options can be used to customize the behaviour of an axis:

Option
Type
Description
reversed
boolean
Reverses the axis. For buttons, makes them logically held when physically released and vice versa.
deadzone
decimal
Sets the size of the midpoint deadzone, as a proportion of the overall range (0.1 covers 10% of the total range). The deadzone is centered around the midpoint.
lowerDeadzone
decimal
Sets the size of the low-end deadzone, as a proportion of the overall range. The deadzone extends from the end of the controller's range.
upperDeadzone
decimal
Sets the size of the high-end deadzone, as a proportion of the overall range. The deadzone extends from the end of the controller's range.
midpoint
decimal
Adjusts the idle output position of the axis, as a proportion of the overall range. The default midpoint is at 0.5, exactly in the middle of the range.
sensitivity
decimal
Adjusts the sensitivity of the axis. Higher numbers increase the sensitivity near the midpoint; lower numbers decrease it. The mapping is exponential.

Credits

This script would not be possible without the help and inspiration of Digi, wolfe_br, Malware, Whiplash141, ChillCreeper, and (of course) Keen Software House.
13 Comments
MrDefiance 7 Sep, 2024 @ 11:42am 
Inerta dampeners wont work with this when used for directional thrusters, any help with this? At least forwards. Vertical and lateral I got working by setting a deadzone, but forward thrust won't stop when I let go.
Eggmayor 15 Jul, 2024 @ 5:35am 
Could someone tell me how to map the controls for this script?
PFC Morgan [29th Ret.] 31 May, 2024 @ 10:58pm 
How do I get the axis reported by the plugin? I don't know how to reference my slider and not combination of RZ RX whatever works.
AndiStar 17 Feb, 2024 @ 9:59am 
Hi! I'm struggling to setup this with my Logitech X52. could you help me debug?
vincentatienza 8 Dec, 2023 @ 12:38pm 
Hi,
How do I check the name of vJoy device when trying to get the script to recognize vJoy?
I don't know how to check the name the plugin reports the vjoy device as.
Keltskiy 7 Dec, 2023 @ 9:40pm 
@OhtaR I was using this to control an Expanse themed ship using the X-56 Rhino,
did you make sure to install a plugin manager and launch SE via that plugin manager?
Ohtar 22 Jul, 2023 @ 1:48pm 
I did what was said but I can't get it to work. No movement with HOTAS at all. I have X56 pro. Can anyone get it to worked? Please help.
blazemonger 5 Jul, 2023 @ 6:42am 
Would it be possible to get the non minified version of this script? it's good but I have some additional functionality I'd like to add if that is OK.
Luucyf3r 6 Jun, 2023 @ 5:15pm 
Is there any ability to bind buttons on the hotas to key presses or hotbar actions?
Aszinine 2 May, 2023 @ 4:48pm 
I love this script, and should have definitely been in the main game. Though, I do have an issue. For some reason, the inertial dampeners aren't stopping the ship when I release my axial Y axis. It just keeps going. Pretty much any directional thruster does this. It seems the thrusters are being turned off, and not turning back on, so the dampeners do nothing despite being on. Any suggestions?