Jump to content
The simFlight Network Forums

QW 787 Key assignment not working


Recommended Posts

Hello everyone,

I'm having some trouble with the current version of FSUIPC for P3Dv5 when assigning key assignment for the QW 787. For example, when I assign the key Ctrl+F2 to toggle on/off the Runway turnoff lights and press it, nothing happens. Meaning, as I look up at the overhead to see if the function works, nothing happens. However, when I press Ctrl+F1 to toggle on/off strobes, that works. The issues continues when I try with the Taxi light as well when pressing Ctrl+F3. Any thoughts?

FSUIPC6.ini FSUIPC6.log My789functions.txt

Link to comment
Share on other sites

2 hours ago, raptor84 said:

For example, when I assign the key Ctrl+F2 to toggle on/off the Runway turnoff lights and press it, nothing happens.

Ctrl+F2 is assigned to LuaToggle My789functions with flag 2.  Flag 2 calls the QW_OH_LT_Both_RWYTF_toggle function:
   event.flag(2,"QW_OH_LT_Both_RWYTF_toggle")
This is the function called:
 

function QW_OH_LT_Both_RWYTF_toggle ()
    QW_OH_LT_L_RWYTF_toggle ()
    QW_OH_LT_R_RWYTF_toggle ()
end

The functions QW_OH_LT_L_RWYTF_toggle and QW_OH_LT_R_RWYTF_toggle do not exist (and neither QW_OH_LT_L_RWYTF_on, QW_OH_LT_R_RWYTF_on, QW_OH_LT_L_RWYTF_off, QW_OH_LT_R_RWYTF_off and QW_OH_LT_R_RWYTF_offQW_OH_LT_R_RWYTF_off).

So looks like your lua is missing some functions, although I don't know why this error isn't logged.

Note that you arer starting two lua dunctions in your [Auto] section, one for each profile. Better to use profile Auto sections (e.g. [Auto.B789]) to only start the luas needed for that profile.

Also, consider using substrings for your aircraft profile names. i.e. change
 

Quote

[Profile.B789]
1=QualityWings 787-9 United Airlines -SATCOM

to

Quote

[Profile.B789]
1=QualityWings 787-9

which will then match the aircraft when using a different livery.

John

Link to comment
Share on other sites

8 hours ago, John Dowson said:

Note that you arer starting two lua dunctions in your [Auto] section, one for each profile. Better to use profile Auto sections (e.g. [Auto.B789]) to only start the luas needed for that profile

I'm a bit confuse with this one. Are you saying that in the AUTO section, it should look like this:

[AUTO.A320]
1=Lua My320functions

[AUTO.B789]
1=Lua My789functions

 

9 hours ago, John Dowson said:

The functions QW_OH_LT_L_RWYTF_toggle and QW_OH_LT_R_RWYTF_toggle do not exist (and neither QW_OH_LT_L_RWYTF_on, QW_OH_LT_R_RWYTF_on, QW_OH_LT_L_RWYTF_off, QW_OH_LT_R_RWYTF_off and QW_OH_LT_R_RWYTF_offQW_OH_LT_R_RWYTF_off).

So, I need to include the above functions as well in order to use the QW_OH_LT_Both_RWYTF_toggle function??? I thought the above function was to be use individually, that's why I left it out because I wasn't trying to turn them on individually, which is the case that is happening. Meaning, when I went back and included the missing functions and assigned Ctrl+F2 to the function you saw in my lua file, what ended up happening, it turned on/off the only Left Runway Turnoff light instead of turning on/off Both Runway Turnoff light as how I want it. The function name is copied correctly from the action file, so I don't know why the QW_OH_LT_Both_RWYTF_toggle function isn't working as its intended to do?

Link to comment
Share on other sites

13 hours ago, raptor84 said:

I'm a bit confuse with this one. Are you saying that in the AUTO section, it should look like this:

[AUTO.A320]
1=Lua My320functions

[AUTO.B789]
1=Lua My789functions

With your current [Auto] section, both lua scripts will be ran for every aircraft that you use. If you replace this with the above, only the relevant script will be ran in each profile.

13 hours ago, raptor84 said:

So, I need to include the above functions as well in order to use the QW_OH_LT_Both_RWYTF_toggle function??? I thought the above function was to be use individually, that's why I left it out because I wasn't trying to turn them on individually, which is the case that is happening. Meaning, when I went back and included the missing functions and assigned Ctrl+F2 to the function you saw in my lua file, what ended up happening, it turned on/off the only Left Runway Turnoff light instead of turning on/off Both Runway Turnoff light as how I want it. The function name is copied correctly from the action file, so I don't know why the QW_OH_LT_Both_RWYTF_toggle function isn't working as its intended to do?

I can't help if you don't show me/attach your updated script.
You can also try logging (for Lua Plugins and maybe also Events) and work out what the script is doing and why it isn't working as intended.

John

Link to comment
Share on other sites

15 hours ago, raptor84 said:

I also have the event log checked within the FSUIPC but no log file was created.

Events are logged to the FSUIPC6.log file. You also activated Log Lua Separately. Please do not set this - I prefer to see the lua log embedded in the FSUIPC6.log file. Only activate the logging I request please, no other logging needed. And no-need to rename your lua files with a txt extension. Also never start a new log file when generating logs for support, and always exit FSUIPC/P3D before attaching logs.

I will look at your files tomorrow - just finishing for the day...

John

Link to comment
Share on other sites

If you look at your log files, the error is obvious:

Quote

  1040344 *** LUA Error: C:\FSUIPC6\My789functions.lua:66: attempt to call global 'DspShow' (a nil value)

