Space Engineers

Space Engineers

SWCS | Whip's Subgrid Wheel Control Script
527 Comments
A 21st Century Gentleman Dec 13 @ 10:07am 
It is frankly silly that there is no way to pass things through from a subgrid to the main grid. God forbid I want my mobile base to have a more adjustable suspension than the paltry amount offered by the ingame suspension blocks.
DudewithPizza Dec 13 @ 12:54am 
I ran into this same issue, I believe the cause was the wheel(s) you have on the main grid need to have braking enabled. They don't have to be turned on, just have braking enabled.
Whiplash141  [author] Nov 20 @ 3:16pm 
if you have a wheel on the main grid, you can just use the parking brake via the ship controller like usual
Ubermensch Nov 20 @ 3:15pm 
I have a wheel suspension on the main grid that I use for another purpose, and because of this, brake_on doesn’t work. Is there a way to fix this? I added an 'Ignore' tag to this wheel, but it didn’t solve the problem. I don’t have a handbrake right now.
Whiplash141  [author] Oct 19 @ 3:38am 
@ALEGATOR2222
stabilization of what?

@MarzEz
It is possible to add, I just need to have some time (and energy) to do it
ALEGATOR2222 Oct 18 @ 9:34pm 
Can you tell me if there is a script for directional and lateral stabilization?
MarzEz Sep 5 @ 6:57pm 
Is there a way to get this script to reference a remote control block or programmable block as the "forward" position?
I have built a mobile slewing crane, but when the cab rotates, steering and drive of the wheels fight each other. I have a remote control block to enable use of the handbrake, if there's any code I can change or any way to use the position/orientation of that block to determine forward/left/right, that would be exquisite.
Whiplash141  [author] Aug 14 @ 4:19am 
the script controls all subgrids that it sees. How are your subgrids connected to eachother?
Alexis The Calico Yokai Aug 13 @ 11:31pm 
I'm making a monorail and it has 2 subgrids and the script is one only controlling one of the subgrids. is there a way to get it to control both?
Killer66 Aug 9 @ 2:44pm 
You are a god! Thank you, now I can realize all my engineer fantasies!
Whiplash141  [author] Jul 8 @ 2:48pm 
Scripts are vanilla; however, I don't know anything about subgrid control without scripts.
►relaxxx◄ Jul 8 @ 9:32am 
This is a feature we have been dying for for ages, and Keen has finally allowed this control in the new MP update :D
Does it mean I can somehow make it in vanila without this script? (Without scripts at all to be clear)
Grebanton1234 Jun 28 @ 1:22pm 
Thank you very much!
Whiplash141  [author] Jun 28 @ 12:27pm 
You can use my scripts however you want, I don't even need attribution since that lives in the script itself. If you create derivative work (like modifying the actual script), I only ask for attribution and a clear indication that the work is not officially supported by me.
Grebanton1234 Jun 27 @ 11:46am 
Hey there, may I use your script for the current research bunker competition? I think legally I have to ask you for permission because I think by submitting the build I give Keen the right to use it how they want to.
godsshadow755 Oct 3, 2024 @ 1:53am 
ok i got it had to put the arguments in custom data then toobar the run PB Argument Brake_toggle, then everything started working right
godsshadow755 Oct 3, 2024 @ 1:39am 
where do i put the arguments do i put it in the custom data of the cockpit or the program block itself?
Whiplash141  [author] Oct 2, 2024 @ 11:47pm 
have you read the entire "How the heck does braking work" section above?
godsshadow755 Oct 2, 2024 @ 11:03pm 
cant seem to get the braking to work on sub grids, I put that argument in the cockpit but I cant turn brakes on
OVERLORDTHOR Sep 23, 2024 @ 10:45pm 
Is there a way to get this working with remote control?
Whiplash141  [author] Jul 20, 2024 @ 11:30pm 
Sounds like the wheels are friction binding. Experiment with friction and steer angles
Eliree Jul 20, 2024 @ 8:16am 
Fot some weird reason , my rover instantly brakes when i turn the wheels , any idea what this could be ?
Into May 20, 2024 @ 9:26am 
My cockpit changes direction, how do I ensure that forward stays forward and doesn't change with cockpit direction?
E-Man720 Mar 14, 2024 @ 8:47pm 
This gets asked monthly I swear. It's not a mod, that's why it doesn't show in mods. It's a ingame script.
Poutine Mar 14, 2024 @ 1:45pm 
For some reason, I can't find this mod in my modlist? Am I a moron or am I just blind? https://i.imgur.com/RqOS3iP.jpeg https://i.imgur.com/a2pa8No.jpeg
Raven Feb 18, 2024 @ 10:53pm 
@Whiplash141 appreciate you lookin into it! That makes sense. The same rough setup seemed to work when I tested on a single grid so I hadn't thought about the steering angle.
Whiplash141  [author] Feb 18, 2024 @ 10:18pm 
I got decent behavior by simply disabling steering on the 4 central wheels.
Whiplash141  [author] Feb 18, 2024 @ 10:13pm 
Checked the grid and the script is doing what it is told. The issue seems to be the very aggressive turning angles. You generally don't want (1) all wheels steering or (2) all wheels steering with the same angle. You want them to steer about a convergence point where the outer wheels steer the most aggressively, and the center wheels steer less aggressively.
Raven Feb 18, 2024 @ 2:17pm 
@Whiplash141 Yeah no problem, here: Link
Whiplash141  [author] Feb 18, 2024 @ 8:52am 
I haven't heard any reports like this, no. Got a blueprint I can look at?
Raven Feb 17, 2024 @ 9:47pm 
Having some trouble with this script on a rover. Currently it seems like some wheels lock up and stop applying propulsion when steering and accelerating at low speeds (e.g. holding 'W' and 'A' at the same time), easiest to reproduce when accelerating from a standstill, but hard to guarantee which wheel, or when.

