Random Train Generator

Willkommen in der Transport Fever Community

Welcome to the fan community of Transport Fever and Train Fever, the economic simulators of Urban Games. The community is free for you to share and inform yourself about the game. We cultivate a friendly and objective interaction with each other and our team will be happy to answer any questions you may have.


Registration and use is of course free for you.


We wish you a lot of fun and hope for active participation.

The Team of the Transport-Fever Community

  • Hi!

    Me as an "Schönbau" creator i like when a line has a huge of variations of trains, many kinds of trains pass through.

    Previously, i solved this by creating one train storage station:

    Speciel Stations

    My problem was with this solution that the game had to simulate too much trains. This had an effect on performance. And the trains came continuously (not randomly).

    So I created a mode for my save game that can replace the trains randomly from an array, on the selected stations.

    I use my script with my save game with about 50 lines and the arrays have more than 100 vehicles.

    I made an simple save game to show how it works.


    -It read the train arrays.

    -Checks the trains and their last stops in the update function.

    -If a train has departed from the "replacer" station, then the train got the id of next stop as "stopIndex".

    -The program will realise it and replace the train for another one from the correct array.

    More details in the: random_train_generator.lua

    -- Attention!!!!!!!!!!!!

    -- This mod works with only one save game! You have to copy it as a new one to reuse it for another save!

    -- If you want to delete a train or a line than you must delete first must it here and then in the game!

    -- The mod can be disabled in any time!

    -- Some modded vehicles does not work with this version. But most of them works correctly!

    -- If you have a dump than you can see the last replaced vehicle in the stdout.txt (Line name, array index, train id).

    -- If a vehicle cause a dump then you have to delete the line from the array (array index)!

    I am not a professional mod creator. I am a programmer for the business sector. I created it as a hobby.

    It's not a complete mod. It's an alpha version concept without error handling.

    It can be more dynamic and better.

    I just let it here. Maybe it's a good example for future mods.

  • hah! Interesting :). Cool to have you here, honestly. I also "switched over" to Transport Fever (2) as I once realized that in C:S, I am only building cities/infrastructure to watch the trains... and not building the actual city. So, the "schönbau" in tpf fits way better to my playstyle than it is intended to be in C:S.

    anyway. Enjoy gaming! And maybe we even get a mod here and there from you :S;):saint:.