Space Engineers

Space Engineers

Wheels manager
 This topic has been pinned, so it's probably important
I.C.E.  [developer] 22 Aug, 2016 @ 7:07am
How do I ...?
Feel free to ask your questions here. Workshop comments aren't the best place to discuss scritp mechanics, for they have onle 1000 symbols allowed.


On request, posting all options from script caption here
/*
This script is intended to dynamically control your rover's wheels' max steering angle according to your current speed.
It contains several driving profiles and allows you enable/disable features like downforce thrusters or rear wheels steering, by selecting appropriate profile.
Instructions:

1. You will need one programmable block, one timer, at least one block group with wheels (ONLY WHEELS, nothing else!).
1a. Optional: Another group with wheels (ONLY WHEELS, nothing else!), which will be treated as rear wheels and controlled accordingly.
1b. Optional: Group with OVERRIDED Thrusters (ONLY THRUSTERS, nothing else!), pointed downwards for extra downforce. They will be enabled if Race profile is active.
1c. Optional: One LCD/Text panel that will display your rover status.
2. Set the timer to run this script with empty Argument. Also set the time to START itself and to TRIGGER_NOW itself. You need this scrip restarted really fast. Do not start the timer yet!
3. Go to basic options below and set them according to your preferences.
3a. Optional: Adjust advanced options below.
4. Set several actions at your cockpit:
Run this script with "Parking" (no "" needed) argument. Case insensitive. - It will set your rover to "Parking" mode.
Run this script with "Slow" (no "" needed) argument. Case insensitive. - It will set your rover to "Slow" mode.
Run this script with "Normal" (no "" needed) argument. Case insensitive. - It will set your rover to "Normal" mode.
Run this script with "Race" (no "" needed) argument. Case insensitive. - It will set your rover to "Race" mode. It's the only mode with downforce thrusters enabled!
4a. Optional: Instead of step 4 (or even with it) set 2 actions at your cockpit:
Run this script with "GearUp" (no "" needed) argument. Case insensitive. - It will "shift the gear Up" and switch your rover to the Next mode, like from Parking to Slow, from Slow to Normal and so on.
Run this script with "GearDown" (no "" needed) argument. Case insensitive. - As previous one but vice versa.
5. Trigger your timer, so the script will start.
6. Drive around to check if you like the behaviour of the rover and adjust options if needed.

Basic options are mandatory, make sure to set them properly before using the script!

Basic options beyond this point. You PROBABLY want to edit them. Advanced options are further below.
=====================================================================================================
*/

//Block and group naming
string GroupName = "Wheels - Steering"; //Your lead wheels GROUP name. Must be EXACT NAME of the group. Case sensitive.
string GroupNameBack = "Wheels - Rear"; //Your rear wheels GROUP name. Must be EXACT NAME of the group. Case sensitive. Optional if RearSteer set to false.
string GroupNameAll = "Wheels - All"; //Your GROUP, that contain ALL rover's wheels. Must be EXACT NAME of the group. Case sensitive. Mandatory.
string ThrustersDownName = "Thrusters - Down"; //Your OVERRIDED thrusters for additional downforce GROUP name. Must be EXACT NAME of the group. Case sensitive. Optional if DownforceThrusters set to false.
string LCDNamePrefix = "[LCD Steer]"; //Your information display name PREFIX. Actual name should START with it. Case sensitive. Optional if UseLCD set to false.

//Custom GROUPS of blocks, that will be enabled/disabled when you change drive modes. To disable group usage: set the group name to "" (quotes with nothing between them. Not even a space! Nothing.)
string GroupParkingName = ""; //Your block GROUP to be enabled when you activate parking mode. Will be DISABLED when you select another drive mode!
string GroupSlowName = ""; //Your block GROUP to be enabled when you activate slow mode. Will be DISABLED when you select another drive mode!
string GroupNormalName = ""; //Your block GROUP to be enabled when you activate normal mode. Will be DISABLED when you select another drive mode!
string GroupRaceName = ""; //Your block GROUP to be enabled when you activate race mode. Will be DISABLED when you select another drive mode!