Another issue had the script not drive forward at all, steering control was still fully functional, but neither 'W' nor 'S' would drive anywhere - though it *would* raise the power usage displayed on the HUD. It's like the wheels were fighting each other or something? And no, the parking brake was not engaged :P I cycled it several times while trying to get it to budge, just to be sure.

Have any issues like this been reported before? I'm using a mechanical suspension system so there are a lot of subgrids - three per wheel suspension, plus the 'main' grid, and all joining points use two blocks. Maybe the complexity of the grid connectivity is complicating/confusing things?
Whiplash141  [author] Feb 17, 2024 @ 8:56am 
Just mark one as main
REB Feb 17, 2024 @ 8:05am 
Please add way to prefer/ignore the ship controller, similar to your thruster subgrid control script, as a quick fix I modified the script to have an INI entry to ignore an specific ship controller like this

else if (block is IMyShipController)
{
if (!StringExtensions.Contains(block.CustomName, controllerIgnoreNameTag))
{
shipControllers.Add((IMyShipController)block);
}
}
Whiplash141  [author] Feb 8, 2024 @ 1:40pm 
The way to get perfect braking as enumerated above is to add a ship controller on the same subgrid as the wheels for brake toggling. Otherwise, the script does its best to approximate brakes. You can configure how aggressive the brake approximation is with the "Braking constant" config key in custom data.
Stoner Jezus Feb 8, 2024 @ 11:48am 
both parking brake and handbrake only seem to cancel out propulsion input. The vehicle keeps roling no matter what. The wheels are on subgrids, I upped the value for braking by a lot, and placed a suspension on the main grid, but nothing seems to fix it. I'm using compact 2x2 suspensions.
Sapioit Jan 24, 2024 @ 2:11am 
I understand. Honestly, I wish your scripts were actually in-game features without the need for experimental features being enabled.
E-Man720 Jan 24, 2024 @ 1:23am 
Wouldn't the main issue be script complexity limits when it come to trying to combine them?
Whiplash141  [author] Jan 23, 2024 @ 7:04pm 
@Sapioit
Generating good code with ChatGPT is like trying to win a cooking competition with off-brand Hamburger Helper.

If I combine the scripts, I'm going to do it right.

@Blood Brother:
Glad to hear it
Blood Brother Jan 23, 2024 @ 5:57pm 
Hey Whip, thanks man. It was my own lack of understanding that was the problem, not your mod or the server. I got it working now. Thanks for responding.
Sapioit Jan 22, 2024 @ 10:04am 
Gocha. Thanks for the reply! You could try using ChatGPT to do that for you, and if it doesn't work, you simply don't publish the new script.
Whiplash141  [author] Jan 22, 2024 @ 8:03am 
That's a *lot* of code. I don't have any plans to do that anytime soon.
Sapioit Jan 22, 2024 @ 1:23am 
Could it be possible to merge the 3 subgrid manager scripts you have into a single one? Though I guess that might create more problems than it's worth.
Whiplash141  [author] Jan 5, 2024 @ 7:59pm 
This isn't a mod. It's an in-game script, so you shouldn't be installing it a mod
Blood Brother Jan 5, 2024 @ 3:01pm 
This is a GTX Gaming Server that I pay for. In the server settings both Experimental mode and Enable Scripts are activated. Your mod is literally the only mod that will not work although I've had your mod work just fine in my solo games even when people have joined me in them. Could it have something to do with the fact that I'm using a external server? And if so, why do the other mods work?
Whiplash141  [author] Jan 3, 2024 @ 4:49pm 
MP probably doesn't have scripts enabled then. Ensure experimental mode and scripts are turned on in the MP world's settings.
Blood Brother Jan 3, 2024 @ 10:00am 
Hey Mr. Whip. I would like to use this mod in a private server with my friends but I can't get it to work in MP only in solo play. Can I fix that?
Swann Nov 30, 2023 @ 1:43pm 
Thank you Mr. Whip. This script is simply the most important, most indispensable, most seminal mod ever added to this game. Unequivocally, SE would hold no value to me and be joylessly unplayable without this script. Keen should be embarrassed that Mr. Whip had to provide such basic functionality for them. Thank you, thank you.
Dead_Pixels Oct 31, 2023 @ 7:47am 
Hey Whip! I'm using this script on a series of semi trucks and trailers and noticed something strange. I'm not sure if this is done by your script or the base game though. I have a trailer with 8 axles, all with steering enabled to and none set to invert, and while steering the first axle (furthest to the front) and sometimes the second axle will invert their steering angle. Is this something your script does? If so, can I disable it?
Dahar Sep 20, 2023 @ 9:04am 
Thanks for your script! Is there any way to set cruise control to certain speeds? 10,20,30 m/s. Or add such a function through commands?
Whiplash141  [author] Jul 20, 2023 @ 8:42pm 
See the section "How the heck does braking work?"