Adding new peds through ped DL


This page explains how to add new peds (or skins) through ped DL on UG-MP.

Adding a new ped model is very simple. You can do this by either using IDE files or by using AddPedModel. As always, the scripting native uses parameters that closely match that of an IDE:peds entry. You can make things easier by copying an existing peds.ide line and using its settings as parameters to AddPedModel, modifying them as you see fit.

We will explore both the scripting approach and the IDE approach on this page. Our ped will be added on ID 74, which is a free ID in Snapshot 4.2, and we will assume that the ped model and IDE are stored in the assets/peddl-test folder. All file names in this example start with peddl-test.


The scripting approach

The first step is informing the downloader about our new ped/skin. Your assets.json should look like this:

[
    ...
	{
		"name": "Ped DL - Test for ped DL",
		"author": "dkluin",
		"type": "peds",
		"files": [
			"peddl-test/peddl-test.dff",
            "peddl-test/peddl-test.txd"
		]
	}    
]

Now that the downloader knows about our ped, we'll just need to tell the file loader about it. As always, we're working from OnGameModeInit.

public OnGameModeInit()
{
    ...

    // Tell the file loader about our new ped model
    AddPedModel(74, "peddl-test", "peddl-test", "STAT_STREET_GUY", PED_TYPE_CIVMALE, "man", "null", 0x1003, 0, 1, 4);
    return 1;
}

The IDE approach

The first step is setting up our IDE file in the appropriate location. Our IDE file will look like this:

peds
74, peddl-test, peddl-test, CIVMALE, STAT_SENSIBLE_GUY, man, 1003, 0, null, 1, 4, PED_TYPE_GEN, VOICE_GEN_NOVOICE, VOICE_GEN_NOVOICE
end

One thing to note is that because DL is designed to be as friendly to stock GTA:SA files as possible we will still have to follow the full IDE:peds format. When calling AddPedModel, the game is programmed to not apply any voice lines to DL peds. The last three voice columns in our IDE line are also going to be ignored, so we will give it the NOVOICE settings, which is what the game will use as well.

Now that we have our IDE file set up, we can update assets.json accordingly:

[
    ...
	{
		"name": "Ped DL - Test for ped DL",
		"author": "dkluin",
		"type": "peds",
		"files": [
            "peddl-test/peddl-test.ide",
			"peddl-test/peddl-test.dff",
            "peddl-test/peddl-test.txd"
		]
	}    
]

The final step would be to use AddIDE to make the game load our IDE. Remember that calling AddPedModel separately is not necessary as we already provided all information through an IDE file.

Our OnGameModeInit will look like this:

public OnGameModeInit()
{
    ...

    // Tell the file loader about our IDE, which defines our new ped model
    AddIDE("peddl-test/peddl-test.ide");
    return 1;
}

Wrapping up

Now that we've added our new ped/skin you can restart the server and see what happens. If you are interested in adding ped colors for your models you can find out how by clicking here.