Jump to content
The simFlight Network Forums

Writing LVARs


Recommended Posts

Hi Pete,

I hope you will be to support me like you have already done in the past.

Here my problem: I'm tring to manage through LUAs an XML gauge to be able to use the scripts to program my devices for the fligts simulating the aircraft's buttons and switches (for example to start from dark and cold config).

For aircrafts having GAU files I have no problems doing that through macros.

For the XML I have used your LUA example 'log vars' to see the LVAR names and their values when I click on the different gauges, but when I create the LUA with the command 'ipc.writeLVar("varname",value)' nothing happens.

What am I doing wrong?

Thanks in advance for your help

Kind regards

Joe

Link to comment
Share on other sites

Hi Peter,

may be I got a possible solution:

1. I have executed the command to have all the panel's LVARs listed in the FSUIPC log file

2. Now I will create the macros with the special command for the LVARS (If I correctly understand the advanced guide I can put in the macro the commands only for a single LVAR)

3. If I need to execute more commands at the same time I can create a LUA executing in sequence all the macros I need (i.e. open the battery button shield, switch on the battery, close the battery button shield).

Can you please confirm that this is the correct and best approach?

Thanks again

Joe

Link to comment
Share on other sites

For the XML I have used your LUA example 'log vars' to see the LVAR names and their values when I click on the different gauges, but when I create the LUA with the command 'ipc.writeLVar("varname",value)' nothing happens.

Whether those L:Vars are just places where the gauge code stores values, but doesn't read changes in them to switch things or not, is impossible for me to say. Sorry, you need to experiment, or seek help from the authors of the gauges.

On your subsequent message:

2. Now I will create the macros with the special command for the LVARS (If I correctly understand the advanced guide I can put in the macro the commands only for a single LVAR)

Yes. Unfortunately multi-line macros with L:Vars aren't possible.

3. If I need to execute more commands at the same time I can create a LUA executing in sequence all the macros I need (i.e. open the battery button shield, switch on the battery, close the battery button shield).

Well, you can do that, but if you are having a Lua program you might as well have it contain the L:Var writing directly rather than go through the more complicated troute of invoking a series of macros to do the same things.

BTW have you browsed through the various examples in the User Contributions sub-forum? There are a lot of areas where others have already done the work.

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

thanks for the prompt reply.

I forgot to mention that I'm trying to do that for the Qualitywings 757 and looking around the forum I have discovered that also other pepole had troubles reading variables with this plane and seems that the only way to do that is to set the variables from macros.

I will do some more experiments

Thanks and kind regards

Joe

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.