so I want to get the name of the tire part (not RR/RL/ETC) as a string so I can find the type of tire on the specific wheel. I tried checking dump(M.Wheels) but it doesnt seem to store the part names. I can get stuff like the pressure group or tread nodes, but I dont know if those are able to resolve the name. I feel like im being dumb and missing an obvious way.
This goes through the list of parts on the vehicle and finds the part name prefixed with "tire" and prints it (only works in Game Engine Lua). Code: for slot, part in pairs(extensions.core_vehicle_manager.getPlayerVehicleData().chosenParts) do if part:find("tire") then print(part) end end
Im currently at the vehicle level since im trying to assign this 'tire name' string to a custom variable that is on the tire itself, it would be run at the same time as init/resetting the wheel itself. Forgot to specify that my b
Hopefully this helps then: Code: for part, data in pairs(v.data.activeParts) do if part:find("tire") then print(data.information.name) end end
that indeed helped! there was some weirdness with the part names on the tire but my code ended up being Code: for part, data in pairs(v.data.activeParts) do if part:find("tire") then if part == wd.partOrigin:gsub("wheeldata", "tire") then print(data.information.name) rubber = data.information.name end end end the string is assigned and tracked with the tire and done once when wheels get init'd. Thanks for the help!