Accessing an Aircraft or Engine's Performance details through Lua

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
robotsanta77
Posts: 8
Joined: Wed May 06, 2020 2:43 pm

Accessing an Aircraft or Engine's Performance details through Lua

Post 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.
KnightHawk75
Posts: 1556
Joined: Thu Nov 15, 2018 7:24 pm

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

Post 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
robotsanta77
Posts: 8
Joined: Wed May 06, 2020 2:43 pm

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

Post by robotsanta77 »

Thanks. I'll look into the QueryDB function.
Post Reply

Return to “Lua Legion”