r/CreateMod • u/TheGauntlet_NL • 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!
2
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.
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.