[APP] Improved VehicleDebug APP

Discussion in 'User Interface Apps' started by Davidbc, Jun 23, 2014.

  1. Davidbc

    Davidbc
    Expand Collapse

    Joined:
    Mar 20, 2013
    Messages:
    1,333
    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 ;)

    ImprovedVDBUG.jpg

    To install this, just drag and drop the contents of the .zip into: \alpha_prerace\html\apps\VehicleDebug and overwrite all files.

    Untitled.jpg

    Enjoy :D

    This app now comes with the game, just update the game to get it :D
     
    #1 Davidbc, Jun 23, 2014
    Last edited: Jun 30, 2014
  2. DrowsySam

    DrowsySam
    Expand Collapse

    Joined:
    Jul 30, 2013
    Messages:
    996
    Sweet mod :) We really need an apps sub-forum, I'll hit tdev up about that now..
     
  3. Davidbc

    Davidbc
    Expand Collapse

    Joined:
    Mar 20, 2013
    Messages:
    1,333
    Yeah, I wasn't sure where to post this.
     
  4. shockwaffleman

    shockwaffleman
    Expand Collapse

    Joined:
    Aug 15, 2013
    Messages:
    152
    This is what I've been hoping for. Thank you :)
     
  5. RobertGracie

    RobertGracie
    Expand Collapse

    Joined:
    Oct 15, 2013
    Messages:
    3,780
    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?
     
  6. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,031
    congrats to first thread in brand-new subforum :)
     
  7. garyjpaterson

    garyjpaterson
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    273
    Just what i came here to say.
     
  8. Rydog106

    Rydog106
    Expand Collapse

    Joined:
    Jul 8, 2013
    Messages:
    173
    Dumb question but how do I bring up debug things
     
  9. Davidbc

    Davidbc
    Expand Collapse

    Joined:
    Mar 20, 2013
    Messages:
    1,333
    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.
     
  10. theshark

    theshark
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    137
    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 ^
     
  11. Davidbc

    Davidbc
    Expand Collapse

    Joined:
    Mar 20, 2013
    Messages:
    1,333
    So what exactly does that thing?
     
  12. theshark

    theshark
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    137
    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"]
     
    #12 theshark, Jun 23, 2014
    Last edited: Jun 23, 2014
  13. RobertGracie

    RobertGracie
    Expand Collapse

    Joined:
    Oct 15, 2013
    Messages:
    3,780
    Thanks for taking a look into it...I am sure there is an inverse function of the deflate command somewhere....
     
  14. theshark

    theshark
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    137
    I actually stole your idea and added that functionality to the official app, hope that's ok :)
     
  15. Davidbc

    Davidbc
    Expand Collapse

    Joined:
    Mar 20, 2013
    Messages:
    1,333
    Yeah no problem:p
     
  16. RobertGracie

    RobertGracie
    Expand Collapse

    Joined:
    Oct 15, 2013
    Messages:
    3,780
    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?
     
  17. Davidbc

    Davidbc
    Expand Collapse

    Joined:
    Mar 20, 2013
    Messages:
    1,333
    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.
     
  18. RobertGracie

    RobertGracie
    Expand Collapse

    Joined:
    Oct 15, 2013
    Messages:
    3,780

    Do that when you get back from your Exams and also good luck in them :)
     
  19. buckmaster23

    buckmaster23
    Expand Collapse

    Joined:
    Jan 7, 2014
    Messages:
    4
    i cant find where to drop these files for the mod to work. can someone help me please, thank you
     
  20. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    install location is in the OP
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice