Spawned ped taller due to high-heels - How do I mitigate it?

What I’m doing:

Spawning a ped (either mp_f_freemode_01 or mp_m_freemode_01) in a specific location playing a looped idle animation.

My issue:

The male ped works fine due to not being able to wear high-heels, however the female ped can wear them, changing the body height, screwing with the alignment. See attached gif for details:

example

My question:

Am I able to simply use a Native/read a specific flag, or would I have to go the more complicated way of getting the shoe type and keep a list of which shoes change height, then deduct the height from the coords I’m spawning the ped at?

I doubt that using GetEntityBonePosition_2 would work accurately since I’d have to wait until the ped is in position, loaded the animation and has fully transitioned to the idle animation, but if any of you come up with a way to go about it I’ll be happy to try it out!

You could try to disable the ped’s collision and freeze it like so:

SetEntityCollision(ped, true, false)
FreezeEntityPosition(ped, false)

However, if collisions (for the ped) does matter in your instance, then this of course isn’t a reliable solution. Now, I must say I haven’t tested this with heels, so it might not work as I think.

Sadly doesn’t work. I guess I should provide an example of my code:

CreateThread(function()
	local newPed = CreatePed(0, "mp_f_freemode_01", vector3(2323.55, -2099.73, 5.58), -95.25, false, true)

	SetEntityAsMissionEntity(newPed)
	TaskSetBlockingOfNonTemporaryEvents(newPed, true)
	FreezeEntityPosition(newPed, true)
	SetEntityInvincible(newPed, true)
	SetEntityCollision(newPed, false)
	SetEntityCoordsNoOffset(newPed, vector3(2323.55, -2099.73, 5.58), false, false, false)
	SetEntityRotation(newPed, vector3(0.0, 0.0, -95.25))

	Wait(0)

	local aDict = "amb@world_human_seat_wall@female@hands_by_sides@base"
	RequestAnimDict(aDict)
	while not HasAnimDictLoaded(aDict) do Wait(0) end

	TaskPlayAnim(newPed, aDict, "base", 8.0, 8.0, -1, 1, 1.0, true, true, true)

	RemoveAnimDict(aDict)
end)

Since I have a Lua table with all peds that need to be spawned including their respective animations (and later clothes too) I will probably just attempt to check for heels and deduct the height if the animation would require it, since the height doesn’t need to be deducted when standing.

Regardless, thanks for your input!

Well, is it not possible for you to move the character slightly when heels are detected? I am no expert when it comes to something like this but idk, thought that counts.

Hm… I’ve done some more “research”, seems like the ped’s height changes, so there probably exists a flag somewhere for it. However, the easiest way (unless you want to dig around the internet for the next year or so) is just to make a list of the shoes that have high heels like so:

local highHeels = {
    [0] = true,
    [6] = true,
    [7] = true,
    [8] = true,
    [12] = true,
    [14] = true,
    [18] = true,
    [19] = true,
    [20] = true,
    [22] = true,
    [23] = true,
    [30] = true,
    [41] = true,
    [42] = true,
    [43] = true,
    [44] = true,
}

And then just do a table lookup to see if the current ped has any of these shoes.

local function DoesPedHaveHighHeels(ped)
    local shoe = GetPedDrawableVariation(ped, 6)
    if highHeels[shoe] then
        return true
    else
        return false
    end
end
if DoesPedHaveHighHeels(newPed) then
    print("ped has high heels!")
end

From what I tested it seems like all the heels are of the same height, so if the ped has heels just reduce the zCoord by -0.10.

Edit: The height seems to be slightly different from shoe to shoe, I used -0.08 in this example and it seems to work almost fine.

Replying to this just in case anyone needs this.

A friend of mine told me that using GetPedConfigFlag() works to detect high-heels and with the following code, just changing the shoes on the own model works to detect them:

local oldFlag = tostring(GetPedConfigFlag(PlayerPedId(), 322, false))
local newFlag = oldFlag
CreateThread(function()
	while true do
		Wait(0)
		newFlag = tostring(GetPedConfigFlag(PlayerPedId(), 322, false))
		if newFlag ~= oldFlag then
			print("Heels flag changed | Old: " .. oldFlag .. " | New: " .. newFlag)
			oldFlag = newFlag
		end
	end
end)

While this might help someone else, for my code it won’t exactly work (due to animations sometimes being standing animations which don’t require the height offset) but it’s easy to incorporate this native with your code examples, hence I’m leaving your answer as the solution.