Hi everyone, im trying to apply the ped overlay in C++ i have read and tried these:
rdr3_discoveries/clothes/change_overlays_script.lua at master · femga/rdr3_discoveries · GitHub
Heres my code:
int componentNum = PED::_GET_NUM_COMPONENTS_IN_PED(playerPed);
Hash targetCategory = MISC::GET_HASH_KEY("heads");
int componentIndex = -1;
for (int i = 0; i < componentNum; i++) {
Any componentCategory = PED::_0x9B90842304C938A7(playerPed, i, 0);
//UIUtil::PrintSubtitle("componentCategory " + std::to_string(componentCategory));
//WAIT(300);
if (componentCategory == targetCategory)
{
componentIndex = i;
}
}
// 1. Declare the variables to hold the results
Hash drawable, albedo, normal, material;
//// 2. Pass the addresses of those variables using &
BOOL success = PED::GET_META_PED_ASSET_GUIDS(playerPed, componentIndex, &drawable, &albedo, &normal, &material);
//// 3. Use the values
if (success) {
// Example: Print or compare the hashes
UIUtil::PrintSubtitle("drawable " + std::to_string(drawable)
+ " albedo " + std::to_string(albedo)
+ " normal " + std::to_string(normal)
+ " material " + std::to_string(material)
);
}
//mp_u_faov_lipstick_000_ab",normal="mp_u_faov_lipstick_000_nm",ma="mp_u_faov_lipstick_000_ma",},
//Hash textureHashID = 0x887E11E0;
////change to id not albedo ?
//Hash normalName = MISC::GET_HASH_KEY("mp_u_faov_lipstick_000_nm");
//Hash materialName = MISC::GET_HASH_KEY("mp_u_faov_lipstick_000_ma");
Hash textureHashID = 0x887E11E0;
Hash normalName = 0;
Hash materialName = 0;
int textureID = PED::_REQUEST_TEXTURE(albedo, normal, material);
int overlayID = PED::_ADD_TEXTURE_LAYER(textureID,
//albedoName,
textureHashID,
normalName,
materialName,
/* MISC::GET_HASH_KEY("mp_u_faov_lipstick_000_nm"),
MISC::GET_HASH_KEY("mp_u_faov_lipstick_000_ma"),*/
0, 1.0, 0);
PED::_SET_TEXTURE_LAYER_PALLETE(textureID, overlayID, 0x3F6E70FF);
PED::_SET_TEXTURE_LAYER_TINT(textureID, overlayID, 100, 110,120 );
PED::_SET_TEXTURE_LAYER_SHEET_GRID_INDEX(textureID, overlayID, 2);
PED::_SET_TEXTURE_LAYER_ALPHA(textureID, overlayID, 1.0f);
while(!PED::_IS_TEXTURE_VALID(textureID)) {
WAIT(0);
}
PED::_APPLY_TEXTURE_ON_PED(playerPed, MISC::GET_HASH_KEY("heads"), textureID);
PED::_UPDATE_PED_TEXTURE(textureID);
PED::_0xAAB86462966168CE(playerPed,0);
PED::_UPDATE_PED_VARIATION(playerPed, 0, 1, 1, 1, false);
im trying to apply lipstick to my character (only that for now), and i got textureId which is always 65536, overlayID is 1
i have no idea what its wrong or missing here. Nothing shows up.
If u have any ideas, solutions, i would love to hear them
Thank you