//General options
bool RearSteer = true; //Set to true to enable rear wheels steering in parking mode.
bool RearSteerOnSlow = false; //Set to true if you want your rear wheels to have steering enabled in Slow mode.
bool DynamicRearSteer = true; //Set to true if you want script to control rear wheels steering angle dynamically. Will only work if previous set to true! Rear steering will still be disabled in Race mode!
bool DownforceThrusters = true; //Determines if the script will try to use thrusters for additional downforce.
bool UseLCD = true; //Determines if the script will use LCD or Text screen to provide you with it's current status.

//Speed settings for different drive modes
bool IgnoreSpeed = false; //If set to true script will not manage max speed of your rover.
string MaxSpeedParking = "12"; //Max speed in kilometers per hour for parking mode. Should be low.
string MaxSpeedSlow = "30"; //Max speed in kilometers per hour for slow mode.
string MaxSpeedNormal = "80"; //Max speed in kilometers per hour for normal mode.
string MaxSpeedRace = "130"; //Max speed in kilometers per hour for race mode. Set to 360 for UNLIMITED.

//Steering angle presets editing is optional.
double AngleMax = 25; //Maximum steering angle for your rover.
double AngleMin = 5; //Minumum normal steering angle for your rover.
double AngleSuperMin = 3; //Super minimum angle. Intended for hight speed travel only.

//Very same for rear wheels. Optional.
double RAngleMax = 15; //Maximum steering angle for your rover's rear wheels. Will only work in certain drive modes and only if rear steering enabled.
double RAngleMin = 5; //Minumum normal steering angle for your rover's rear wheels. Will only work in certain drive modes and only if rear steering enabled.
double RAngleSuperMin = 0; //Super minimum angle. Intended for hight speed travel only. Set to 0 by default, because rear steering at hight speed is SUPER UNSAFE! You can set it above 0 if you dare.

//Speed presets editing is optional
double VelocityMin = 20; //Below this speed your steering angle will be maxed
double VelocityMax = 60; //Above this speed your steering angle will be locked to minimum
double VelocitySuperMax = 100; //Above this speed your steering angle will be locked to super minumum.




/*
Advanced options beyond this point. Settings below will allow you to adjust your drivetrain according to driving profile.
===================================================================================================================
*/

