itsjustcurtis / MenyooSP

[or Menyoo PC] - Trainer/mod menu for Grand Theft Auto V (single-player).
https://www.gta5-mods.com/scripts/menyoo-2-0
GNU General Public License v3.0
44 stars 8 forks source link

game crashes on ped model change & random clothes #8

Open katsutosh opened 7 months ago

katsutosh commented 7 months ago

If the ped got gen9 clothes via SET_PED_RANDOM_COMPONENT_VARIATION & SET_PED_RANDOM_PROPS the game crashes.

On ped model change we can use SET_PED_DEFAULT_COMPONENT_VARIATION instead of SET_PED_RANDOM_COMPONENT_VARIATION.

For the random function we need to write our own but there is no native from R* to check if the clothes gen9 exclusive. FiveM has his own extra native to check if it's gen9 clothes (https://github.com/citizenfx/fivem/blob/master/code/components/extra-natives-five/src/PedExtraNatives.cpp#L79) i don't know how we can implement this (no experience in memory stuff)

the easier way is: temporary disable the random clothes functions and write our function later or another way: we can try to set the component and check if the ped has this component, if not -> try other number (identical to the endless scroll fix of ped clothes)

metoxys commented 7 months ago

Is this issue also happening if you modified your dlclist.xml in advance to get rid of the g9ec placeholders?

itsjustcurtis commented 7 months ago

@metoxys if the lines are commented out of dlclist then the game will never load the files; menyoo will be unable to see them. However, we cannot expect players to do this themselves and we will need to protect them from it.

Two methods I see: 1) As Andy suggested, disabling the random ped variation (I do have a local commit of this from my old fork, easily implemented) 2) Hardcode the known problematic items to be ignored entirely by Menyoo (I would prefer to avoid this)

itsjustcurtis commented 7 months ago

I would like to find a way to interrogate dlc names to identify any gen9 packs and ignore them completely in Menyoo. There are a number of areas this affects and currently only vehicles can be protected with the dedicated native.

WithLithum commented 6 months ago

FiveM has his own extra native to check if it's gen9 clothes

As a general caution, be careful with the FiveM code because R* updated the PSA and I don't see any grants on the reuse of source code material.