Jump to content
The simFlight Network Forums

Dirk98

Members
  • Posts

    154
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Dirk98

  1. Bingo! I was just to post the same question. In PMDG_NGX_SDK.h:

     

    //Yoke Animations

    #define EVT_YOKE_L_AP_DISC_SWITCH   (THIRD_PARTY_EVEN_ID_MIN + 1004)

    #define EVT_YOKE_L_AP_DISC_SWITCH   (THIRD_PARTY_EVEN_ID_MIN + 1005)

     

    So the rest is like Pete explained already (thank you so much!!!)

     

    Now I'm looking for the A/T disconnect button on the throttles.

     

    Any idea?

     

    Thanks,

    Dirk.

  2. Yes, ShowText has for a long time been the way to show things like the RC menu on a Client. AdvDisplay was made obsolete by FSX and the Window display option in FS took over in both FS9 and FSX.

     

    There's a Lua plug-in which does something similar to ShowText -- it's actually used as the example of the Lua wnd library in the Lua library documentation.

     

    If you prefer to use ShowText then you'd need to have a plug-in which read one location (the VAS) and wrote a text string, like those in the examples above, to the FSUIPC text display area. However, you should note that there is only one such area, so it would overwrite things like your RC menu display.

     

     

     

    The value of any FSUIPC offset can be shown. You just have to read it (using the appropriate ipc.readXXX function, where XXX defines the size and type), format it into correct units and characters, using Lua arithmetic and the "string.format" function, and display it as shown in the examples above. In fact there are examples of all that there for you. 

     

    Pete

     

    All is clear, It's like getting a fishing pole instead of free fish, and still free  :)

     

    Thank you, Pete.

     

    Dirk.

  3. Pete,

     

    Definitely I was asking about a display on a Client. Actually I was running ShowText.exe by R. van der Wiele, that says in the readme:

     

     

    Version 1.1

    This little program works in combination with the program AdvDisp of Peter
    Dowson (version 1.30 and higher) and will show the text displayed on AdvDisplay
    on an other PC connected via a network FSUIPC / WideFS.
    The Glas Cockpit software of Project Magenta (Enrico Schiratti) will also show
    this text. So this program is intended for anybody who doesn't use this software
    or wants to display the text on a different position.
    A .ini file will be created when the program is run for the first time where all the
    options will be saved (in the same directory where you put ShowText.exe). No
    entries will be written in the registry.
    It has a number of options:
    Switches
    Active - on /off
    Title Bar - on/off (When title bar on, border is also on)
    Border - on/off (When border switched off, title bar is switched off also)
    Word wrap - on/off
    Stay on Top - on/off
    Config Dialog
    Alignment of text:
    Horizontal - Left/Center/Right
    Vertical - Top/Center/Bottom
    Timer Interval:
    This value specifies how often the program will check for text changes.
    (1000 ms = 1 sec).
    Sound File:
    A sound file (.wav) can be selected or cleared with the buttons next to the field.
    This sound file will be played when there is a message coming in from the
    AdvDisplay program. The sound will only be played when there was no message
    displayed, so when there are 2 messages coming in after each other the sound is
    only played once.
     

     

    Remarks:

    Move window
    When no tltle bar is displayed it is still possible to move the window around, just
    left click (and hold down) in the window and drag.
    Startup
    It is possible to start the program in an active state (program will try to get text
    from AdvDisplay via FSUIPC/WideFS) before WideClient on Client PC is running
    or FS on the server PC. ShowText will detect this situation and will establish a
    link when possible.
    Window position/options
    The window position will be saved as well as all the options when stopping the
    program via the 'exit ' menu.

     

    The program has AdvDisplay.dll in the folder, but turns out it also shows text from RC4 even if AdvDisplay.dll is not there, I've just checked. Sorry for the confusion. (Edit: also this shows my own ignorance, re dll on a client lol, sorry!!)
     
    Also, lastly, is it possible to show the current vc zoom number in one of those Lua?
     
    Much thanks,
    Dirk. 
  4. w = wnd.open("My Display", WND_FIXED, 30,300,217,50)
    wnd.backcol(w, 0x000)
    wnd.textcol(w, 0x0f0)
    wnd.font(w, WND_ARIAL,-2,WND_BOLD)
    
    -- Update the display at 500 msec intervals (see event at end)
    function mytimer(time)
    
            wnd.clear(w)
    
    fr = ipc.readUW(0x0274)
    if fr ~= 0 then fr = 32768/fr end
    fr = math.floor((fr * 10) + 0.5)/10
    mem = ipc.readUD(0x024C)
    memmb = math.floor((mem/1024) + 0.5)
    
    wnd.text(w, "Frame Rate " .. fr .. " fps\nMemory free " .. memmb .. " Mb")
    
    end
    
    -- Adjust timing to taste: 500 = 1/2 second
    event.timer(500, "mytimer")
    

    or:

     

    -- Create the display window for 2 values, position x=800, y=400
    h = display.create("My next display", 2, 800, 400)
    
    
    -- Update the display at 500 msec intervals (see event at end)
    function mytimer(time)
    
    
        -- display 1 = frame rate
        fr = ipc.readUW(0x0274)
        if fr ~= 0 then fr = 32768/fr end
        fr = math.floor((fr * 10) + 0.5)/10
        display.show(h, 1, "Frame Rate " .. fr .. " fps")
       
        -- display 2 = memory left free
        mem = ipc.readUD(0x024C)
        memmb = math.floor((mem/1024) + 0.5)
        display.show(h, 2, "Memory free " .. mem .. " kb (" .. memmb .. " Mb)")
       
    end
    
    
    -- Adjust timing to taste: 500 = 1/2 second
    event.timer(500, "mytimer")
    

    Or:

     

    w = wnd.open("My third display", 2)
    wnd.backcol(w, 0x000)
    wnd.textcol(w, 0x0f0)
    wnd.font(w, WND_ARIAL,-2,WND_BOLD)
    
    
    -- Update the display at 500 msec intervals (see event at end)
    function mytimer(time)
    
    
    wnd.clear(w)
    
    
        fr = ipc.readUW(0x0274)
        if fr ~= 0 then fr = 32768/fr end
        fr = math.floor((fr * 10) + 0.5)/10
        mem = ipc.readUD(0x024C)
        memmb = math.floor((mem/1024) + 0.5)
        
        wnd.text(w, "Frame Rate " .. fr .. " fps\nMemory free " .. memmb .. " Mb")
    
    
    end
    
    
    -- Adjust timing to taste: 500 = 1/2 second
    event.timer(500, "mytimer")
     
    Please yourself. Adjust at will.
     
    Pete
     

     

     

     

     

    I'd like to be able to control font name and size in Lua #2 as well. How can it be done there?

     

    Thanks,

    Igor.

     

    Perhaps it's the best Lua example for my needs, but the font is huge there.

     

    PS: also, please, I'd like to add current (dynamic) Zoom in "display 3" to Lua#2/ Thanks!!!

  5. One of those three Lua programs has a re-sizeable and positionable window, and you can easily change the default size and position -- just look at the code. AdvDisplay is a long dead FS module which doesn't run on a client, it used to be part of the FS9 (and before) process.  I hope you aren't still using that!

    Pete

     

    Pete, the window is resizeable indeed (not scalable though), unfortunately it seems there's no word wrap that can be really useful when resizing directly with the mouse (convenient!).

     

    Thanks,

    Dirk.

  6. One of those three Lua programs has a re-sizeable and positionable window, and you can easily change the default size and position -- just look at the code. AdvDisplay is a long dead FS module which doesn't run on a client, it used to be part of the FS9 (and before) process.  I hope you aren't still using that!

     

     

    Pete, how come?! I'm still using it very well in FSX with RC4 on my networked PC. What would you suggest using instead? What is bad about it and how can it be replaced if you recommend to?

     

    Thanks,

    Dirk.

  7. Strange but true: I created 3 Lua files kindly suggested by Pete and named them: VAS.lua1 ,  VAS.lua2 and VAS.lua3 as I wanted to switch between them by renaming each to VAS.lua when needed. Turns out WideFS reads *.lua1 , lua2 and lua3 extensions as well, simultaneously.

     

    Cheers,

    Dirk.

  8. Now that I'm using AutoAssignLetters=Yes under [JoyNames] in FSUIPC4.ini I can' figure out how to name my "B" joystick in the lua scripts.

     

    It used to be, for example, "0" as in: 

    envent.button(0, 5, 1, "toggleFD")

     

    Now it is "B" in FSUIPC GUI (also due to some additional usb input devices)

     

    I tried "B" and "2" in the script in place of "0", but that does not work. Any idea?

     

    Much thanks,

    Dirk.

     

    >>> If you use joystick lettering, you can put the letter here instead but it must be "" quotes, as a string.<<< The IPC Library.

     

    Dirk.

  9. Now that I'm using AutoAssignLetters=Yes under [JoyNames] in FSUIPC4.ini I can' figure out how to name my "B" joystick in the lua scripts.

     

    It used to be, for example, "0" as in: 

    envent.button(0, 5, 1, "toggleFD")

     

    Now it is "B" in FSUIPC GUI (also due to some additional usb input devices)

     

    I tried "B" and "2" in the script in place of "0", but that does not work. Any idea?

     

    Much thanks,

    Dirk.

  10. As documented in the Advanced user's guide. Just change the name.

    The default Zapper works well for me. Otherwise please yourself. The parameters are documented.

    Regards

    Pete

    Pete, I posted my question after reading this:

    ZapSound: This defines the sound to be used when the FSUIPC control for AI traffic deletion (the “Traffic Zapper”) is

    successfully applied. This must be the name of a WAV file in the FS sound folder, the default being ‘Firework’.

    If you do not want a sound just set it to ZapSound=None. However, the reason for the sound is so that you know

    something has been Zapped. FSUIPC cannot tell what you can see, and the aircraft which is zapped may not be in your

    display so you may not see it disappear.

    So, would ZapSound=piston_fail.wav be right format wise?

    By "default Zapper" you mean Traffic Zapper I guess? So, when you are on final and ai is on your runway below, is it affected by ZapAirRange=1.5 or ZapGroundRange=0.25 when using Traffic Zapper? I'm trying to figure out which value to play with for this situation.

    Thank you,

    Dirk.

  11. Hi,

    I added an alternative template for the FD using explicit values. Replace the variables and values acording to your need. But as these are basic programming tasks, I would suggest to read the LUA reference manual and especially try to understand the includes samples with the LUA package.

    Rgds

    Reinhard


    -- toggle FD button
    function toggleFD (joynum, button, downup)

    local lFD = ipc.readLvar("L:AB_MPL_FD")

    if lFD == 0 then
    lFD = 1
    else
    lFD = 0
    end

    ipc.writeLvar( "L:AB_MPL_FD", lFD )
    ipc.writeLvar( "L:SmallOverheadPushButtons", 1 )

    end
    [/CODE]

    Yes! Thank you very much, Reinhard, I've got to modify my lua as this version looks more logical to me)

    Dirk.

    PS: I wonder what this string meant in a verbal description (after ipc.wrtieLvar, the " - " part):

    [color=#000000]ipc[/color][color=#666600].[/color][color=#000000]writeLvar[/color][color=#666600]([/color][color=#000000] [/color][color=#008800]"L:AB_AP_HDGTRK"[/color][color=#666600],[/color][color=#000000] [/color][color=#006666]1[/color][color=#000000] [/color][color=#666600]-[/color][color=#000000] ipc[/color][color=#666600].[/color][color=#000000]readLvar[/color][color=#666600]([/color][color=#008800]"L:AB_AP_HDGTRK"[/color][color=#666600])[/color][color=#000000] [/color][color=#666600])[/color]

    [color=#666600]PPS: I'm like an addict on your scripts already, bAd feeling, strong craving. :)[/color]

  12. Reinhard,

    As I wrote I'm using your examples of scripts as templates for some other functions and controls in AXE. But as I think I already understand a little more in those scrips now, than when I started in this thread, I realize that some of them may not be very approriate for what I'm trying to achieve, due to different reasons, even when they seemingly function ok.

    For example, you suggested these scripts for toggling FD and ATHR:

    -- toggle FD button

    function toggleFD (joynum, button, downup)

    ipc.writeLvar( "L:AB_MPL_FD", 1 - ipc.readLvar("L:AB_MPL_FD") )

    ipc.writeLvar( "L:SmallOverheadPushButtons", 1 )

    end

    -- toggle ATHR button

    function toggleATHR (joynum, button, downup)

    ipc.writeLvar( "L:AB_AP_ATHR", 1 - ipc.readLvar("L:AB_AP_ATHR") )

    ipc.writeLvar( "L:SmallOverheadPushButtons", 1 )

    end

    -- register the buttons of your joystick triggering the functions

    -- replace joyletter by the actual used letter/number, also replace buttonX by the actual value

    event.button("joyletter", button1, 1, "toggleFD")

    event.button("joyletter", button2, 1, "toggleATHR")

    These examples are good for templates of toggling buttons that function On/Off. But they may be not so good for mode switching buttons like how I tried to adopt them for in SPD/MACH and VS/FPA switching:


    -- VS/FPA switch button
    function switchHDGTRK (joynum, button, downup)
    ipc.writeLvar( "L:AB_AP_HDGTRK", 1 - ipc.readLvar("L:AB_AP_HDGTRK") )
    ipc.writeLvar( "L:SmallOverheadPushButtons", 1 )
    end

    -- SPD/MACH switch button
    function switchSPDMACH (joynum, button, downup)
    ipc.writeLvar( "L:AB_AP_SPDMACH", 1 - ipc.readLvar("L:AB_AP_SPDMACH") )
    ipc.writeLvar( "L:SmallOverheadPushButtons", 1 )
    end[/CODE]

    From AXE LVars list:

    HDGTRK can be:

    1 = TRK/FPA, 0 = HDG/SPD

    SPDMACH can be:

    1 = MACH, 0 = SPD

    So, is there a different way to skin this cat, by explicitly using 1 and 0 switches in the scripts above?

    Thanks,

    Dirk.

    PS: I mean, what if they were not 1 / 0, but rather 1 / -1? Would have the main script body above been valid yet?

  13. ZapAirRange=1.5

    ZapGroundRange=0.25

    These control the range of operation of the AI aircraft zapping facility. The units are nautical miles. Air and Ground

    refer to the user aircraft position, not the target. Note that you cannot change the acceptance angle explicitly. It is

    adjusted automatically, in linear inverse proportion to the change in the range—so with a larger range you would need to

    point the aircraft nose more accurately.

    Do I add the above to [General] section manually?

    Thanks,

    Dirk.

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