Hello everyone How can I make a digital speedometer?

Discussion in 'Content Creation' started by Smile!, Mar 7, 2021.

  1. Smile!

    Smile!
    Expand Collapse
    Banned

    Joined:
    Mar 14, 2019
    Messages:
    23
    Hello everyone How can I make a digital speedometer?
    --- Post updated ---
    I need to make a digital speedometr like on etk800 to my mod
     
  2. alentaylor22

    alentaylor22
    Expand Collapse

    Joined:
    Jan 19, 2018
    Messages:
    447
    i dnt know anything bout code but best thing u can prolly do is take the vivace dash screen and fit it to the etk cluster housing the tweak it in some code or something idk bout that stuff but thats how i think u can do it
     
  3. Sithhy™

    Sithhy™
    Expand Collapse

    Joined:
    Apr 5, 2017
    Messages:
    3,279
    You pretty much need to learn how to code in Lua & possibly HTML
     
    • Agree Agree x 2
  4. Agent_Y

    Agent_Y
    Expand Collapse

    Joined:
    Jul 10, 2020
    Messages:
    6,806
    Technically HTML is not coding, it's just "meta text"... but yeah you have to learn this and LUA for a really basic speedometer like on the ETK 800, and for a more advanced one like on the Vivace or SBR you need A LOT more than that and there are only like 2 mods ever that have a working one at the moment. It's not easy.
     
    • Agree Agree x 1
  5. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,492
    Did someone say "digital speedometer" ? :cool: ( welcome in my realm LOL)

    @Agent_Y I have to sort of disagree, isn't there more mods than 2 that bare digital gauging ? And also, as HTML stands for hyper text markup language I would assume that every computer language is made up of code :)

    @Smile! It involves a lot of work indeed. It all starts with a simple plane in Blender (or other 3d program). That plane needs to be given the right material and be UV mapped correctly. And if material is involved then the materials.json file too of course. Then there is a lua controller file to make the car's data work with an html texture. Then there is a JavaScript file, actually an AngularJS module involved to get the LUA controller data into html (the screen thus). The controllers need be referenced in the car's jbeam file and one or more html pages need to be created as well as a .css file for html element styling, and a font source needs to be added too (True-Type lettertype file and or WOFF file). The css file is optional but if not used the css data would have to be placed in the html page code wise anyway. That's most of it in a nutshell I guess. It's all code, code, code...

    You need to learn this stuff by doing and what you should do is use the etk800 as a base to start off of. Copy all stuff from the 800 series needed for the digital gauge to work to your mod, it's really the best way to learn. If you succeed in that then you will surely be able to learn quickly how to change and customize things to your likings.

    If you have any more questions fire away :)
     
    • Agree Agree x 2
  6. Agent_Y

    Agent_Y
    Expand Collapse

    Joined:
    Jul 10, 2020
    Messages:
    6,806
    I said there aren't many mods that have such advanced digital gauges like the Cherrier and the SBR.
    Also, HTML is not a code in the sense of programming, because a programming language must be able to operate on loops, switches and variables, which HTML can't do. It's a different kind of code and most people won't call writing HTML "coding". Jbeam is closer to coding than HTML but still not quite, there is no way to make a loop in Jbeam, however variables are possible (tuning tab) and switch statements as well (I used them for my JATO mod to make the rockets position different for each car). It's not the Jbeam itself decoding these statements, there are special LUA files dedicated to this - the same way as there are files dedicated to decoding nodes, beams, triangles, etc. Jbeam serves more like a database that is to be decoded by LUA, pretty much like HTML is like a database to be decoded by browsers.
     
  7. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,492
    You're right about the not many mods having gauges like that, it's true. As for looping in html, you can write javascript directly into it. Also your clicking actions, text field inputs, animations and whatever, they are all looped. Basically everything coming out of a computer is looped :)

    edit But I guess what you mean to say is the updateGFX from the lua that provides realtime data streams :)
     
  8. Agent_Y

    Agent_Y
    Expand Collapse

    Joined:
    Jul 10, 2020
    Messages:
    6,806
    They are automatically looped, and a programming language has to be able to make loops manually. And also without using other languages like JS to help.
     
  9. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,492
    hah yeah I was just adding an edit above :)
     
  10. EthanG3353

    EthanG3353
    Expand Collapse

    Joined:
    Mar 14, 2019
    Messages:
    16
    Its in game already I do believe. Not sure if it is air speed though
     
  11. Sir-Tanks-Alot

    Sir-Tanks-Alot
    Expand Collapse

    Joined:
    Feb 9, 2021
    Messages:
    18
    Above quoted for emphasis.

    Something like this is mentioned in the BeamNG.drive Documentation, if you want to take a look to see if it helps.

    Have fun, and happy coding!
     
  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