Hi, i am the creator of the mod "Siren and Horn Mod" but i have a problem: I would like to get the config of the vehicle that the player is driving but i don't find how to do... I tried this: local vehicleNames = scenetree.findClassObjects('BeamNGVehicle') for _, name in ipairs(vehicleNames) do local veh = scenetree.findObject(name) print(veh.partConfig) end but it return me all vehicle config, i want only the vehicle config the player is driving... Could you help me please ?
on lua vehicle you can do Code: v.userPartConfig It return an empty table if you haven't load a .PC if you are on the GE side you will have to get the vehicle and you should be able to do the same i didn't understood what you wanted at first, use the sample code up there
Thank you for you answer ! Okay but the table return me things like 0x61546. how to transform this "table" into a real string ? like "base.pc"
For instance to get the Paint Design / Skin Code: v.userPartConfig.paint_design --or v.userPartConfig["paint_design"]
for now you can't have the name of the configuration that is loaded. Next version will have it on the vehicle side. Code: partmgmt.pcPath
I FOUND obj:queueGameEngineLua("be:getPlayerVehicle(0):queueLuaCommand('drivingSounds.vehicleConfig = (\"'..be:getPlayerVehicle(0):getField('partConfig', '')..'\")')") print(drivingSounds.vehicleConfig)
Could you not ask for the same question twice? https://www.beamng.com/threads/get-player-vehicle-and-config-solved.42498/#post-639683 On pourrai avoir des reponces differentes et cela pourrait preter a confussion (pour toi ou quelqu'un qui fait des recherches) et puis c'est interdit de faire des doubles sujets.