//Wheels settings for different modes. Everything ignored by default.
bool IgnorePower = false; //If the script should ignore power settings. It will not alter your wheels power settings if set to true.
string PowerParking = "70"; //Wheels power to be used in Parking mode. Between "0" and "100".
string PowerSlow = "20"; //Wheels power to be used in Slow mode. Between "0" and "100".
string PowerNormal = "30"; //Wheels power to be used in Normal mode. Between "0" and "100".
string PowerRace = "40"; //Wheels power to be used in Race mode. Between "0" and "100".
bool IgnoreFriction = true; //If the script should ignore friction settings. It will not alter your wheels friction settings if set to true.
string FrictionParking = "80"; //Wheels friction setting to be used in Parking mode. Between "0" and "100".
string FrictionSlow = "70"; //Wheels friction setting to be used in Slow mode. Between "0" and "100".
string FrictionNormal = "60"; //Wheels friction setting to be used in Normal mode. Between "0" and "100".
string FrictionRace = "60"; //Wheels friction setting to be used in Race mode. Between "0" and "100".
bool IgnoreStrength = false; //If the script should ignore strength settings. It will not alter your wheels strength settings if set to true.
string StrengthParking = "17"; //Wheels strength setting to be used in Parking mode. Between "0" and "100".
string StrengthSlow = "25"; //Wheels strength setting to be used in Slow mode. Between "0" and "100".
string StrengthNormal = "20"; //Wheels strength setting to be used in Normal mode. Between "0" and "100".
string StrengthRace = "25"; //Wheels strength setting to be used in Race mode. Between "0" and "100".
bool IgnoreHeight = true; //If the script should ignore height settings. It will not alter your wheels height settings if set to true.
string HeightParking = "-0.32"; //Drive height setting to be used in Parking mode. Check your wheels to find min and max.
string HeightSlow = "-0.32"; //Drive height setting to be used in Slow mode. Check your wheels to find min and max.
string HeightNormal = "-0.32"; //Drive height setting to be used in Normal mode. Check your wheels to find min and max.
string HeightRace = "-0.32"; //Drive height setting to be used in Race mode. Check your wheels to find min and max.
bool IgnoreTravel = true; //If the script should ignore travel settings. It will not alter your wheels travel settings if set to true.
string TravelParking = "90"; //Wheels suspension travel setting to be used in Parking mode. Between "0" and "100".
string TravelSlow = "90"; //Wheels suspension travel setting to be used in Slow mode. Between "0" and "100".
string TravelNormal = "90"; //Wheels suspension travel setting to be used in Normal mode. Between "0" and "100".
string TravelRace = "90"; //Wheels suspension travel setting to be used in Race mode. Between "0" and "100".
//It seems that damping has been removed from wheels settings. Option below is depricated
bool IgnoreDamping = true; //If the script should ignore damping settings. It will not alter your wheels damping settings if set to true.
string DampingParking = "30"; //Wheels damping setting to be used in Parking mode. Between "0" and "100".
string DampingSlow = "50"; //Wheels damping setting to be used in Slow mode. Between "0" and "100".
string DampingNormal = "80"; //Wheels damping setting to be used in Normal mode. Between "0" and "100".
string DampingRace = "80"; //Wheels damping setting to be used in Race mode. Between "0" and "100".
Last edited by I.C.E.; 27 Mar, 2018 @ 5:50am
< >
Showing 1-7 of 7 comments
Gorodoff-BE 4 Sep, 2016 @ 9:08pm 
hello, great script, works fine for 4 wheels cars/trucks, gave it a tumb up

But now, how do I use it on a 8 wheels light tank?
I need different turn angles for mid wheels compared to fore and aft wheels to have it turn smoothly
I.C.E.  [developer] 5 Sep, 2016 @ 2:40am 
Originally posted by gorodoff:
hello, great script, works fine for 4 wheels cars/trucks, gave it a tumb up

But now, how do I use it on a 8 wheels light tank?
I need different turn angles for mid wheels compared to fore and aft wheels to have it turn smoothly

I only used it with 4 and 6 wheels scheme. With more pairs - you're right it needs more angles. I'll look into it later and update the script.

So far I can only think about more groups Second front (rear) pair with leading pair's angles devided by 2, third pair with second angles devided, and so on.
Gorodoff-BE 5 Sep, 2016 @ 6:03am 
thanks for the quick reply, I dont see another solution either
maybe examining the distance between two pairs of wheels to calculate the dividing factor but that implies grouping wheels per pairs and analysing the vehicule grid to locate them on it... might be a little bit heavy :steamhappy: not to talk of the maths to keep wheels tangent to the turning circle path running thru them
Last edited by Gorodoff-BE; 5 Sep, 2016 @ 6:11am
I.C.E.  [developer] 5 Sep, 2016 @ 7:24am 
@gorodoff
In the mean time - you can use nested script to control your rover. E.g. one script will control everything and front/rear wheels steering and another one with all options disabled will control second pairs with angles you set.
Gorodoff-BE 5 Sep, 2016 @ 1:35pm 
ok, thanks
game plays 1230 4 Dec, 2016 @ 2:32pm 
how do i set it up with 6 wheels
I.C.E.  [developer] 4 Dec, 2016 @ 3:11pm 
@game plays 123

For 6 wheels setup you just place your middle pair in a proper group (or rather not place them into group you don't want them to be in). Like... add them to All wheels, but don't add to either front or rear wheels. They will follow traction settings and ignore steering.
< >
Showing 1-7 of 7 comments
Per page: 1530 50