airforce2 Posted August 11, 2023 Report Posted August 11, 2023 Quick question--if I use ipc,writeLvar in a Lua script to write to an Lvar that does not presently exist, is a new Lvar created or does it just ignore the write? If not, is there a mechanism in FSUIPC to create a new Lvar in a Lua script or macro? Regards Bob Scott
John Dowson Posted August 11, 2023 Report Posted August 11, 2023 Writing to a non-existent lvar should create the lvar, but I am not 100% sure on this (may be for MSFS2020 only), as the documentation does say: If the variable is not currently available, nothing happens. To create an lvar in lua, you should use the ipc.createLvar function: Quote ipc.createLvar(“name”, initialValue) [Not WideClient] This creates a new FS local panel variable called “name” and sets its initial value. These are L: <name> values. You can provide the L: part explicitly or leave it out. John
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now