How to implement an Age Slider for a Vehicle Asset Construction?

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


  • Hi All,

    I am creating an asset construction for my Mark 2 Coaches mod for Transport Fever 3 which will allow users to place the vehicles as assets. The Construction file is already functional with several configurable parameters, e.g. livery, incline etc. However, I would like the user to be able to set how old the vehicle is (i.e. how rusty it appears) using a slider. I'm not sure how to reflect this in the rendered model and it isn't shown on the wiki. Is this possible? If so, how can I implement this?

    Many thanks in advance!
    Avro (PlaneSimple)

  • Code
            dirt_rust = {
                dirtColor = { 0.18, 0.15, 0.11, },
                dirtOpacity = 0.08,
                dirtScale = 5,
                rustColor = { 0.22, 0.12, 0.1, },
                rustOpacity = 0.2,
                rustScale = 4,
                age = 1.0
            },

    In Transport Fever 2 konnte man das age im material einstellen. Die mtl und mdl werden aber nur einmalig beim Spielstart geladen wenn du also einen Slider mit 1-10 machen möchtest, brauchst du 10 mtl und 10 mdl

    Wie gesagt in TPF2 hat das so funktioniert. In TPF3 habe ich es noch nicht probiert.... aber Versuch macht kluch.

  • Materials are static in 3 just the same as they were in 2: they are read once only. With 10 materials though, You might try to hand a selected age to one single .mdl in a variable named e. g. age and then call the required material by a line like materials = { "avro_mod_3::/exampledirectory/mat/mod_"..age..".mtl", },


    This has not yet been tested, but I would rate the probability for success greater than 0.