Results 1 to 6 of 6
  1. #1
    10+ Posting Member
    Join Date
    Jan 2017
    Location
    Germany
    Posts
    14
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Lightbulb beyond link2fs: LUA, resources and examples. Please benefit, plese contribute :-)

    Dear fellow flightsimmers,

    I've based my DA40 home flight simulator entirely on link2fs. - It's my first home flight sim and that's how I started aiming at FSX. Once the sim itself is finished (still some monts worth of work ), I'll try to circumvent link2fs in order to be able to upgrade to P3D V4.

    Doing some research and thanks to some contributers here (thanks cbb777 ) it appears to me that LUA scrips are the way to go. Only fey examples are accessible online however. I therefore start this thread to collect useful links and *especially example code* here to help us getting started with LUA.

    Making the start:

    Obviously:
    https://www.lua.org/

    Great Site, specifically aiming at flight simming and starting right after the big bang:
    http://www.anadrac.com/FSUIPC-Lua-Tutorial/index.html

    Good, short overview:
    http://gotocon.com/dl/jaoo_aus2008/s...oberto_LUA.pdf

    LUA V5 Reference Manual:
    https://www.lua.org/ftp/refman-5.0.pdf

    Kind regards,
    Frank

  2. Thanks wody thanked for this post
    Likes wody liked this post
  3. #2
    150+ Forum Groupie


    BushPilotWannabe's Avatar
    Join Date
    Jan 2014
    Location
    Alberta, Canada
    Posts
    176
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: beyond link2fs: LUA, resources and examples. Please benefit, plese contribute :-)

    Eventually everything will be 64 bits. Chiching! When was it 2000? Browser upgrade required upgraded Windows, which would not fit in early Pentium architectures. Pentium chips needed new motherboards, memory, and power supplies. Same thing with the change to Win 7 and my i3 box. The tower case dates back to my first 80486DX. Maybe the next change will make that obsolete. Any improvement will be welcome. Maybe I too will get improved.

    Hugh
    ---CYXD ----- TWR --- GND ------ Closed
    ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013

  4. #3
    150+ Forum Groupie
    Join Date
    Nov 2013
    Location
    Evansville, Indiana
    Posts
    243
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: beyond link2fs: LUA, resources and examples. Please benefit, plese contribute :-)

    OK Frank,
    Here is the first one.
    Geared toward the Novice.

    http://thegeekforge.com/2017/11/10/a...utorial-001_a/

    ~Fess
    I will only ever be, half the Geek that I wished I was.
    TheGeekForge.Com

  5. Thanks iwik thanked for this post
  6. #4
    150+ Forum Groupie


    BushPilotWannabe's Avatar
    Join Date
    Jan 2014
    Location
    Alberta, Canada
    Posts
    176
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: beyond link2fs: LUA, resources and examples. Please benefit, plese contribute :-)

    Pull the right branch and the logjam disintegrates. Thanks ~Fess.

    Hugh
    ---CYXD ----- TWR --- GND ------ Closed
    ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013

  7. #5
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Jul 2014
    Location
    Sydney, Australia
    Posts
    9
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: beyond link2fs: LUA, resources and examples. Please benefit, plese contribute :-)

    I agree with you Frank, LUA scripts are the way to go if you can handle a bit of programming.

    If you need help with something then please ask.

    Chris.

  8. #6
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Jul 2014
    Location
    Sydney, Australia
    Posts
    9
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: beyond link2fs: LUA, resources and examples. Please benefit, plese contribute :-)

    AN example of using an 'event' with LUA and FSUIPC


    --

    function ParkBrake(offset, value)
    if value == 0 then
    ipc.display("Parking Brake is 'Off'", 0, 5)
    else
    ipc.display("Parking Brake is 'On'", 0, 5)
    end
    end

    event.offset(0x0BC8, "UW", "ParkBrake")

    --

    All this does is display a message on the screen showing the state of the handbrake when it changes.

    The code:

    The last line:

    event.offset(0x0BC8, "UW", "ParkBrake")

    (See FSUIPCx Lua Library.pdf, page 28.)
    (For a list of offsets see FSUIPCx Offsets Status.pdf. 0xBC8, page 17.)


    Note: The event has to be placed at the end your code.

    The function:

    The function 'ParkBrake' has two parameters passed to it, offset and value. These can be named anything you like, say Bill and Ben, but offset and value make the more sense to me.

    offset is the offset that triggered this event. In this example it is not used, but say if you had more than one event calling the same function then you could test this to see which event called you.)

    value is the value at the offset when the event was triggered.

    We then test the contents of value. If is is equal to '0' then the hand brake is off, otherwise it must be on. We respond using ipc.display to show the message on the screen.

    @Frank: - Is this the kind of example you are looking for?

    Chris.

  9. Likes wody liked this post