Jump to content
Sign in to follow this  
Kersick

[Help] How to get the actual heading degrees in Lua

Recommended Posts

Hello my name is Ian and i am new with LINDA and Lua , yesterday I was working on a script for my brother,he show the original script,in XML.
This is the script: 

(L:CDI source selected, enum) 1 == 

if{
    (A:NAV1 radial, degrees) (A:Plane heading degrees gyro, degrees)
    (>K:VOR1_SET)

(L:CDI source selected, enum) 2 == 

if{
    (A:NAV2 radial, degrees) (A:Plane heading degrees gyro, degrees)
    (>K:VOR2_SET) 
}    
(P:Absolute time, seconds) (>L:time crs changed, seconds)

The script changes the Nav 1 or Nav 2 heading to the actual curse of the plane,i think that this value is on the degrees variable,so, my trouble is ,is there any function on LINDA to get that value?I find the function to set the VOR1 or VOR2  and the function to set the Heading degrees gyro but it doesn't work at all because I have to use a static float number.

Thanks for the help.

Share this post


Link to post
Share on other sites

Hi Ian

I am familiar with many programming language but not the one you quote. XML is an eXtensible Markup Language for documenting not a scripting or programming language. To understand your question, I would need to know what you are trying to do, with what Flt Sim and how you want to display the information. 

You will find LUA functions handling VOR/NAV function in LINDA's common.lua (in /modules/linda/system under NAV). These use the FSUIPC offsets to access the stored values (see FSUIPC Document in /modules).

Edited by ScotFlieger
For english
  • Like 1

Andrew Gransden

Scotland, UK

LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer

i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew

Share this post


Link to post
Share on other sites

Hi Scot

Before all else, thanks for your reply.
That script was inside of the .XML script, I'm not a regular user of XML but also that script use the reverse polish notation.
As soon as I can,I'll try what you tell me and then I'll post if it worked.
Thanks.

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...