Space Engineers

Space Engineers

Clang Drive Manager
259 Comments
Rightraoedhelontidae 22 Jun @ 1:01am 
Is it possible to disable the dampeners for one direction only? So I don't have to keep pressing W to go forward
Barkhan 23 Feb @ 1:50pm 
It seems like this script can't take input from AI flight blocks, is there something i'm missing or is that just not supported?
CTH2004 3 Jan @ 8:36am 
very nice!

I do have a question though: does it "handle" torque? What I mean is, does it alter the useage of drives to counter-act torque?

if not, here's an idea:
what if this script could steer? how it works is if you have a drive off-center, it can use that drive to apply torque, thereby steering. It works best in tandem, where it can use the thrusters to, say, the left of the Center of Mass (CoM) to push in one direction, the ones to the right in the other direction.

It could perhaps even change the generated thrust (when applicaple) so that if you have one way away from the COM, and another closer, it will use the one further away less. Basically, it will "steer" constantly in the opposite direction, overcoming that torque (to an extent). And at the small scale it counteracts the random fluctuations!

just a thought :)
Puddle46 28 Dec, 2024 @ 12:34pm 
how do i use this for my own mass drives?
colddna 21 Sep, 2024 @ 2:06am 
i am not sure where to change in the script to get it above 150ms
DrWatchMojo 9 Aug, 2024 @ 9:00pm 
Thank you very much!
Major Jon  [author] 6 Aug, 2024 @ 3:29pm 
I just updated the script, there is an argument for toggling the reversepower now, it's revtoggle by default
DrWatchMojo 5 Aug, 2024 @ 2:59pm 
Is there an argument to toggle "reverse" thrust on and off? An argument to change the reverse strength from the toolbar would also work.
DrWatchMojo 5 Aug, 2024 @ 11:10am 
Ok I figured it out. Because I was using a cargo container instead of a basic assembler as the base block, the cargo container was connected to other containers on the ship. By putting the [Ignore] tag on all of the containers the false positives disappear.

Also, just wanted to say that your script has made me put more time into this game than any other feature. It almost acts like a DLC for my games!
Major Jon  [author] 2 Aug, 2024 @ 1:16pm 
It sounds like it's detecting a bunch of drives that don't exist. It can only handle so many drives, so I guess it stops looking for more drives after reaching the limit. You should get rid of these false positives, then it'll probably find them again. You can make the script ignore blocks by tagging them with [ignore]. Just tag a bunch of rotors and stuff with that until it doesn't recognize them as drives anymore.
DrWatchMojo 2 Aug, 2024 @ 10:52am 
Hey, Major Jon

I've been using your mass pulse drives for various builds for a few months and i've ran into a weird issue. I have a cargo ship with two drives facing back, two downward, and one for side to side thrust. The rear and side drives function like normal, but i cant for the life of me get the downward drives to function. The script also shows 19 drives (17 facing left, two facing backward).

When I face the downward drives up (subgrid container facing up) the drive works, but subgrid facing down does not.

