I noticed that this particular APP would be better if you could deflate each tire individually and/or both front/rear tires at the same time, so I did it To install this, just drag and drop the contents of the .zip into: \alpha_prerace\html\apps\VehicleDebug and overwrite all files. Enjoy This app now comes with the game, just update the game to get it
I might give this a look....it seems a good App to work with I mean deflating all the tyres is fun but it lacks excitement....what about....you could reinflate the tyres after you have deflated them could you add that in to this App Davidbc?
I'm trying. I have to figure out exactly what the deflate function does so I can create a new function that would revert the changes and inflate the tires. I'm looking into it.
Just some ideas to improve the app: You could make it dynamic by utilizing the wheelInfo and the torqueCurve streams, torqueCurve to detect when the vehicle is changed, since it only updates when this happens, wheelInfo to get the name of the wheels. just add the strems to the list in your json and write a code similar to this: Code: VehicleDebug.prototype.update = function(streams){ if(streams.torqueCurve!== undefined){ // <- car/engine changed // delete the old buttons for(var i = 0; i < streams.wheelInfo.length; i++){ // <- go through all the wheels var wheel = streams.wheelInfo[i]; // generate the buttons } } }; ^ Code above is untested an written without editor ^
At the moment it does nothing at all, but it could be the start for dynamic buttons It detects if the vehicle has changed and goes through all the wheels so you can add buttons for them. Give me a few minutes, and i'll add the functionality -------------------------------------------- EDIT: Done Add this to the initialize function of the app.js: Code: this.dynamicButtonContainer = $('<div>TEEEEEEEEEEEEEEEST</div>').appendTo(this.rootElement); Add this to the app.js: Code: VehicleDebug.prototype.update = function(streams){ if(streams.torqueCurve!== undefined){ // <- car/engine changed console.log(this.dynamicButtonContainer); this.dynamicButtonContainer.empty(); // <- delete old Buttons var self = this; $.each(streams.wheelInfo, function(index, wheel) { // <- go through the wheels self.addDeflateButton(index, wheel[0]); }); } }; VehicleDebug.prototype.addDeflateButton = function(number, name){ $('<button>Deflate Tire '+name+'</button>').appendTo(this.dynamicButtonContainer).click(function(){ beamng.sendActiveObjectLua("beamstate.deflateTire("+number+")"); }); }; Change line 17 in app.json to: Code: "streams" : ["wheelInfo", "torqueCurve"]
Thanks for taking a look into it...I am sure there is an inverse function of the deflate command somewhere....
Could you expand the break points too make it so you can remove pieces of the bodywork one piece at a time or is that too much of a task to do?
The way it works I don't think so, but I still need to figure how everything works. Next week when I finish my exams.