How to set custom texture and colours
a_c_horse_arabian_white
:
Place only YTD files into ‘stream’ folder (it should replace texture/skin pattern).
Default in-game horse will look like this, only texture pattern has changed:
You have to set custom colours somehow. It can be done by new YMT file as originally is made in modded horse, but in RedM I don’t know how to stream custom YMT for default horses. Therefor, I use script instead. Use next script to spawn the horse (/horse
):
-- client.lua
function GetLastMount(ped)
return Citizen.InvokeNative(0x4C8B59171957BCF7, ped)
end
function SetMetaPedTag(ped, drawable, albedo, normal, material, palette, tint0, tint1, tint2)
Citizen.InvokeNative(0xBC6DF00D7A4A6819, ped, drawable, albedo, normal, material, palette, tint0, tint1, tint2)
end
function IsPedReadyToRender(ped)
return Citizen.InvokeNative(0xA0BC8FAED8CFEB3C, ped)
end
function UpdatePedVariation(ped)
Citizen.InvokeNative(0xAAB86462966168CE, ped, true)
Citizen.InvokeNative(0xCC8CA3E88256E58F, ped, false, true, true, true, false)
end
function GetMetaPedAssetGuids(ped, index)
return Citizen.InvokeNative(0xA9C28516A6DC9D56, ped, index)
end
function SetPedAsSaddleHorseForPlayer(player, mount)
Citizen.InvokeNative(0xD2CB0FB0FDCB473D, player, mount)
end
function BlipAddForEntity(blipHash, entity)
return Citizen.InvokeNative(0x23F74C2FDA6E7C61, blipHash, entity)
end
RegisterCommand('horse', function(source, args)
local model = `a_c_horse_arabian_white`
RequestModel(model)
while not HasModelLoaded(model) do
Wait(0)
end
local coords = GetEntityCoords(PlayerPedId())
local currentMount = CreatePed(model, coords.x, coords.y, coords.z, 0, true, true, true, true)
SetModelAsNoLongerNeeded(model)
SetPedOutfitPreset(currentMount, 0, 0)
SetPedAsSaddleHorseForPlayer(PlayerId(), currentMount)
SetPedConfigFlag(currentMount, 297, true) -- Enable leading
SetPedConfigFlag(currentMount, 312, true) -- Won't flee when shooting
SetPedConfigFlag(currentMount, 442, true) -- Remove Flee prompt
BlipAddForEntity(-1230993421, currentMount)
while not IsPedReadyToRender(currentMount) do
Wait(0)
end
-- head
local tint0, tint1, tint2 = 47, 0, 194
local drawable = `p_c_horse_01_head_000`
local albedo = `p_c_horse_01_head_000_c0_879_ab`
local normal = `p_c_horse_01_head_000_c0_000_nm`
local material = `p_c_horse_01_head_000_c0_000_m`
local palette = `metaped_tint_horse`
SetMetaPedTag(currentMount, drawable, albedo, normal, material, palette, tint0, tint1, tint2)
UpdatePedVariation(currentMount)
-- body
local tint0, tint1, tint2 = 47, 0, 194
local drawable = `p_c_horse_01_hand_000`
local albedo = `p_c_horse_01_hand_000_c0_879_ab`
local normal = `p_c_horse_01_hand_000_c0_000_nm`
local material = `p_c_horse_01_hand_000_c0_000_m`
local palette = `metaped_tint_horse`
SetMetaPedTag(currentMount, drawable, albedo, normal, material, palette, tint0, tint1, tint2)
UpdatePedVariation(currentMount)
end)
As the result:
In the script you have to set proper names for drawable, albedo, normal, material and tint colours, as you would set it in custom YMT.