Any ideas on getting the script to work in all directions?
Matitron 4 Jul, 2024 @ 9:14pm 
Cockpit isnt detected if destroyed or if a weapon is added for some reason
Major Jon  [author] 18 Jan, 2024 @ 4:15pm 
You should probably try ingots then. With ingots you just define a mass to be moved in the script, so you can move fractions of a kg. Everything else comes in quantities of atleast one, I don't know how the game then does the conversion from kg to number of items.
LuNa <3 18 Jan, 2024 @ 12:31pm 
Does it have to be ingots is my next question? i was under the impression that'd pick anything so I just threw some plates in there.. as for mods I don't actually know.. perhaps weaponcore but that seems highly unlikely. I also have Buildinfo and build vision.
Major Jon  [author] 18 Jan, 2024 @ 12:25pm 
hmm, not sure what's happening. Do you have any mods that could mess with the script finding the items and moving them between the containers? you had 1x inventory multiplier right? Maybe try putting all ingots in one container and see if the script moves anything over at all.
LuNa <3 18 Jan, 2024 @ 11:52am 
After testing for about 2 minutes or so... it doesn't seem to be moving. or I just have terrible RNG
LuNa <3 18 Jan, 2024 @ 11:35am 
the items do get moved but i'm unsure if it keeps moving them i'll have to check rn
Major Jon  [author] 18 Jan, 2024 @ 9:38am 
do you see the items beeing shifted around? when you stop the script at random times, sometimes there should be a lot of items in the moving container, sometimes only 500kg.
LuNa <3 18 Jan, 2024 @ 8:49am 
I'm having a problem where if I use the small grid 1x1 advanced rotor clang drive where it seems to do a whole lot of nothing, doesn't move forward or back past about 1.1m/s. I have realistic inventory for ship inventories. it seems to not want to work with the small cargo container version. unsure if it's a me problem or something else is going on.
SeveredHead 25 Nov, 2023 @ 2:54am 
I can, however you probably can adjust the code yourself for automatic detection of inventory multiplier since you can check the volume of the blocks.
Major Jon  [author] 22 Nov, 2023 @ 11:48am 
Hmmm, inventory multiplier is kinda weird, I don't really know why this happens tbh.
On line 1150 in the script is the mass that stays in the moving cargo container to make it move slow enough to align with the ticks. If it doesn't align with the ticks it can sometimes oscillate out of phase and push the ship backwards. Maybe you need to triple that number or divide it by 3.
SeveredHead 22 Nov, 2023 @ 10:38am 
I do have tripple or quadruple mass, it increases the force generate by the clang drive. The problem is that the drive accelerates into opposite direction where I am pressing (W goes back, S goes forward)
Major Jon  [author] 21 Nov, 2023 @ 3:29pm 
Inventory multiplier also decreases the density of everything, so there's not enough mass to be shifted around. It might work to just triple the amount of stuff in the cargo container. The script wants to shift a certain mass around, don't really know how that works together with the inventory multiplier.
SeveredHead 21 Nov, 2023 @ 12:36pm 
I do yes, x3
Major Jon  [author] 19 Nov, 2023 @ 1:11pm 
do you use inventory multiplier in the world?
SeveredHead 18 Nov, 2023 @ 3:56am 
Script seems to have an error. When I attach small grid mass drive, it drives into opposite direction from W and S. It also accelerates always instead of decelerating
Major Jon  [author] 3 Nov, 2023 @ 3:56pm 
already exists, just put [ignore] somewhere in the blocks name
LettuceSupreme (Nitron X) 3 Nov, 2023 @ 1:59pm 
Would it be possible to add an "ignore" tag to force the script to ignore specific blocks? I make ships with a ton of subgrid, and at times I'll randomly get the "Too Many Drives" error. Being able to just mass tag all of the pistons hinges and rotors I dont want counted would help a ton.
Major Jon  [author] 23 Sep, 2023 @ 12:22pm 
do you use inventory multiplier in the world?
orion's homuculus 22 Sep, 2023 @ 9:22pm 
weird thing, one of the ships that uses this now goes in reverse with the script enabled, it uses the mass shifting drive, or MSD-2-21, just letting you know.
Major Jon  [author] 4 Sep, 2023 @ 1:36pm 
I updated the script now and fixed them, couldn't fix the lowered power though. It seems the merge blocks react to commands from the prog block with a delay now or smth and the timings are off by fractions of a tick. Probably some optimization thing for prog blocks or merge blocks. Anyways, doesn't seem like I can do anything about that.
Phoenix 3 Sep, 2023 @ 9:14pm 
I was wondering about that. My basestar suddenly went from a nimble menace to a giant brick after the update.
Major Jon  [author] 3 Sep, 2023 @ 2:02pm 
I just had a look at it and something definitely changed, either about the merge blocks or the rotors. Good news, it is fixable. Currently the fix makes it run at 50 % power though, so I'll try out some other stuff and update the script tomorrow or so.
Redflame1022 3 Sep, 2023 @ 1:09pm 
It looks like the recent update is causing some issues with merge drives in the script. Timings seem slightly off. Merge block seems to be being turned off slightly too early.
NickEtlon 5 Aug, 2023 @ 9:29am 
amazing script, but sometimes it thinks that custom turrets are mass drives and then all the real drives stop working
Major Jon  [author] 29 Jul, 2023 @ 7:51am 
great, I'll update the code to make it work for everyone then :D
johndaphenom 29 Jul, 2023 @ 7:35am 
Thank you very much. I changed all the WASD logic from "==1" to ">0" and "==-1" to "<0" for every axis and now it works with my gamepad. Would still be eyeballing code probably if you didn't point me in the right direction. Much appreciated and awesome script.
johndaphenom 29 Jul, 2023 @ 7:10am 
Ok I'll try that.One work around is just emulating the M&K on the gamepad, was just trying to make it work with the built in gamepad controls though.
Major Jon  [author] 29 Jul, 2023 @ 3:20am 
you could try changing all lines with ShipReference.MoveIndicator.X/Y/Z ==1 (line 659-731)
to ShipReference.MoveIndicator.X/Y/Z>0.
No idea if that works though, I don't have a gamepad, can't test it.
johndaphenom 29 Jul, 2023 @ 1:42am 
Script works great but, I have one minor issue. The script doesn't recognize my joystick input when using a gamepad. It recognizes the up/down which makes me think its something to do with Keens code that emulates WASD on gamepads. Anyone know how I can make this script work with gamepads?
silentnuke 6 Jul, 2023 @ 3:14pm 
Ah got it, i'll try making a new world without RTS to test. Thanks again for the feedback.
Major Jon  [author] 3 Jul, 2023 @ 1:53pm 
It might be the relative speed limit mod. The rotors shoot out the cargo container faster than the speed limit, probably somewhere in the 100s of m/s. For subgrids the speedlimit is 1060 m/s, so maybe the mod messes with that somehow.
silentnuke 3 Jul, 2023 @ 12:05pm 
Thanks for the feedback. No inventory multipliers/ingot modification mods activated on this save, so I'm a bit confused. I have a custom version of the earthlike planet and I'm using relative top speed to manage maximum movespeed on the server. I'll continue troubleshooting on my end. It's just strange that only one version of the cargo container is affected, while all others are fine.
Major Jon  [author] 2 Jul, 2023 @ 2:04pm 
It works just fine for me. Do you have any inventory multiplier on, or a mod that changes the density of ingots? Part of the ingots stay in the moving container at all times, when their mass changes, it can sometimes work in reverse. In the script around line 1100 there's a few variables called deadmass that control what stays in the cargo.
silentnuke 2 Jul, 2023 @ 11:56am 
Thanks for this great clang drive manager @Major Jon. Seems like a recent update to SE changed how small cargo containers are configured. I had a few concept ships I made a while ago with small grid, small cargo container mass shift drives (using 1x1x1 small cargo containers with advanced rotors). Previously, these worked without issue but now the vector directions all seem to be reversed. Drives that should move you forward when pressing W now move you backwards. Drives oriented for upward thrust now send you down. This is isolated to the small grid, small cargo containers only. The small grid, medium sized cargo containers still work properly. Are there any values we can adjust in the script to correct this?
Mia 20 Apr, 2023 @ 1:32pm 
do you have a video on this? i cant get dampening to work i press z and nothing happens im assuming im missing something
Xelan 17 Mar, 2023 @ 8:55am 
Yeah I already build one in each direction. Thought it couldn't hurt. Overall it works now, the only thing I'm missing now is a way to keep my thrusters (which I want to keep for style) from accelerating me beyond the point where the MPDs break. I think it should be possible with a script, but I can't really code and can't find a script that does it.

