Jump to content
Sign in to follow this  
rhalton

New Aircraft Module

Recommended Posts

I am trying to create a module for an Airbus to run from my Combi 2. I have created a basic module by copying the RealAir Duke module and many controls work OK. I am a bit lost with all the info available

as to how to assign other functions. As an example I want to be able to operate the cockpit button which displays WPT on the EFIS map display. I have used the tracer and found a LVar which when clicked from the list with toggle set to 0 and 1, operates the button. In the editor I have added a section to the lua as follows:-

function Show_WPT_on ()

LVar = "ND_WPT = 0"

end

 

function Show_WPT_off ()

LVar = " ND_WPT = 1"

end

Syntax reported OK

Have saved file, assigned the function to the combi but there is no reaction from the aircraft.

The process is probably not as simple as this but I thought that if I could tackle one control, I might have a chance of working out some of the others.

Thanks,

Richard Halton

Share this post


Link to post
Share on other sites

Hello Richard,

 

the code is wrong. These are basics, hard to explain. You have to lookup how LUA language is working.

 

Your function (assuming the LUA variables are correct) should be instead

 

function Show_WPT_off ()
ipc.writeLvar = ("ND_WPT", 1)
end

(this is out of my brain, so not tested and hopefully no typo)

 

 

As you have a MCP Combo. there would be an improvment to make an "announcement" on the display:

 

function Show_WPT_off ()
ipc.writeLvar = ("ND_WPT", 1)
DspShow("WPT", "off")
end

 

 

hope this helps to start getting into LUA.

And very important: LUA is case sensitive!!!


Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Hi,

I have entered the following :-

function Show_WPT_off ()

ipc.writeLVar("ND_WPT", 0)

end

function Show_WPT_on ()

ipc.writeLVar("ND_WPT", 1)

end

function Show_WPT_toggle ()

if _t("ND_WPT", 1) then

Show_WPT_on ()

else

Show_WPT_off ()

end

Syntax reported OK - file saved - button allocated on combi and saved.

The button is operated OK in FSX from the list in the tracer but not from the combi itself.

There are no error messages in the Linda console

Where do I go from here?

Thanks,

Richard Halton

Share this post


Link to post
Share on other sites

I doubt it is working

 

ipc.writeLVar("ND_WPT", 0)

 

LVar is wrong, Lvar would be right ...

 

You have to get an error from the LINDA console!?


Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Using Lvar solved the problem. I have most of the buttons assigned now. About to start on some of the rotaries. I will look at some of the existing modules for advice. Thanks for your help.

Richard Halton

Share this post


Link to post
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
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...