Adding or replacing existing pedcols.dat settings


This page explains how you can create your own pedcols.dat files for your server, be it to add ped colors for your DL skins or to replace existing pedcols.dat settings..


Using appropriate material colors on your model

As is the case with vehicles, please make sure you tell the game which parts of your model are colorable. You can do this by using the following material colors:


Material color Used for
#3cff00 The game will will use the ped's current primary color to paint all faces that use this material.
#ff00af The game will will use the ped's current secondary color to paint all faces that use this material.
#00ffff The game will will use the ped's current tertiary color to paint all faces that use this material.
#ff00ff The game will will use the ped's current quaternary color to paint all faces that use this material.

Mapping regions on your ped with standard materials using this color is not necessary, but you should at least map all the areas with a standard material using the primary color material color. Of course - if you are a vehicle modder none of this should be new to you, as this step of the process is known by pretty much all vehicle modders out there. Neither UG nor UG-MP really deviate from this process and have kept it the same for the ped coloring system1


Overview of pedcols.dat

As is the case with other data files which allow you to replace existing lines, it is highly recommended to work with an empty pedcols.dat file. Only the files you place in your pedcols.dat file really affect the game, so copypasting the stock GTA:UG pedcols.dat file for your server is not necessary. A clean pedcols.dat file looks like this:

# This is an empty pedcols.dat file.
ped
end

Adding new pedcols.dat lines

Working with pedcols.dat files is incredibly simple and straightforward. Most peds will have their pedcols.dat entries stored in the ped section. This section allows you to specify color variations with a primary, secondary, tertiary, and quaternary color ID. You can find these here. The ped coloring system therefore does not offer two separate file sections like the car coloring system does. Here's how a simple pedcols.dat line looks like:

ped
Ped name, Primary color 1,Secondary color 1,Tertiary color 1,Quaternary color 1, Primary color 2,Secondary color 2,Tertiary color 2,Quaternary color 2 ...
end

Each line must start with a valid model name, and what follows is a variable number of primary, secondary, tertiary, and quaternary colors variations. As you can tell, neither the primary, secondary, tertiary, or quaternary colors are random at all; they are instead linked together. Let's assume we have the following pedcols.dat entry:


ped
myskin, 127,6,1,0, 5,8,6,3
end

In this case our custom skin has two color variations. If the game spawns our ped for the first time, it uses the first color variation, and the ped will thus spawn with the colors from the first variation. If the game spawns our ped for the second time, it uses the second color variation, and the ped will spawn with the colors from the second variation. After reaching the final color variation, the game picks variation 0 again the next time around. So as you can see, there's no randomness to this process at all. You have a lot of control while the colors the game picks are quite predictable.

In the case of UG-MP this process is still bugged, but this will be fixed soon.


Replacing pedcols.dat lines

Now that we know how to add new pedcols.dat entries, it's time to try and replace some existing lines. The way you do this is essentially the same as when you add new lines - the only difference is that we need to get the model name of the ped whose pedcols.dat line should be replaced. You can obtain this by browsing the peds.ide file in the data folder in your game installation directory. You may replace a pedcols.dat line multiple times - however once you call RemoveDataFile the initial settings will be restored. In other words, the first pedcols.dat line that was added.


Making the game load your custom pedcols.dat file

Now that we've added our pedcols.dat lines, it's time to tell the file loader as well as our downloader about our new file. We will assume that the file is stored under assets/pedcoldl-test/pedcoldl-test.dat in this example.

With that said, your assets.json should look like this:

[
    ...
	{
		"name": "Pedcol DL - Test for pedcol DL",
		"author": "dkluin",
		"type": "pedcols",
		"files": [
			"pedcoldl-test/pedcoldl-test.dat"
		]
	}    
]

...and our OnGameModeInit like this:

public OnGameModeInit()
{
    ...

    // Tell the file loader about our pedcols.dat file
    AddDataFile("pedcoldl-test/pedcoldl-test.dat", DATAFILE_PEDCOLSETS);
    return 1;
}

After following these steps you may restart your server to see the changes.