Anyway, now that I'm deeper in the mechanics: Awesome work with the tech and script, thanks a lot for sharing :winter2019happyyul:
Major Jon  [author] 16 Mar, 2023 @ 3:01pm 
The only thing I could recommend is to put one mpd facing forwards and one backwards. They work in both directions, but I'm pretty sure using them in reverse aligns the merge blocks in such a way that they have a slightly harder time connecting to each other, meaning they fail at a lower speed.
Xelan 16 Mar, 2023 @ 10:40am 
Nevermind. For whatever reason my two forward/backwards and my up/down drive stopped being recognised by the script. So I replaced them and now it works again. After further testing I realised that I can (de-) accelerate all I want wthout isue, as long as I only use my MPDs. They push me to around 283 km/h and then slow down, taking some time t get me to 285 and then cap out. However if I use my regular thrusters to accelerate beyond the point the merge drives can handle, they basically brick and stop working altogether, even if I reach the speed they can usually handle again. Maybe you could add that to the description? Seems important to know that can happen and why.

But apparently that max speed isn't related to the number of drives, as adding a third drive didn't change anything. I guess the max speed relates to mass of the ship.
Xelan 16 Mar, 2023 @ 10:07am 
I went back to MPD, they seem better suited for my 5KT ship. Maybe I can solve the issue with the non-existent deceleration above a certain speed somehow. Any ideas regarding that would be great :steamthumbsup:
Btw: thanks for your feedback so far, not a given thing for a mod you probably didn't really touch in a long time.