Merlin of Mines - Space Engineers

A set of useful scripts for aspiring Space Engineers!

View on GitHub

Wheel Suspension Block Handler

This Block Handler handles Wheel Suspension (not wheels directly, but still controls them). It can control most properties of Wheel Suspension including auto steering & propulsion (anyone else thinking remote control rovers??).

Default Primitive Properties:

Default Directional Properties

“Enabled” Property

Enables or Disables the given block

#Enable Block
enable "My Wheel"
set "My Wheel" to enabled
turn on "My Wheel"

#Disable Block
disable "My Wheel"
set "My Wheel" to disabled
turn off "My Wheel"

“Height” Property

Get/Sets the Wheel Height, in meters.

Print "Wheel Height: " + "My Wheel" height

set "My Wheel" height to 0.5

“Angle” Property

Gets/Sets the Wheel steering angle. Values for this property range from -45 (Left) to 45 (Right), with 0 = Straight Forward.

Setting this property to a specific angle will set the maximum steering angle to 100% and then set the steering override such that the wheel angle is the one you requested (between -45 and 45)

Print "Steering Angle" + "My Wheel" angle

#Turn left
set "My Wheel" angle to -45

#Straight
set "My Wheel" angle to 0

#Turn Right
set "My Wheel" angle to 45

“Velocity” Property

Gets/Sets the Propulsion Override (used to drive by itself). Values for this property are between -1 and 1, with -1 = 100% reverse, 0 = stopped, and 1 = 100% forward.

Print "Propulsion Override: " + "My Wheel" velocity

#Forward
set "My Wheel" velocity to 1

#Stop
set "My Wheel" velocity to 0

#Backward
set "My Wheel" velocity to -1

“Speed Limit” Property

Gets/Sets the Speed Limit of the wheels in km/h.

Print "Speed Limit" + "My Wheel" speed limit

#50 m/s Speed Limit
set "My Wheel" speed limit to 50

“Velocity Override” Property

Gets/Sets the propulsion override of the given wheel(s), as a value from -1 to 1.

Print "Propulsion Override: " + "My Wheel" velocity override

set "My Wheel" velocity override to 0.5

“Steering” Property

Gets/Sets whether steering is enabled on the selected wheel(s).

Print "Steering Enabled: " + "My Wheel" steering is on

turn off "My Wheel" steering

“Steering Limit” Property

Sets the Maximum Steer Angle (which affects both left & right equally). Expected values are between 0 - 1 (0 = no steering, 1 = maximum steering)

Print "Steering Limit: " + "My Wheel" steering limit

#Only steering turning up to 50%
set "My Wheel" steering limit to 0.5

“Steering Override” Property

Gets/Sets the Steering Override, as a value from -1 to 1

Print "Steering Override: " + "My Wheel" steering override

set "My Wheel" steering override to -0.5

“Locked” Property

Gets/Sets whether the wheel responds when you hit the brakes. This does not turn on the brakes by itself! To automatically brake you’ll need to use a Cockpit.

if "My Wheel" brake is off
  Print "Someone disconnected the brakes!"

#Wheel will respond to braking
turn on "My Wheel" brake

“Strength” Property

Gets/Sets the strength of the wheels. Values are between 0 - 100, with 100 being the highest strength. Higher strength values keep the wheel suspension higher off the ground under heavy loads.

Print "Wheel Strength: " + "My Wheel" strength

#50% strength
set "My Wheel" strength to 50

“Power” Property

Gets/Sets the Wheel Power. Values are between 0 - 100, with 100 = Max Power.

Print "Wheel Power: " + "My Wheel" power

#50% power
set "My Wheel" power to 50

“Ratio” Property

Gets/Sets the Wheel’s Friction, as a ratio between 0 - 100. 100 = 100% Friction. Higher friction values will give the wheel more traction.

Print "Wheel Friction: " + "My Wheel" ratio

#Set Friction to 50%
set "My Wheel" ratio to 50

“Attached” Property

Get/Set true wether there is a wheel attached to the suspension. Attaching a wheel that is not placed right might invoke the almighty Clang.

if "My Wheel" is detached
  Print "Something stole my Wheel!"

detach "My Wheel"
attach "My Wheel"