Cities: Skylines

Cities: Skylines

Random Train Trailers 2.4.1
223 Comments
BierPizzaChips Apr 14, 2024 @ 11:08pm 
This is a fantastic mod!!! Now i can run my favourite locomotives with trailers matching to the industry of the a districts cargo station. I LOVE this. Many, many thanks.:steamhappy::steamthumbsup:
The Loot Oct 25, 2023 @ 12:06am 
Bummer, but it is something I can mention to bsquiklehausen if he still has plans to update his old freight trains.
Acc3ss Violation  [author] Oct 24, 2023 @ 1:21pm 
No, the Empty trailers are only possible via the trailer variations.
The Loot Oct 24, 2023 @ 12:35pm 
Good point about the amount of short trains you'd get.

Is there a way that an "Empty" cargo can be set to spawn static trailers like the other types can? There's a "None" cargo, but documentation says that spawns them with any type of cargo.
Acc3ss Violation  [author] Oct 24, 2023 @ 9:10am 
The problem with cutting down the amount of trailers is that a lot of trains are actually more than 50% empty, at least during my testing, so you'd end up with a lot of really short trains, which looks a bit silly.

The empty cargo trailers are already a thing. The game has support for trailer variations and the mod does use that to make trailers appear empty based on cargo load of the train. Of course the assets themselves need to support these variations, but there are some out there that do and they work quite nicely.
The Loot Oct 24, 2023 @ 1:19am 
Would you still be interested in adding any new features?

I guess the simplest would be an option to check the vehicles load percent and then cut down the amount of trailers that can spawn to that percent of the maximum trailer count.

A more involved system, with the addition of an "Empty" cargo type for trailers, spawn those cars depending on how empty the vehicle's load is compared to the maximum.

Is something like that possible?
STC Continuum Aug 2, 2023 @ 6:08pm 
@Acc3ss Violation I set end offset to 3 and that worked. Thank you!
Acc3ss Violation  [author] Jul 24, 2023 @ 11:39am 
@STC Continuum Using an end offset of 1 should work on all of them, so the caboose should be there. Are some of those assets perhaps ones that automatically 'turn around' when reversing? I know some steam trains on the workshop do that. For those you may need a higher end offset than 1 because the last one or two cars are actually invisible, so the caboose isn't actually the last trailer.
STC Continuum Jul 22, 2023 @ 4:33pm 
So, I have a question. I am trying to get my freight trains to spawn with cabooses on the end, using the end offset set to 1. I have subscribed to several trains, all with cabooses, yet only one will actually spawn with a caboose at the end. What am I doing wrong, or is this a glitch?
Acc3ss Violation  [author] Apr 25, 2023 @ 11:28am 
Copy/paste buttons were just added in 2.4.1
link_0610 Jan 20, 2023 @ 1:49pm 
Well then I have to bite the bullet and copy and paste a lot...
But nice to hear that you try to add copy and paste feature in the UI.
Acc3ss Violation  [author] Jan 20, 2023 @ 1:10pm 
That's quite an ambitious project with that many engines. I'd probably go for editing the XML with a lot of copy pasting or writing some sort of script to generate the XML file.
There is an unreleased copy-paste feature for the in-game editor UI which I want to release at some point, but that would still be pretty slow for such a large number of configs.
link_0610 Jan 20, 2023 @ 10:36am 
@Acc3ss Violation.
Thanks, for your reply. It's quite unfortunate that it's limited to one trailer config for one engine. I guess then I will try to copy and rename the crps...
Do you have an idea/recommendation how to set up quickly a lot of RTT cofings? I have around 50 engines which I want to act as single, double, triple and quad config, so I how have to make configs for around 200 engines.
Even if I would edit the RTT-Definitons.xml it would take very long. All trains would have the same trailer but different off sets, engines and trailer limits. Any Ideas how to speed up the progress?
Acc3ss Violation  [author] Jan 20, 2023 @ 10:26am 
I can get the submeshes to work properly, but I can't get the main mesh to hide itself when one of the submeshes is used, so it still looks weird. I recommend using another trailer instead of the vanilla one.
Acc3ss Violation  [author] Jan 20, 2023 @ 10:15am 
Nope, just one per engine.

