Sorry if this question has been answered before, but I haven't been able to find an answer in at least an hour of looking. I'm working on a modified outguage.lua, and right now I'm trying to get the display lines to basically replicate what the nodeBeamDebug UI app does - present a simple damage percentage based on deformed beams / total beams. From what I can find I should be able to access this though data.stats.beam_count. But even trying to read it from the vehicle lua console using dump() this doesn't seem to exist. Looking at the guistreams.lua it looks like it should exists within just stats.beam_count, but dump(stats) doesn't seem to return anything at all? But looking at the app.js of nodeBeamDebug also looks like it would be in a similar place, since the UI app works. Has there been some change to structure that has depreciate stats as a guistream? Has lua ever had a way to access data.stats values? Am I missing something simple because I'm really not used to reading lua or js code? Any help is appreciated.
Seems a bit weird to try and extract the data from the guistream when you can just ask the engine to give you the data whenever you need using obj:calcBeamStats(). Try print(obj:calcBeamStats().beams_broken) in vlua console. Probably would be best to put the result into a variable and get the bits you need rather than call calcBeamStats multiple times, like in guistreams.
The only reason I was doing it that way was because I was learning by looking at what the rest of the script did. I honestly didn't know this was available to me. But yes, that gets me the data I want and now it's working perfectly. Thank you very much! Is there a good reference page where I can read up on what else I can be doing by that method? I don't think I've even seen "obj:" anything yet in what I've looked through, but I'd like to actually have an understanding of what I've just implemented, and I don't wanna waste anyone's time with 1,000 questions.