How to create custom gauges?

Discussion in 'Mod Support' started by D-Force-UK, Jul 29, 2016.

  1. D-Force-UK

    D-Force-UK
    Expand Collapse

    Joined:
    Feb 9, 2014
    Messages:
    10
    Lately I've thought that the gauges of the cars in BeamNG lack something special, so I want to create my own. If anyone knows how to modify the standard gauges, please let me know, it would be greatly appreciated
     
  2. meywue

    meywue
    Expand Collapse
    Administrator
    BeamNG Team

    Joined:
    Nov 19, 2015
    Messages:
    339
    Hey,

    what's exactly your intention? Would you just like to modify the texture or would you rather changing the placement of the needles and stuff as well?
     
  3. D-Force-UK

    D-Force-UK
    Expand Collapse

    Joined:
    Feb 9, 2014
    Messages:
    10
    I'd like to change the entire gauges, like make them digital, adding some extra gauges or replacing them.
     
  4. meywue

    meywue
    Expand Collapse
    Administrator
    BeamNG Team

    Joined:
    Nov 19, 2015
    Messages:
    339
    Hey,

    it's definitely possible.

    But be aware you have to 'create' a custom lua file + a custom html.

    In the first instance you need to create a mod slot part which is capable to contain a skin slot for a gauge skin.
    I prepared a mod for the hatch which is containing such a slot and a simple example to create custom gauges.

    In terms of the lua check the navi of the etk800. There is a screen.lua file and a navi_screen.html. With this html and lua you can dinamically change the texture for the gauges. Futhermore you might have to consider to modify/create a jbeam to get rid of the needle props.
     

    Attached Files:

  5. D-Force-UK

    D-Force-UK
    Expand Collapse

    Joined:
    Feb 9, 2014
    Messages:
    10
    The Problem is, I forgot to mention that I am completely new to modding. I didn't find any tutorials about gauges, but I thought it would be a cool little thing to work on. I don't know how to create lua or html.
     
  6. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    It's easy to see how a beginner might think that gauges would be a little thing which would make a good starting point. The good news is that there are actually "bigger" things which are much easier to start with!

    Full-custom gauges definitely isn't an appropriate place for a beginner to start. :( Needing to do lua, html, jbeam, meshes, and textures definitely puts this into a "not beginner" category. I wouldn't expect a "gauge making" tutorial to pop up anytime soon either, especially for all-custom digital gauges. Instead...
     
    • Like Like x 3
  7. D-Force-UK

    D-Force-UK
    Expand Collapse

    Joined:
    Feb 9, 2014
    Messages:
    10
    Thanks for the reply, I'll look into doing some easy things and then I will try later to make some gauges.
     
  8. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    Cool, have fun. I only suggested those two because (a) they are easy to get started with and (b) people frequently ask about them. There are plenty of other types of mods to do too if those don't suit your taste, but I really do think that they are good starting places if you don't have experience with these sorts of things.

    Creating basic point-to-point scenarios (like races) is another thing that's relatively easy to get started with which can be very rewarding IMO.
     
    • Like Like x 1
  9. D-Force-UK

    D-Force-UK
    Expand Collapse

    Joined:
    Feb 9, 2014
    Messages:
    10
    So now I added a front differential to the Barstow, how do I turn it into a separate mod?
     
  10. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    Ah, good question. There's a thread or two about mod packaging around here. The key thing to understand is that your mod really shouldn't modify/replace any existing files.

    For that reason you should separate your new differential into a part using slots. Once the files are seperated properly you can package them into a zip. Take a look at these two resources:
    Protip: while mods should be packaged in ZIP files for distribution, the editing process is best done with your files extracted in special folders like so:
    Code:
    Documents\BeamNG.drive\vehicles\pessima\
    That's how I work on my mods until it's time to publish them. EDIT: note that whatever is in these folders takes precedence over everything (game files, mods folder, etc) so be careful to remove them when you're done with them!
     
    • Like Like x 1
  11. D-Force-UK

    D-Force-UK
    Expand Collapse

    Joined:
    Feb 9, 2014
    Messages:
    10
    Thank you, gonna try that tomorrow. Thanks for your advice and tips. Appreciate it.
     
  12. D-Force-UK

    D-Force-UK
    Expand Collapse

    Joined:
    Feb 9, 2014
    Messages:
    10
    So now i'm having a problem with what I have created. I made a front differential for the Barstow, and it seemed to work when I had it in the standard Barstow ZIP in the game directory. Now that I've tried to make it into a mod, my Barstow won't spawn. Can you tell me what I did wrong?
     

    Attached Files:

  13. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    Looks like a good start. I haven't tried it in game, but let's see:
    1. I'm sure that nobody mentioned this to you, but consider adding your username to the beginning of identifiers like part names and file names. That way you'll prevent conflicts with other mods! You don't have to worry about the display text, but all part names and file names must be unique or they will over-write each other inside the game. (You'll note that my mods are setup that way if you look inside.)
    2. I think I see a couple of mistakes:
      1. "barstow_suspension_F" as a part name is probably already in use, rename it!
      2. The part I mentioned above is oversimplified... it goes in the front suspension slot, but it does not contain a suspension! That's a no-no. You must copy over a working suspension into it while adding your slot at the same time.
     
    • Like Like x 1
  14. D-Force-UK

    D-Force-UK
    Expand Collapse

    Joined:
    Feb 9, 2014
    Messages:
    10
    Thanks, helped a lot.
     
  15. synsol

    synsol
    Expand Collapse
    QA Lead
    BeamNG Team

    Joined:
    Aug 4, 2013
    Messages:
    1,471
    i would add a point 3 , everything that @torsion say is right , you also have here some missing brackets on you jbeam , that's why your barstow is broken , about the more unique parts , i've suggested you a way to do that (in blue):
    Code:
    {
    "barstow_suspension_F_D-Force-UK": {
        "slotType" : "barstow_suspension_F",
        "slots": [
            ["type", "default", "description"],
            ["barstow_differential_F","barstow_differential_F_D-Force-UK", "Front Differential"],
        ],
    }
    }
    
    and :
    Code:
    {
    "barstow_differential_F_welded_D-Force-UK": {
        "information":{
            "authors":"BeamNG",
            "name":"2.64 Welded Front Differential",
            "value":400,
        }
        "slotType" : "barstow_differential_F",
        "differentials": [
                ["wheelName1", "wheelName2", "type", "state", "closedTorque", "engineTorqueCoef"],
                ["FL","FR", "lsd", "locked", 4000, 1]
        ],
        "engine":{
            "differential":2.64,
            "axleFriction":14
        },
    },
    "barstow_differential_F_LSD_D-Force-UK": {
        "information":{
            "authors":"BeamNG",
            "name":"2.99 Limited-Slip Front Differential",
            "value":800,
        }
        "slotType" : "barstow_differential_F",
        "differentials": [
                ["wheelName1", "wheelName2", "type", "state", "closedTorque", "engineTorqueCoef"],
                ["FL","FR", "lsd", "closed", 250, 1]
        ],
        "engine":{
            "differential":2.99,
            "axleFriction":14
        },
    }
    }
     
    #15 synsol, Aug 15, 2016
    Last edited: Aug 16, 2016
    • Like Like x 1
  16. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    Sometimes it's better to show examples - this was probably one of those times. :)
     
    • Like Like x 1
  17. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    @synsol - now that you put the code inside [ code] tags your blue highlights are gone. Maybe it would be good to use a picture so that you get proper formatting and colors at the same time.
     
    • Like Like x 2
  18. JFXAM

    JFXAM
    Expand Collapse

    Joined:
    Apr 16, 2017
    Messages:
    51

    Sorry to bump the thread, but I am in a similar position. I don't want a digital screen or anything like that, I only want to add via mod slot a gauge that is in metric units. I have all the texturing done and I downloaded your template, but I'm kind of stuck now. I would appreciate some help!
     
  19. Kelwyvern

    Kelwyvern
    Expand Collapse

    Joined:
    Jul 24, 2014
    Messages:
    8
    I'm also wanting to do something similar with teh sunburst dash cluster; I have the textures but can't figure out how to map it to the dash without overwriting the original files. Did you ever happen to solve this problem?
     
  20. JFXAM

    JFXAM
    Expand Collapse

    Joined:
    Apr 16, 2017
    Messages:
    51
    I sorta did. However the way I did it was instead of making a new part, I made it so the gauge textures were linked to a specific vehicle. Like so:
    https://beamng.com/resources/jfxams-euroburst-pack.2998/

    Long story short, I just made a config which replaced the original gauges. That way you can keep both the original and the custom ones. It worked on pretty much every vehicle.
    Another example is my Spanish Emergency Pack. All vehicles there have metric gauges made by me.
    https://beamng.com/resources/jfxams-spanish-emergency-pack.3014/
     
    #20 JFXAM, Oct 25, 2018
    Last edited: Oct 25, 2018
  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