I've also been able to replicate the issue with the vanilla trailers showing all submeshes. I'll take a quick look and see if I can find a workaround for it.
link_0610 Jan 20, 2023 @ 9:52am 
Is there a way to have multiple RRT set ups for the same engine?
Like set up A: off set 0, trailer limit 15 and set up B: off set 1 trailer limit 30
link_0610 Jan 19, 2023 @ 9:28am 
@Acc3ss Violation
Thaks for the quick reply.
First sorry, my bad, then I understood it wrong how the offset works. But I didn't used the vanilla save button. I only used the save button form the extended asset editor.
Acc3ss Violation  [author] Jan 19, 2023 @ 9:21am 
@link_0610 From what you describe the start or end offsets work as expected. They prevent part of the train from being randomized, those parts will end up using the original trailers that were saved with the asset, in this case the vanilla cargo trailer.
If you want to put an engine on the back or two at the front you'll have to do that in the asset editor and then use the start/end offsets to prevent it from being randomized away.
The submeshes all being present at once could be caused by using the default Asset Editor save button. Make sure to use the Extended Asset Editor save button to properly save the submesh configuration. There is also a cargo type preview selector in the Extended Asset Editor, you can use that to see if the submeshes are set up correctly.
link_0610 Jan 19, 2023 @ 7:59am 
@Acc3ss Violation.
Hello, I think I have an issue with Trailer Variation loader or RTT, i'm not 100% sure.
Im useing a workshop cargo train (which I edited in the extended asset editor and only has the vanilla cargo trailer). Changing these trailers in RTT is working fine. But if I set up a a end or start offset the trailer don't gets replaced by an engine. Instead there is the vanilla cargo trailer. Furthermore it looks like that the vanilla cargo trailer would spawn with all sub meshs at once, so the trailer is flickering around and muliple meshes are visble.
The vanilla freight train does have normal looking trailer.
If you want to see screenshots or logs feel free to contact me on discord. Ping me on the r/CitiesSkylines discord server or write me a DM. My username is the same like here.
Acc3ss Violation  [author] Jan 18, 2023 @ 10:25am 
That's not possible, the trains keep their original names.
alexanderciv Jan 18, 2023 @ 7:06am 
Is there a possibility to name your trains individually? Currently the trains are named after the engine name, e.g. AFT 123456 Cargo Coal, etc.

What do I need to do when I select this engine for my train to rename it. For example, I configure a Cargo train to depart only from the Forest Industry station. I want it to be called "Forest Industry Cargo".

Is there this possibility?
BÖRK Jan 12, 2023 @ 5:42pm 
NVM, i can handle it
Acc3ss Violation  [author] Jan 11, 2023 @ 10:29am 
What kind of conflict? What error?
BÖRK Jan 11, 2023 @ 1:49am 
i got conflict with vehicle effect after subscribing this mod and what i should to do to fix the error?
Wijnand1985 Jan 4, 2023 @ 12:32pm 
@Acc3ss Violation, the mod was enabled in the mod list. I use LoadOrderMod for that. But a couple of days ago, the issue was gone all of a sudden. I'm guessing it was some mod conflict. Thanks for your help!
Acc3ss Violation  [author] Dec 27, 2022 @ 4:11am 
About the icon disappearing, is the mod still enabled in the mod list?
If it is, check the mod's settings for the "Enable UI" toggle, it should also be enabled.

If both are enabled then maybe some other mod is interfering with the icon.
Acc3ss Violation  [author] Dec 27, 2022 @ 4:04am 
@Wijnand Dijkshoorn It's a percentage indicating the chance that it will invert. 0 never inverts, 100 always inverts. So in your case use 100.
Wijnand1985 Dec 26, 2022 @ 2:02pm 
Also, how does the 'invert' option work? If i want to invert an engine to function as the last wagen of the train (for instance with the 'koploper' in Holland), what number do i have to fill in in the invert textbox?
StayHungryStayFoolish Dec 26, 2022 @ 7:20am 
This mod is part of the Financial District compatible modlist.
Wijnand1985 Dec 26, 2022 @ 6:32am 
Hello Acc3ss Violation, i downloaded your wonderful mod, and after starting the game the train icon was there in the toolbar, but after quitting the game and restarting it later, the icon was gone ever since. I tried redownloading your mod, but that didn't help. Do you have any clue as to what's happening?
Acc3ss Violation  [author] Nov 17, 2022 @ 10:09am 
@StarrWulfe It was a bit of a recurring request, but your comment was the final push for actually implementing it haha
StarrWulfe Nov 17, 2022 @ 7:40am 
@Acc3ss Violation hey was that update for me? Wow, I'm gonna check it out right now!
Acc3ss Violation  [author] Nov 15, 2022 @ 9:42am 
@Hindi correct, that can be done. In that example you will need some multi trailer trickery if you want to avoid spawning a 6car one.
Hindi Nov 15, 2022 @ 6:57am 
The tram addon sounds promising. If i read the tutorial correct, you can have 5car and 7car trains with the same asset?
Termite Nov 15, 2022 @ 2:32am 
Great update to an essential mod. Thanks.
StayHungryStayFoolish Nov 14, 2022 @ 3:53pm 
This is a nice addition, a nice idea, and a nice UI.

