Editing Vanilla Pedestrians

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


  • Greetings everyone,


    I have a question about this excerpt from the Wiki:


    "The character models are located in res/models/model/characters/ and identified by a special metadata block.

    Metadata

    The model files consist of the following parts:

    Code
    function data()
    return {  -- bounding box  -- collider  -- levels of detail  metadata = {    availability = {      yearFrom = 1850,      yearTo = 1920,    },    colorConfig = {      configs = {
    	{
    	  { 0.72, 0.70, 0.65, },
    	  { 0.40, 0.36, 0.34, },
    	  { 0.62, 0.60, 0.58, },
    	  { 0.81, 0.67, 0.63, },
    	},        ...      },    },    person = {      drivingLicenses = { "WATER", },      gender = "FEMALE",    },  },  version = 1,
    }
    end

    Character models can be recolored to get more diversity in the game world. The colorConfig block contains a list named configs that consists of a list of configuration blocks. As the character models use a material with a four-channel color blend map, each of the blocks has a set of 4 different colors with three values for the three color channels red, green and blue in a range of 0 to 1."


    After reading this, I understand the decimals are just RGB 255 values divided by 255.


    What I don't understand is how to edit this file. This file is inside a .zip folder in the "res/models/model/", but surely the game can't be executing the model file while it is zipped up. How do I edit the copy of the file that the game is executing?


    The end goal is to recolor the vanilla people in the game.


    Thanks to anyone who can help.

  • You would need to create a mod if you want to add custom pedestrians/models.

    Read the wiki to understand how Mods work by overwriting files in a virtual file system. For this it does not matter if files are zipped. (You could even unzip them in the game directory)


    HOWEVER, be careful if you edit or add "person" models. The past has shown that this can trigger mod issues when person mdls are removed from a savegame or change properties during a savegame.

  • Generally, the game will assign higher priority to mod files than its own ones. So if You prepare a modified duplicate of a vanilla file and offer it to the game under the same name and in the same directory structure (albeit, of course, within the mod directory), the game will prefer Your file if activated in the game.


    Of course, such an attack on the game files will often render the mod unsafe for removing from and, less often, adding to a running game - I can only concur with what VacuumTube has written.


    As to the fractions of 255: You can let the game do the calculations for You. It is very well possible to fill those curly brackets with fractions like {100/255, 75/255, 0/255} instead of the decimal figures You quoted above.

  • Many thanks.


    I will make a personal mod for this as you both stated.


    It appears the 4th color combo that is in a color config table determines the skin tone of the pedestrian. The other colors alter their clothing. All pedestrians and drivers load into the game using what is considered Colorconfig -1.


    Colorconfig (0 - 215) can be edited in the .mdl file for characters, however if you do this for a person that is a Driver (Rail, Water, Road) they never seem to take the other color config settings outside of "- 1" into account. I'm not sure how to edit the -1 Colorconfig values because they are not mentioned in any of the files or the wiki.


    I know the colors work because they appear in the Model Editor, however you can't choose the colorconfig at will while in-game.


    Please see visual aid below:


    This picture is of Color Config -1 which is the default one chosen by the game.



    This second picture is of Colorconfig 0 which is the first colorconfig set that can be altered in the .mdl.


    In the model editor, you can choose it by going to Metadata elements and altering the colors there. These colors are the same values that appear in the .mdl.


    With that said, does anyone know how to force Drivers to use another Colorconfig setting IN-GAME?


    Thank You to anyone who can assist! I know this appears to be uncharted territory as there is very little reading material on this matter, however the Wiki speaks of editing people as though it was a simple task which it is proving otherwise thus far.

  • So an update to this. I figured out how to get the texture that I modified to appear.


    I had to add a line of code into the "era_c_driver_rail.mtl"; specifically in the


    "map_albedo = {" area of the code.


    I added "minfilter = "LINEAR","


    and the correct color finally shows in model editor without touching any settings. This means it should show up in game like this.


    No idea how to force a colorconfig set for driver still, but at least my texture is being shown now and that was the true end goal.


    Now, in order to set one of the colorconfigs to the driver, Copy one of the colorconfigs from the .mdl, and put their values directly into the .mtl within the function "Colors = { },


    One entire colorconfig set should be within the brackets of "Colors" in the same format from the wiki. Example is below:

    { 0.72, 0.70, 0.65, },

    { 0.40, 0.36, 0.34, },

    { 0.62, 0.60, 0.58, },

    { 0.81, 0.67, 0.63, },


    Therefore, the finished "Colors" code in the .mtl should look like this:


    "Colors = {

    { 0.72, 0.70, 0.65, },

    { 0.40, 0.36, 0.34, },

    { 0.62, 0.60, 0.58, },

    { 0.81, 0.67, 0.63, },

    },"

    I'm posting this solution here just in case someone else in the future wants to do this and has no clue what their doing.


    Now a separate mod can be created!

BlueBrixx