Space Engineers

Space Engineers

Trailer Manager
48 Comments
Brianetta  [author] 20 Aug, 2023 @ 4:17am 
Which trailer are you using? Have you properly tagged its front hinge?
Stiffness of hinges is for you to change, the script doesn't care about that at all.
Ampelios 19 Aug, 2023 @ 9:19am 
i am a hawe a problem where it ceeps telling me (Unkown trailer!) how do i fix this ?
and is the hinges meant to be this stiff ?
nickforgie 2 Jun, 2023 @ 12:24pm 
i didn't even realize how to mass pack everything till I saw it at a glance. it also sometimes fails to work( all pack not deploying)
Brianetta  [author] 2 Jun, 2023 @ 11:45am 
No idea! I'll take a look at the code this weekend, see if there's anything that jumps out.
nickforgie 2 Jun, 2023 @ 11:37am 
all pack is working as un pack
nickforgie 2 Jun, 2023 @ 11:33am 
for some reason allpack is functioning as unpack. any ideas why?
CTH2004 29 Mar, 2022 @ 7:04am 
true, treu
Brianetta  [author] 28 Mar, 2022 @ 5:11pm 
Well, Trailer Manager is free/open source software, so anybody can work on it. Some of the ISL trailers have buttons for adjusting suspension, so there's definitely scope for it.

One thing that you can already do right now (if you want to test/play) is create a timer block that calls the other script with an argument, and add that timer block to the Trailer Manager menu for its trailer.
CTH2004 25 Mar, 2022 @ 6:47am 
another idea is for you two to work together, and make a single script with both! It doesn't need trailers to work, and can just store presets, but, it can manage trailers, with pre-sets. Maybe even a way to make pre-sets with different values for trailers, and, if desired, do a different pre-set per trailer? (Run all: "PresetName") (Rune trailername:"PresetName"), to set just 1 trailer to a specific pre-set. Not sure why one would want that, but could be usefull
Ronin Planetary Industries 24 Mar, 2022 @ 7:58pm 
I have a script for storing suspension settings. It works by using arguments as input. I mention this because you could call out from your script to mine to make suspension setting changes as part of your own presets.
Dots 24 Feb, 2022 @ 9:43am 
I think its best if someone made a video tutorial on how to set this up properly.
Niceguygamer 23 Mar, 2021 @ 4:33pm 
Oh ok thanks
Brianetta  [author] 23 Mar, 2021 @ 4:29pm 
There's more on the Github wiki.
Niceguygamer 23 Mar, 2021 @ 6:42am 
Nvm I see the instructions in the script.
Niceguygamer 23 Mar, 2021 @ 6:36am 
Is there a guide on how to set this up properly? I'm new to the script.
CTH2004 12 Mar, 2021 @ 2:31pm 
okay! And, I thought it could be done due to those auto-running scripts, but I realized now that that isn't compling...
Brianetta  [author] 12 Mar, 2021 @ 10:53am 
Yes, it works on large grids. There is absolutely no way to make a script recompile itself. The guide is progressing on the Github wiki.
CTH2004 11 Mar, 2021 @ 5:36pm 
@Brianetta

I was about to recommend that you make it auto-recompile, then I relized "how often do you really add trailers", and decided not to...

so, I just want to double check, it works on large grids, right? And, you should make a guide for this.
Brianetta  [author] 28 Feb, 2021 @ 7:28am 
There's no way to automatically recompile the script. It does attempt to find a connected trailer even if there isn't a properly configured rear hinge, but once it has found one it doesn't look for another (unless you recompile, of course).
Abdultawaab Popoola N’omusa 28 Feb, 2021 @ 3:53am 
Also I actually found out that placing two rear hinges kinda works. I connected one of the hinges with a trailer and that worked fine (it showed up in the menu). Then I disconnected that trailer and connected another trailer with the other hinge (still only having one trailer connected at a time). This time it didnt show up - But I just had to recompile and then it worked. So if there was a way to automatically recompile the script when connecting to a trailer, I think that you could place as many rear hinges as you wanted. (ofc while only using one at a time)
Abdultawaab Popoola N’omusa 26 Feb, 2021 @ 12:36am 
Alright, thank you
Brianetta  [author] 25 Feb, 2021 @ 1:14pm 
It isn't supported, I'm afraid. Trailer Manager stored the rear hinge in a variable, so that it can follow the train from front to back as it builds the menu. I can think of a way it could be expanded to accommodate multiple rear hitches, but I'm not sure how I'd handle somebody trying to tow two trailers side by side in a sensible manner. Instead of a chain, it would be a tree, and that would mean a redesign. The screen menus would need to deal with this, too, because at the moment they're in the same order as the consist, so you can always identify identically named trailers.