Thank you for the update. I will start to analyze this mod.
Acc3ss Violation  [author] Nov 14, 2022 @ 12:37pm 
Update 2.4 released

Passenger trains, metros and trams are now again supported! Configuration works the same as with cargo trains, except you can't use the cargo contents to change their appearance.
StarrWulfe Nov 14, 2022 @ 7:03am 
This doesn't work with trams, does it?

I want to make a longer consist of the same or slightly different light rail vehicles as is done in Portland Oregon, USA; older Type 1 cars that are high level and have stairs run in consists of 2 or 3 cars and have at least one newer Type 2 and above car that is low-floor barrierless to accommodate wheelchair passengers.
Acc3ss Violation  [author] Nov 12, 2022 @ 2:28am 
Correct, the randomization is limited to real cargo trains
Hindi Nov 11, 2022 @ 3:11am 
If i want to create a dummy freight train (passenger train with freight train trailers), it is not possible to randomize the trailers, if i see that correct?
The Loot Nov 6, 2022 @ 3:31am 
@Da Boss Hoss In this mod, set up a train configuration to only spawn those types of cars, and then in Vehicle Selector, only allow that specific train to spawn at that station.
Fiona Maray Nov 5, 2022 @ 1:06pm 
Is there any way to use this with Vehicle Selector so certain combination of trains/cars spawn from specific train stations? (i.e. a train with all forestry cars would spawn from a station in a forestry industry area)
Acc3ss Violation  [author] Nov 3, 2022 @ 10:51am 
@CassiBerlin No worries, I hope this answers your questions:
1. Yes, this is purely done in the game itself, no asset editor required.
2. The configurations do not create new assets. The mod modifies the trailers of a spawned train the moment it is created (or departs a station). Since spawned vehicles get saved in the savegame this info persists between loads without having to create a new asset.
3. No, you cannot assign a configuration to a specific station. But since the train consist can depend on what cargo the train carries (each wagon model can be assigned one or more cargo types) you will generally get oil trains departing from an oil field station and grain hoppers coming from a farming district station.
CassiBerlin Nov 2, 2022 @ 4:04am 
Thanks, @Acc3ss Violation, for adding so much value to the game.
However, with my limited experience on the asset editior and none in actual modding, I'm not sure I understand how this works.
Unlike Extended Asset Editor, this all is applied in game, right?
Are the configurations actually creating new assets (local or workshop) or are they just within this one savegame?
Can the configurated train(s) be assigned to specific stations (like a food train to a station next to farming industry)?
Sorry for bothering, it might sound stupid, I know. This seems to be so much more powerful and versatile than Extended Asset Editor, very tempting...
If you can tell by my questions that I'd rather not use it, just let me know, I'd be fine
The Loot Oct 6, 2022 @ 4:57pm 
Wow, I had forgotten all about this mod, because I had it confused with your trailer submesh mod and thought I had no use.

After RTFM, sorting out my installed trailers, adding them all to one collection, sorting cargo types, and making consists for all my trains, I am pleased to watch a reefer-only train roll out of my farm station with a load of dairy and beef products!

It literally takes care of all my train spawning restriction needs!
Tuga_Venatus Sep 30, 2022 @ 6:51pm 
only have one cargo train added, with trailers, but ill test it and see if it shows invisible also without the RTT. or create a config and see if that helps.
Acc3ss Violation  [author] Sep 30, 2022 @ 12:51pm 
By default the mod won't do anything unless you create a config (there's a train icon button on the right of the main toolbar while in game) or one of the workshop assets you're subscribed to includes a config.
If there are invisible trailers then that is probably an asset issue as it's impossible for the mod to try and spawn trailers that you don't have. You'd have to figure out which asset is causing it.
Tuga_Venatus Sep 30, 2022 @ 9:46am 
i am adding more trailers to this mod, as i am unsure if its the mod issue or not, but my cargo trains are spawning with some invisible trailers.
i have not set any config yet, only the trailer limit option. i thought it would use all available ingame trailers (vanilla plus whatever i add as mod) but seems it is trying to pickup something i dont have and makes them invisible :/
Acc3ss Violation  [author] Sep 15, 2022 @ 11:15am 
Mod has been updated, it should now work with the Plazas & Promenades patch!
[DSB] mario[GER] Sep 15, 2022 @ 9:56am 
Seid gestern kommt die Fehlermeldung.

A Mod caused an error [System.Exception]

Details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: An exception was thrown by the type initializer for CitiesHarmony.Installer ---> System.TypeLoadException: A type load exception has occurred.
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception