Random container selection for well car code?

Willkommen in der Transport Fever Community

Wir begrüßen euch in der Fan-Community zu den Spielen Transport Fever und Train Fever, den Wirtschaftssimulatoren von Urban Games. Die Community steht euch kostenlos zur Verfügung damit ihr euch über das Spiel austauschen und informieren könnt. Wir pflegen hier einen freundlichen und sachlichen Umgang untereinander und unser Team steht euch in allen Fragen gerne beiseite.

 

Die Registrierung und Nutzung ist selbstverständlich kostenlos.

 

Wir wünschen euch viel Spaß und hoffen auf rege Beteiligung.

Das Team der Transport-Fever Community


  • Greeting all,


    Just wondering if anyone can provide insight into a block of code that would randomly select a container from a pool I've made to go with my double stack well car? It's all in a single mod I'm just not sure how to have it randomly select one for the bottom and a different one for the top.


    Cheers

  • Ah beautiful, I'm getting there!


    Can you break what I'm looking at a little bit?


    Code
    {{capacity=150, customCargoModels={configurations={{slotLevels={ {}, {2}, {2,3}, {2,3,4}, {2,3,4,5}, }, },},},type="FUEL",}, }

    What does slotLevels refer to? Part of how it tells what combination to load where?


    Group = 21 refers to what? Many groups have the same number and different transf, I assume for front and rear and upper front and rear loading?


    ( apologies if I'm a bit slow, I usually just make locomotives. ;)


    Thank you so much for the help mate!

  • Ahh that helps! I *think* I follow, I'm going to go have a bit of an experiment with various combinations.


    Thank you for pointing in the right direction, as always. :)

  • Alright, I think I've got my head wrapped around this and have it loading a selection of random 40 foot Australian containers.


    Code
    {{capacity=150, customCargoModels={configurations={{slotLevels={ {}, {1}, {0,1}, },},},},type="GOODS",},},


    The only other question I have with this code is how can I make it load either 2 40' stacked or one 48' when full, randomly chosen? If I add it to the next entry, like so:


    Code
     {{capacity=150, customCargoModels={configurations={{slotLevels={ {}, {1}, {0,1}, {2}},},},},type="GOODS",},},

    It progesses through the single 40, the double 40 and onto the single 48, which I assume is what it's meant to do as it fills up. But I'd like either a single 48' or stacked 40's at random.


    I'm very happy with everything else so far. MaikC's code is top notch as always. :P


    Thanks so much for your time! :)


    Cheers

BlueBrixx