P3D v4 - Lua without FSUIPC?

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Post Reply
LeCoyote
Posts: 3
Joined: Mon Feb 14, 2022 6:25 pm

P3D v4 - Lua without FSUIPC?

Post by LeCoyote »

Hello world,

I have spent too many hours trying to get P3D v4 to run even the tiniest, simplest bit of Lua. My initial goal was to use Lua in a <Macro> element inside an XML gauge, but apparently that's not possible. Worse still, the SDK makes no clear mention of where (ie. which element/child) Lua code can be included. There are samples where Lua is used in a <Value>, which is not my use case, or inside a <Script> object which the documentation does
not say what it can be a child of.

The only thing I have managed so far is to run something as part of the Script property of the <Update> element, but said script is then a string and therefore requires escape characters in its content, which is pretty cumbersome.

Apart from that limited result, I have made close to a hundred (yes, that's 100) unsuccessful attempts so far, diving to the bottom of the SDK (exasperatingly limited) documentation, to no avail.

Therefore, I would be extremely grateful to anyone who could provide me with a working example of Lua, either in a gauge, or as a standalone script that P3D can run without FSUIPC (because there again, there's a Scripts folder with no documentation on how to run the scripts that live there).

Thank you so, so much in advance!
Cheers
joshuamarius
Posts: 24
Joined: Tue Jun 25, 2019 2:35 am
Location: USA
Contact:

Re: P3D v4 - Lua without FSUIPC?

Post by joshuamarius »

Did you ever find your answer to this?
Chris Metel
Lockheed Martin
Posts: 105
Joined: Thu Aug 11, 2011 6:59 pm

Re: P3D v4 - Lua without FSUIPC?

Post by Chris Metel »

Hello,
There are couple of LUA script examples in the Prepar3D SDK documentation.

https://www.prepar3d.com/SDKv4/sdk/scri ... l#Examples

Cheers,
Chris
Chris Metel
Prepar3D® Product Owner
Post Reply