Accessing an Aircraft or Engine's Performance details through Lua
Posted: Fri Jan 22, 2021 4:47 pm
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.
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.