Page 1 of 1

Accessing an Aircraft or Engine's Performance details through Lua

Posted: Fri Jan 22, 2021 4:47 pm
by robotsanta77
Hello,

I'm trying to create a script that will make an estimate of the time it will take for an aircraft to travel to its target even while the plane is not actively traveling to the target or is landed at its base. I envisioned computing the time by getting the distance from the aircraft to the target and the preset cruise speed of the aircraft but I'm having issues getting the cruise speed value for the aircraft through Lua. I'm trying my best to not just hardcode the speed from DB viewer for the aircraft and would prefer if I could somehow call that data in the Lua console. One workaround I've come up with is spawning an identical unit elsewhere, setting its throttle, and calling that unit's speed but I've found that method too complex and prone to incorrect speeds.

Is there anyway to access the data in the performance details of an aircraft's engine through the Lua console? The data is displayed in the DB viewer but I can't find any Lua functions for calling data on an aircraft's engine.

RE: Accessing an Aircraft or Engine's Performance details through Lua

Posted: Sat Jan 23, 2021 6:13 am
by KnightHawk75
Not yet QueryDB doesn't have access to that need data yet, was trying to same|similar some time ago. Some data is available though, just not what you (and I) need for doing that yet. For now you gotta maintain your own tables replicating the data. Cute idea btw, I had not even thought of the spawning idea to grab that info.

fb.asp?m=4854777
fb.asp?m=4802280

RE: Accessing an Aircraft or Engine's Performance details through Lua

Posted: Mon Jan 25, 2021 11:56 am
by robotsanta77
Thanks. I'll look into the QueryDB function.