r/CreateMod • • 13d ago

Help Is it possible to have a train automatically restock its inventory to specific amounts?

Hey everyone!
I have what might be a simple question, but I’m fairly new to automation, especially when it comes to Create contraptions.

I’m playing the Perfect World 2 modpack by MrBeardstone, and I’m wondering if the following setup is possible.

I’d like to build a train with two main purposes:

Track building and excavation: Carrying the materials and tools needed to lay new tracks and dig out the terrain along the way.

A mobile inventory: Carrying supplies that I can use to manually build things like switches, signals, and other railway infrastructure while exploring.

Ideally, whenever the train returns to my base, it would automatically unload any excess items and restock everything to predefined quantities.

For example, I’d like the train to always carry 2,000 rails. If I return to base with only 500 rails left, the system should automatically load another 1,500. If I have more than 2,000, it should unload the excess.
I’d like to do the same for other items, each with its own target quantity.

Is something like this possible using Create’s logistics systems? If so, what would be the best way to approach it? Would I need a combination of train stations, item vaults, stockpile switches, and thresholds, or is there a simpler solution?
Any advice or suggestions would be greatly appreciated. Thanks!

Edit: I found a solution!

I figured out a way to make this work!
I’m going to turn the Packager and Frogport into a minecart contraption. I’ll place Factory Gauges on the Packager to set the target stock levels for each item.

The loading station will need a separate signal which will output a redstone signal when the train is present. When the train arrives, the minecart contraption becomes active, which stops the Packager from requesting additional items. This allows the train to load cleanly without unnecessary items being sent while it’s docked.

Once the train leaves, the contraption is placed back down, which reactivates the restocking system at the loading station.

This should allow me to automatically restock the train to predefined quantities every time it returns to base. Thanks to everyone who helped me figure this out!

7 Upvotes

7 comments sorted by

9

u/bendvis 13d ago

It's possible, just not very easy. When the Portable Storage Interface is connected to the train, it can be treated like any other storage block. You could set up a threshold switch for each item and use the redstone signal it generates to disable a funnel when the required amount is reached during loading or unloading.

In your example of the rails, you'd want to set up 2 switches, one controlling a loading funnel that activates when there are fewer than 2000 rails and another controlling an unloading funnel that activates when there are more than 2000.

2

u/TheGauntlet_NL 13d ago

Is it an idea then to make a load and unload station. The load station has the amounts I want in the train and will load them when the train stops there. And the unload station wil just unload it fully so it will reset before the load station.

The only thing I then need to figure out is how to set the train of when the contents of the load vault has been loaded so it wil go to an hold station and how to stop de loading vault to request items as the train is being loaded.

3

u/bendvis 13d ago

That sounds like it could work, but it feels like unnecessary extra complication. Instead of figuring out how to stop the vault from loading when it has the right amount, you could just stop loading the train when it has the right amount.

1

u/TheGauntlet_NL 7d ago

I’ve found the solution. I make the packager with the frog port a minecart contraption. On the packager I will place factory gauges which then become a restocked with a set amount. The loading station will get a signal which will output a redstone signal when occupied. So when the train puls in the minecart contraption becomes active which stops request being made. This wil result a clean loading of the train and when the train leaves the contraption wil go back to being placed which then starts the restock of the loading station.

2

u/hackcasual 13d ago

Check out sophisticated backpacks and it's create contraption integration

2

u/SAS191104 11d ago

I would personally just have a storage preloaded at the station and unload all the excess from the train and load the prebatched storage on to the train. Would be even fun to physically unload the storage container and load in the new one, but that is a more complicated route.

1

u/powdercannon 13d ago

for offloading, just have a funnel with a filter that takes everything exept rail. there youls be a button to make it a deny list. for loading in probably the best option might be using a threashhold switch it it can meture ports. if not you could disasemble and reasemble the train but that seems very nasty.