I'll try some ideas out, and if any of them work well you might see this feature in a future version.
Abdultawaab Popoola N’omusa 25 Feb, 2021 @ 12:52pm 
Yeah I see. Well thank you for answering all my questions mate. One last one though - Can I put multiple hinges on (like at different heights so my vehicle is compatable with different trailers) but of course still only use one at a time?
Brianetta  [author] 25 Feb, 2021 @ 12:43pm 
You can *have* subgrids, and your timer blocks can do things with the things on them - it's just that Trailer Manager won't know about them directly, and won't consider them as part of the trailer.
Abdultawaab Popoola N’omusa 25 Feb, 2021 @ 5:36am 
Thats a bummer as all my designs have a lot of subgrids. Ill make the Pull-vehicle compatible with the script if people want to use the ISL creations
Brianetta  [author] 25 Feb, 2021 @ 4:33am 
Yes, that is an issue. A trailer is a single grid, and when you put a hinge on a piston it's some other grid. A trailer must be defined and identifiable somehow, even if two are copied and pasted with identical Custom Data. I chose the grid itself as the identifier. Since Space Engineers, internally, has no concept of "subgrids" there's no simple way to reliably associate things attached by rotors, pistons and hinges with a "main" grid.

Likewise, a trailer's timers must be on the trailer, which means on its grid.

