I'm working on a Tesla Model S P100D mod (maybe other variants too). I want to have the beamng navigation map thing on the center display and also want to make a custom digital display for the dash that has a speedo, range etc. I want it to sorta look like the real life Tesla display. Thanks
Not that I am aware of. I have heard that there have been changes in how to do this between the previous and current versions of the game. While the previous method still works, I would be reluctant to teach you that because its no longer supposed to be used. However I also don't know the new method. So if you do find any resources double check to make sure they are up to date with the current version of the game.
I thought that the 0.9 update contained official digital displays. The ETK SUV has one. Is there no tutorials for them?
There has been digital dashboard support for a while. They have just changed how it works for 0.9. --- Post updated --- I should probably add that the long and short of it still remains the same. Every single digital dashboard component (including the navigation) is a HTML webpage using CSS and JavaScript. You then create javaScript functions to modify the HTML/CSS based upon data that is passed in from the game. So if you look inside the ETK 800 zip file you will see it contains files called "navi_screen.html" and "guages_screen.html". If you open them inside your web browser you will find that they don't do a whole lot. In order to edit them you will need to open them in a text editor such as Notepad++. Previous experience with creating websites and programming will be very helpful. Not to say that it is impossible without that. The bit that has changed is how you connect that to the game.
from 0.9, modders have to use the module htmlTexture to create animated textures. Previous way to do html texture may not work in future versions. Code: htmlTexture.create("TextureID", "local://local/vehicles/******/gauges_screen.html", 1024, 1024, 15, 'automatic') Here it create a 1024x1024 texture refresh at 15 fps (due to a bug all texture are set at 30 fps anyway)> Automatic is for texture usage, do not change it. To send data Code: data = {spd = speed, dt = dt} htmlTexture.call("TextureID", "updateSpd", data) this function will receive one JavaScript object ( equivalent of a decoded json ) The code above is LUA code. you have to write a little LUA vehicle module. If you want an easier way you can do like the ETK800 Jbeam: Code: "controller": [ ["fileName"], ["etkGauges", {"materialName": "@etk800_gauges_screen", "htmlPath": "local://local/vehicles/etk800/gauges_screen.html"}], ], then the updateData function get called but I don't know what other values are available.
Sorry for necroposting to some degree. I am currently trying to update my mods dashboard to this new system. So far the best I have gotten is the vehicle being disabled due to an exception stating Here is the exact code I used Code: htmlTexture.create("TextureID", "local://local/vehicles/Raven R60/gauges_screen.html", 256, 128, 30, 'automatic')
i forgot to say that you need this line at the beginning of the file Code: local htmlTexture = require("htmlTexture")
So I have got the screen up and running now using the new system which is awesome. The issue I am now having is passing multiple variables. I have tried the following sections of code: Code: local data = {menuSelect,menuUp,menuDown,wSpeed} htmlTexture.call("@R60Guages", "updateMenu", data) Code: local data = {menuSelect = menuSelect,menuUp = menuUp,menuDown = menuDown,wSpeed = wSpeed} htmlTexture.call("@R60Guages", "updateMenu", data) Code: htmlTexture.call("@R60Guages", "updateMenu", {menuSelect = menuSelect,menuUp = menuUp,menuDown = menuDown,wSpeed = wSpeed}) Code: htmlTexture.call("@R60Guages", "updateMenu", {menuSelect,menuUp,menuDown,wSpeed}) None of them seem to do anything or cause errors to be displayed in game. The function they are calling is as follows (don't know if they need the same names in this system or if it is purely based on order like most languages) Code: function updateMenu(menuSelect, menuUp, menuDown, speed){
The lua side is correct for the second and third code. The first and forth one may work but you will get data as an array and not like an object (data[3] instead of data.speed) in fact htmlTexture.call pass only one argument. it get the table you made from lua, convert it to json and them in cef it's json decoded before your function is called. So javascript function should be like this Code: function updateMenu( data ){ foo = data.menuSelect || data.menuUp || data.menuDown; bar = (data.speed *3.6).toFixed(0); .... } i assume you want to have input_action to change what is display on the screen. you can contact me via pm if you are stuck at some point