Jump to content
The simFlight Network Forums

Lua script to avoid GSX menus ?


Recommended Posts

I have a complete A320 home cockpit, currently running with FSLabs. I can do the complete GSX flow from the hardware, but of course I still get the GSX menus on the main scenery beamer. Not very immersive.

I'm currently running everything from one PC, but would have a second PC available for networking. I was wondering, is there any chance, maybe via WideFS, to use LUA scripts to avoid these menus popping up ? I have never used LUA scripts before, so sorry if this might be a stupid question.

Mike

Link to comment
Share on other sites

21 minutes ago, Mikealpha2 said:

I'm currently running everything from one PC, but would have a second PC available for networking. I was wondering, is there any chance, maybe via WideFS, to use LUA scripts to avoid these menus popping up ? I have never used LUA scripts before, so sorry if this might be a stupid question.

Assuming you are using P3D3, 4 or 5 (you don't say), I'm afraid there's no way of suppressing the menus appearing. There's an option in P3D to suppress all the other texts.

For another PC with WideFS, you can have those other texts AND the Menus appearing neatly on another screen. I do this, with a small 7" screen (mounted vertically) attached to the inside of my cockpit.  The Lua plug-in I use is called AllTexts.lua and you will find it in the Example LUA plugins.zip file.  It makes full use of the event.textmenu function in Lua, explained on page 31 of the Lua library document. If you read through that it will give you a good idea of what it is about.

Since FSUIPC 5.142 the textmenu function has also been included in FSUIPC, so it is also possible to do all this on the same PC as P3D, but with the displays on a separate screen from your projected views.

Pete

 

 

Link to comment
Share on other sites

1 hour ago, Pete Dowson said:

Since FSUIPC 5.142 the textmenu function has also been included in FSUIPC, so it is also possible to do all this on the same PC as P3D, but with the displays on a separate screen from your projected views.

Thanks Pete for the fast answer and encouraging info. I'm using P3Dv5.

Now that sounds like a really neat option. I'd indeed have some rectangular space on the upper ECAM display, approx. 10*3cm physically, to display the menu. Do I have influence on the font size to squeeze the menu in there ?

Anyway, I''ll have a detailed look at the AllTexts.lua script and event.textmenu function when I return home.

Thanks again Mike

Link to comment
Share on other sites

1 hour ago, Mikealpha2 said:

Do I have influence on the font size to squeeze the menu in there ?

Yes, there are all sorts of parameters concerning window size and so on. You might need to refer to the Lua library document for details.

1 hour ago, Mikealpha2 said:

Anyway, I''ll have a detailed look at the AllTexts.lua script and event.textmenu function when I return home.

Yes, it should become clear enough.

Pete

 

Link to comment
Share on other sites

Pete, I'm trying to understand the docs, and thought in parallel I let Alltexts.lua run just to see what it does. However, there is an error in the logs

"117422 *** LUA Error: H:\Prepar3Dv4\Modules\Alltexts.lua:88: attempt to index global 'wnd' (a nil value)"

That's FSUIPC 5.157 on my Laptop with P3Dv4. Is there anything additional I need to do ?

Mike

Link to comment
Share on other sites

15 hours ago, Mikealpha2 said:

Pete, I'm trying to understand the docs, and thought in parallel I let Alltexts.lua run just to see what it does. However, there is an error in the logs

"117422 *** LUA Error: H:\Prepar3Dv4\Modules\Alltexts.lua:88: attempt to index global 'wnd' (a nil value)"

That's FSUIPC 5.157 on my Laptop with P3Dv4.

Ah.  Sorry, that's probably my error. The "wnd" lua library was a fairly recent addition in FSUIPC (it's been in WideClient for a long time). Looking in the Lua libray document you have is the Wnd library there, with it's own chapter (just headed "The Wnd Library"?

Unfortunately my later (FSUIPC6) copy of the Lua document doesn't say when it was added to FSUIPC, but I think it wasn't added till FSUIPC6.

If it wasn't added to FSUIPC5 then, sorry, your only options would be to upgrade to FSUIPC6 (there is a discount for FSUIPC5 users), or pay for the WideFS extension. With WideFS enabled you could run WideClient on another PC or on the same PC as P3D (changing "ClassInstance=0" to ClassInstance=1 in the WideClient.INI file.

Pete

Link to comment
Share on other sites

No problem, as I have FSUIPC6 on my Home Cockpit PC, just on my Laptop it wasn't installed.

I'm afraid I still need some starting help. I have put AllTExts.lua in the FSUIPC6 folder, I see 1=Alltexts is written in the LuaFiles section in the ini file. Nothing happens in P3D though. I also can't see it in the Logs. Yesterday in FSUIPC5 an alltexts.log was generated after enabling Lua logging. Now in FSUIPC6 it's not.

Mike

Link to comment
Share on other sites

42 minutes ago, Mikealpha2 said:

Nothing happens in P3D though.

You have to start the lua. Either add it an  [Auto[ section thus:
    [Auto]
    1=Lua AllTExts

(or just add a new entry for this script if you already have an [Auto] section)

Alternatively, you can run the lua script on a button or key press via assigning in the usual way.

 

Link to comment
Share on other sites

1 hour ago, Mikealpha2 said:

Yesterday in FSUIPC5 an alltexts.log was generated after enabling Lua logging. Now in FSUIPC6 it's not.

As John said, it needs starting. The same applies to FSUIPC5, so I don't know how you got a log there unless you did have something starting it. Only WideClient automatically starts Lua files automatically.

The reason FSUIPC cannot start Lua files simply because they are present is that one of the main uses of such files is to do relatively simple things in response to button presses, effectively adding to the range of operations to which you can assign.  In that way they are similar to macros.

Also, to clarify, the Lua logging option is specifically to make Lua log entries go to their own file -- normally they'd go to the FSUIPC log. But the entries are always made, if there are any (not all Lua file contain "ipc.log" function calls).

It would be worth your while at least reading the FSUIPC Lua Plug-Ins.pdf, which does cover much of this, and more. The Lua Library document is more for reference when making your own plug-ins.

Pete

 

 

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.