I've been wanting to manipulate the wastegate limits of the turbocharger systems based on the current gear the car is in with lua, yet having taken a fiddle with some lua cant for the life of me work out how to actually set or retrieve the values. Code: local M = {} local function onInit() end local function updateGFX(dt) turbo = v.data.turbocharger if drivetrain.gear == 1 then print "Gear 1" turbo.wastegateStart --print v.data.turbocharger.wastegateStart end if turbo ~= nil then print "We Have TURBO!!!" end end -- public interface M.onInit = onInit M.updateGFX = updateGFX return M commenting out turbo.wastegateStart allows the script to run, uncommenting it, spams the console with errors about a reference to drivetrain. I'm lost now. All I really wanted to do was halve the allowed wastegate pressures when in gears 1 and 2
this is a little beyond me with the language used, you need a general understanding of coding I know that much but I would have to read the code and understand it first and that takes a few days for information like that to sink in...
I practically have a degree in programming, this is nothing to do with the language or my lack of skill for programming in general (for reference, plenty of lua experience thanks...) but a question of how the specific API works.
Ahh I dont have that skills that you do I have more hardware related skills myself and I have built and maintained a server and done far more with that with software, oh I didnt realise man but APIs are a bit of a niggle for me but I will work on it
Considering how blindly you answer peoples hardware questions, I couldnt call you a hardware guy either... The blind answering to questions is at best simple annoying spam and at worst outright malicious
The drivetrain is a part of the vehicle lua. Something like scenetree.thePlayer:queueLuaCommand('drivetrain.gear = 1;') might work. I don't think it's currently possible to make any of your own scripts part of the vehicle lua without changing game files.
I'm not sure why you're getting errors about the drivetrain then. Still, the wastegateStart variable isn't actually part of the public interface of the turbocharger module, and as such isn't accessible from other scripts.
@SixSixSevenSeven A little OT, but is what you are trying to do realistic? What are you doing on line 10? Do you mean to be doing print(turbo.wastegateStart) ? Is this some sort of lua thing where mentioning a variable should print/echo it or what? It looks like you declare turbo as a global variable rather than local. Am I misunderstanding? I don't think you should be doing that.
Just now saw this. At this point it's not possible to change the turbo related parameters on the fly, such an API simply does not exist. Why would you want to do this?
Of course I can't answer for 6677 but I think he would like to reduce boost in first and second gear to reduce wheelspin and improve drivability of high horsepower turbocharged cars like some (modified) cars do IRL as well.
look up something called boost by gear for a tuning solution called hondata. it helps make only the power you can effectively put down only letting you get full boost in the upper gears. if you have a 500whp honda its a big help.
hondata aren't the only ones. Just about every aftermarket standalone ecu offers such a facility. but yes. Was after boost per gear which can be a great aid to dumping large amounts of horsepower in certain vehicles. The mcm daisy build is one example
Hondata is merely what I have personal experience with. They also have an after market traction control with a knob that allows you to actually dial on how much wheel spin you want to allow. Considering it isn't a true stand alone unit like the AEM ems, it's probably one of the best bangs for the buck possible. You can also wire your wide band and boost Guage to it and data log and adjust fuel and boost maps on the fly. Not bad for a solder in board installed for 500 usd. Boost by gear, because your LSD isn't enough. It even has Bluetooth for android or laptop.
As I'm the guy who coded most of the turbo code, I believe that it's not possible to change data on the fly for the moment. I'm planing to work on updating parameters on the fly in the future for the same situations as you have. E.g: Changing engine modes, from normal to sport, wastegate real time update depending on the user input and stuff like that...