This is happening after the left light has been set (i.e. turned on or off) and will stop the processing, so the function to control the right light will not be called.
The error is because you are using the function DspShow which is not defined anywhere.

Note also that your lua scripts are writing numeric lvars as strings, e.g.
            ipc.writeLvar(lvar, '0')
This should be
            ipc.writeLvar(lvar, 0)
This happens in various places.

Can you please try looking at the log files yourself and at least attempt to diagnose the issue before asking for support. I don't mind helping, but such obcious errors should be detected by the user really and not require support. Always at least look at your own log files before posting and the error may be obvious.

John

Link to comment
Share on other sites

13 hours ago, John Dowson said:

The error is because you are using the function DspShow which is not defined anywhere.

Note also that your lua scripts are writing numeric lvars as strings, e.g.
            ipc.writeLvar(lvar, '0')
This should be
            ipc.writeLvar(lvar, 0)
This happens in various places.

Pretty interesting you say that because I'm not writing or changing anything. Using the files from the link below, in fact, all I'm doing is after I convert the file extension from lua to txt extension, I 'm copying the functions that I only want to use. So its not me causing the error. It appears the error is already there to begin without me knowing.

https://www.avsim.com/forums/topic/538165-qw787-dreamliner-v11-9-mar-2020/

I don't have or use LINDA. I don't know if the coded functions in the files from the link above is missing anything or if it contains errors like you mentioned about the numeric lvars? How was I suppose to know what was wrong? I assume the functions in the lua files from the link above are correct. So for example, if I'm copying the QW_OH_LT_Both_RWYTF_toggle function (those 2 or 3 lines) as outlined from auctions.lua file, I assume its going to work however, it appears something is missing because whom ever created that function must've left something out for that function to work, wouldn't you agree? Perhaps what I got to do is go back and modify the QW_OH_LT_Both_RWYTF_toggle function to look something similar to how QW_OH_LT_TAXI_toggle and QW_OH_LT_STROBE_toggle look like because those 2 functions work perfectly fine when I assigned the press key I wanted to use. Unless you have a different solution on how its suppose to look like.

13 hours ago, John Dowson said:

Can you please try looking at the log files yourself and at least attempt to diagnose the issue before asking for support. I don't mind helping, but such obvious errors should be detected by the user really and not require support. Always at least look at your own log files before posting and the error may be obvious.

I'm not trying to rant here but if I didn't need to come to this forum and seek help, I wouldn't have done so, even if the errors were obvious. In fact, I try searching the forum to help me solve the issue I'm having before posting my issue because I'm not trying to waste anyone's time here. I don't know what I'm looking for or even know what the error means. I don't think there is a manual to help translate the error, is there?? I'm not someone who knows code or software programming. That's why I post my issue even if they are obvious errors. I do appreciate you helping out.

Link to comment
Share on other sites

7 hours ago, raptor84 said:

I 'm copying the functions that I only want to use. So its not me causing the error. It appears the error is already there to begin without me knowing.

https://www.avsim.com/forums/topic/538165-qw787-dreamliner-v11-9-mar-2020/

I don't have or use LINDA.

LINDA is quite a complex system - you cannot just extract one lua file an expect it to work asit may have many dependencies. If you want to do this, then you need to have some knowledge of lua to be able to modify the files so they work stand-alone.

7 hours ago, raptor84 said:

So for example, if I'm copying the QW_OH_LT_Both_RWYTF_toggle function (those 2 or 3 lines) as outlined from auctions.lua file, I assume its going to work

You cannot assume that. You need to extract all dependencies, and then all functions that those depend on, etc etc.

7 hours ago, raptor84 said:

it appears something is missing because whom ever created that function must've left something out for that function to work, wouldn't you agree?

No. That lua script will work withing the LINDA environment, where all dependencies will be available. The use of a string rather than a number is minor - that will still work (due to lua's lax type specification - the string will be converted to a number), but it is always a good idea to correct such mistakes as they can cause issues - especially if blindly copied.

This error:
    1040344 *** LUA Error: C:\FSUIPC6\My789functions.lua:66: attempt to call global 'DspShow' (a nil value)
is telling you that he function DspShow, called on line 66 of the My789functions.lua script, does not exist. Just remove that line (and also remove it if it appears elsewhere in your script) and then try again. When you try again, look at the log file to see if any errors, correct them, and repeat. However, I think if you remove those calls to DspShow, the script should work.

If you want to use lua, you should really at least learn the basics of the lua language, If you don't want to do this, then you should use LINDA.

7 hours ago, raptor84 said:

I'm not trying to rant here but if I didn't need to come to this forum and seek help, I wouldn't have done so, even if the errors were obvious. In fact, I try searching the forum to help me solve the issue I'm having before posting my issue because I'm not trying to waste anyone's time here. I don't know what I'm looking for or even know what the error means. I don't think there is a manual to help translate the error, is there?? I'm not someone who knows code or software programming.

But if you want to use lua, you need to at least understand the basics, And the log files are there for a reason - to help you. If you get any issues, at least try looking at the logs. If there are basic errors, e.g. syntax errors or missing dependencies/functions, then this should be pretty obvious, as in this example.

I don't mind helping people with these sorts of issues, but I prefer to help people understand what the issue is and to help them diagnose and fix these type of issues for themselves. This then reduces the support I have to provide and gives me more time to develop and improve FSUIPC. I have a huge backlog at the moment but have hardly any time to work on improving my products as nearly all my time is spent on support.

John

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.