I've updated the wiki to make this clearer.
Abdultawaab Popoola N’omusa 24 Feb, 2021 @ 10:59pm 
This makes sense, although I still have a few questions. If I want a timer that extends pistons, then it should be on the trailers with the pistons right? Also, I have attached the first trailer and that showes up ín the menu as intentioned. But then I attached a second trailer and that one didnt show up. I have the back-end hinge of the first trailer on a piston so I can get extended. Is that an issue?
Brianetta  [author] 24 Feb, 2021 @ 2:41pm 
There's a new wiki page about trailers and their timers:
https://github.com/Brianetta/Trailer-Manager/wiki/Trailer
Brianetta  [author] 24 Feb, 2021 @ 12:12pm 
There's a menu option to pack a trailer, and one that packs all trailers. When selected, it will run that timer (if it exists), release the front hinge lock, and release the trailer's handbrake (f there's a controller to do that with).

You can use the timer to make sure that any other bits and bobs get done before you set off. Maybe you want to lower the periscope, switch on the tail lights, or switch on the "just married" LCD sign.

Check out any of Spite's trailers for inspiration!
Abdultawaab Popoola N’omusa 24 Feb, 2021 @ 10:46am 
"What that timer does is completely up to you." Didnt you say it packs the trailer for travel or am I just not understanding it right. Sorry for all the questions :D
Brianetta  [author] 24 Feb, 2021 @ 9:53am 
You don't have to do anything. If you set up a timer with task=pack, then it will get triggered when you ask the script to pack your trailer for travel. What that timer does is completely up to you.
Abdultawaab Popoola N’omusa 24 Feb, 2021 @ 6:03am 
So I have to put task=pack in the custom data but do I also have to setup the timer with actions or will that happen automatically?
Brianetta  [author] 24 Feb, 2021 @ 3:43am 
Timers with task=pack or task=stow in their custom data settings will be triggered when the Pack Trailer or Pack All Trailers functions are used. Timers with task=unpack or task=deploy will be triggered when unpacking trailers. These are useful for extending piston legs, unfolding solar panels, triggering lights and so forth. Without a timer, pack and unpack will set the front hinge lock and apply parking brakes (if you put a remote control, flight seat or cockpit somewhere on the trailer). If task=toggle it will be used to both stow and deploy.

Timers with other task names (perhaps something like task=Launch Drones) will show up in that trailer's menu, with the task name. Selecting them from the menu will trigger that timer immediately. This is useful when your trailer has features that aren't built in to the script. The script knows about hydrogen engines, for example, but if your trailer has reactors on it you could use a timer to allow the menu to toggle them on and off.
Brianetta  [author] 24 Feb, 2021 @ 3:43am 
You don't need to name anything. The script is configured from Custom Data only. There is a Legacy Detect feature that attempts to write defaults to Custom Data, but it was designed to update older ISL trailers (that pre-date the script) and to attempt to update some trailers by Smokki and Taidyr. That uses names to try to figure things out, but I wouldn't advise that you rely on it.
Abdultawaab Popoola N’omusa 24 Feb, 2021 @ 12:26am 
Thank you. Do I have to name my hinges anything - And I also read something about timer blocks. Are they necessary?
Brianetta  [author] 23 Feb, 2021 @ 11:07am 
Not a video, but you can start here:
https://github.com/Brianetta/Trailer-Manager/wiki/Setup
Abdultawaab Popoola N’omusa 23 Feb, 2021 @ 8:43am 
Is it possible for you to make a youtube video where you set up this script? I am genuinely confused by... Everything
Zindal 27 Jan, 2021 @ 8:35pm 
Thank you haha. I ended up using Keybinds mod. Love the script!
Brianetta  [author] 27 Jan, 2021 @ 5:47pm 
This works exactly the same was as the menu keys for PAM (Path Auto Miner).
Brianetta  [author] 27 Jan, 2021 @ 5:46pm 
You need to set up some controls. If in a cockpit, use the toolbar. You need to add the programmable block three times with "Run..." and then use Up, Down and Select as the argument. Other arguments are shown in the top part of the script, although you might have to scroll down it a little.
Zindal 27 Jan, 2021 @ 4:10pm 
I managed to get it to work but I dont know how to navigate the Screens. Arrow keys dont seem to work for me.
Brianetta  [author] 19 Jan, 2021 @ 2:48pm 
That's correct; this script assumes that all the trailers are a single grid, with opposite-facing hinges separating them, and a small hinge-head grid between each trailer. The trailers can have subgrids, but the script will not present any options regarding them.

For this script to detect your trailer, you will need:
1. A hinge on the same grid as the programmable block ("the truck") facing backwards.
2. A hinge on the trailer's grid, facing forwards, rotated 90° to the truck's hinge.
3. The hinges should be coupled to each other by back-to-back hinge heads. Detaching the truck's hinge is how the system handles decoupling.
4. The trailer's front hinge needs to have the right config in its custom data:

[trailer]
name=Trailer Name
front=true

There's more, but that's the bare minimum.
The Caveman 19 Jan, 2021 @ 10:52am 
Can the connecting hinge not be on a subgrid? trying to make train couplers and it refuses to detect a connecting hinge on another hinge.
The Caveman 19 Jan, 2021 @ 10:43am 
regardless of what i do, this script will not detect any new trailers, and the only selectable options are batteries, hydrogen and rebuild........
Brianetta  [author] 18 Jan, 2021 @ 4:39pm 
Actually, having taken a closer look, they're probably going to work fine.
Brianetta  [author] 18 Jan, 2021 @ 4:35pm 
Let me know if you have trouble. Your couplings are more complex than this script expects!
CMDR_WATCHYOUR6 18 Jan, 2021 @ 8:35am 
How is that I didn't know about this before? It's the perfect script to implement with my Centipede. Thanks a ton for sharing it and letting me know @Brianetta. You have my like, suscription and appreciation mate! thx. :steamthumbsup:
Dylanthalus/Flynn 2 Jan, 2021 @ 5:36pm 
Nice. Will check out if i build a trailer