I wanted to refresh my memories of C# and for sure needed as I have forgotten even most basic of things, so found out a library that allows quite easy way for reading outgauge/outsim data BeamNG sends when option is enabled from menu. However while everything else from outgauge works fine (well, oilpressure does not, some bits are not implemented obviously), I'm not getting time, it is like if game would not be sending time to outsim, but when I check outsim.lua it should send time. From outsim.lua (note that I did change ip and port in outsim.lua): -- teh documentation can be found at LFS/docs/InSim.txt ffi.cdef[[ typedef struct outsim_t { // note: X and Y axes are on the ground, Z is up. unsigned time; // time in milliseconds (to check order) Code: double time; private void outsim_PacketReceived(object sender, OutSimEventArgs e) { time = e.Time.Ticks; // same result with time = e.Time.Milliseconds; labelTime.Text = Convert.ToString(time); } Using https://github.com/alexmcbride/insimdotnet/ I guess that outsim is not enabled with game option 'enable outgauge' so that enables only outgauge.lua, but where do I enable outsim.lua in 0.16?
From simple roll UI app I can see streams manager is used to get stream data. I guess I would create new streams manager and then use that to get sensors for it so I can access them or then there is direct way to access sensors, but I could not figure out how. In simple roll UI app Streams manager is created like this on line 1 and then actual sensors are populated and made accessible with lines 2 and 3, not really sure if that is needed on Lua side and if it is, how to create that streams manager. .directive('simpleRoll', ['StreamsManager', function (StreamsManager) { var streamsList = ['sensors']; StreamsManager.add(streamsList); There is wiki page about sensors, but it is bit empty on Lua side of things: https://wiki.beamng.com/Streams I did attempt this, but obviously it is not working. local StreamsManager.new("StreamsManager") local streamsList = ['sensors'] StreamsManager.add(streamsList) I can't say I would really understand what I'm doing, but, copy paste from outgauge with small edits and hardcoded ip as well as port made outsim to send time in milliseconds, I have no idea how to get outsim ip and port to settings like is done with outgauge though and accessing sensors is bit of mystery, but it kind of works. So there is rpm, time in milliseconds (it goes to 1000 and starts from zero, something might be off), roll (does not work) and speed, also indicators for outsim and outgauge data receiving. There was thread from 2015 which had exact same problem with getting roll read with Lua, but surprisingly information there was not quite usable anymore, game has evolved quite a bit during few years --- Post updated --- Okay, turns out I was thinking way too complicated, it is not streams.sensors. it is just sensors. Roll is missing from that though, simple roll app is using streams.sensors.roll but I'm getting nil from ingame console, so need to find out where that is being created at for simple roll app.