Is it possible to set electrics.values from within the javascript? My car has a dashboard menu system, this has been created in JavaScript inside the HTML file. I was wanting to add in cruise control and hill descent assist. I have tried returning values from the JavaScript but wasn't able to get that to work. Maybe there is some pointer/passByRef magic that can be done? If it isn't possible its not too big of a deal, I can move all the logic into Lua and make everything a function call to JavaScript. Just a little more work that way. On a slight side note, do function calls from Lua to JavaScript pose any performance issues? Cheers for any help
To set electric value you can do this Code: bngApi.activeObjectLua('electrics.values.potatoes = 1'); but what you should do is: yourVehicule/lua/yourModule.lua Code: bngApi.activeObjectLua( 'yourModule.setCC(' + speed + ')' ); there will be not much performance issue because commands are queued. There will be a small delay but not much The Cruise control logic should be in the lua side because it will have the latest values from the car