Alrighty, I see how it is structured... It's like a pc file. Code: "part", "part", "part" etc But it doesn't sort it by what part it belongs to. It's scrambled. I need some help. The problem is that I know how to code the basic lua logic, but I don't know how to code BeamNG lua. It's not clear to me, and I'm not using that outdated wiki again.[/QUOTE] I'm not sure what you mean but I ended up coding it for you: Code: local M = {} local function rolldice() print("if you see this in console that means this works") --Gets vehicle's name local carname = be:getPlayerVehicle(0):getJBeamFilename() local config = extensions.core_vehicle_partmgmt.getConfig() --Get all slots local all_slots = require('jbeam/io').getAvailableSlotMap(extensions.core_vehicle_manager.getPlayerVehicleData().ioCtx) --Cycle through each slot for slot_name, curr_part in pairs(config.parts) do local parts_for_slot = all_slots[slot_name] if parts_for_slot then --table.insert(parts_for_slot, "") --Get random part local keyset = {} for k in pairs(parts_for_slot) do table.insert(keyset, k) end local random_part = parts_for_slot[keyset[math.random(#keyset)]] --print(random_part) config.parts[slot_name] = random_part end end extensions.core_vehicle_partmgmt.setPartsConfig(config.parts, true) end M.rolldice = rolldice return M
sure @bread for button and a big big thanks to @angelo234 for the coding also works with mods, but it might not work with some This is the original mod. Anywhere else is not the original, it's been stolen.
Thank you, this is what it generated for me for the first time: It picked the weakest engine setup possible but with the strongest nitrous possible so it blows up when using nitrous, it has a drag radiator, wheelie bar and front drag wheels and brakes but it's RWD and very slow, on the rear it has half hillclimb half stock suspension and Hirochi wheels, and apparently it's a police car because it has a police livery (but purple) and a beacon light covered by a roof box. I can confirm it uses stuff from my mods too, it has the car jump system I was working on. Simple but amazing mod. Second time I got a drift police car: For the ETK 800 it usually just generates stuff that causes LUA error or can't drive at all. For the Barstow, however, it gave me a car straight from a zombie apocalypse: For the Bluebuck i got a derby taxi: Can't do anything interesting for the Bolide, but it made a Rally Driver School Covet: And a cursed Vivace-Tograc hybrid that also has JATO: It made a beater Grand Marshal too... Wide wheelbase I-Series without widebody... It has the same issues with K-Series as with ETK 800, but for the LeGran it works flawlessly, it made me something that resembles the skidplate Covet in a way: It made a Miramar that looks like the rally Lada I made with Lada Car Pack a few months ago, even has the same no texture license plate: For the Sunburst it made a rally police: It works the best on the D-Series, it made the... what? Beater police prerunner? And also the square wheels police??? It made a derby bus with a cape, ram plow, window bars, locking diff and nitrous: For the H-Series it made something i have seen in CrashHard's video except it was a D-Series: For the Roamer, I don't even know... For the new Pessima it made the worst sounding car ever that hurts ears, and for the old one it made a car that doesn't drive, for the Piccolina it added JATO, for the Pigeon it added a welded diff and stabilizers so it can drift, for the SBR4 it made the second worst sounding car ever, for the Burnside it made a very funny sounding suspension due to a weird bug, for the Wendover it made a race car with the slowest engine possible with JATO, it made a drift Hopper, and for the T-Series it just kept giving me normal ones. I'm scared of what it will do for mod cars... --- Post updated --- It works weird with the Gavril Vertex, it didn't want to work for some time, then it generated a car that explodes on spawn, and then... this
Hi @umustbeloggedintododat! Share this mod on the repo is highly recommended. Now your mod just has 52 views but when it upload it on the repo, thousands of people will download it. (It's just a suggestion)
Ok. Btw I found an issue, can you please update it and solve it? Sometimes cars spawn with diesel engine but with gasoline fuel tank or cars spawn with gasoline engine but with diesel fuel tank, or electric engines spawn with gasoline fuel tank. Can you solve this problem?