Hello Guest it is May 17, 2024, 06:08:56 PM

Author Topic: Lua Error  (Read 896 times)

0 Members and 1 Guest are viewing this topic.

Lua Error
« on: September 17, 2021, 07:50:19 PM »
Whenever I load my PMDX profile and press the "Enable" button I get an error that states "Lua: Error occurred while opening file cannot open C:\Mach4Hobby\Profiles\PMDX416\Macros\mcLua.mcc"

PMDX416 is a profile I created by copying the PMDX sample profile.  I have ensured that the file is in the directory but have watched it get deleted from the directory when loading the screen.  Why is the file getting deleted when loading the screen?
Re: Lua Error
« Reply #1 on: September 17, 2021, 09:27:23 PM »
Hi,

Quote
file cannot open C:\Mach4Hobby\Profiles\PMDX416\Macros\mcLua.mcc"

That file is ALL the Lua code of your installation, including things like macros, the ScreenLoad script etc all bundled into one chunk and then
compiled. The compiled file is what actually gets run at runtime.

If any of the smaller chunks of Lua code get changed during a session a new mcLua.mcc must be generated for the changed code to be enacted.
At start-up Mach attempts to determine if the existing mcLua.mcc file from the last session is available and ready to use...if it is; it does so. If its
not, or there have been changes to the Lua code then it will delete the out of date mcLua.mcc and compile a fresh version.

I suspect that is what you are seeing, Mach has determined that a new version of mcLua.mcc is required so it deletes the old one....but it can't
generate a new one because one or more chunks of Lua code in your installation is faulty and will not complie....ergo no new mcLua.mcc.

Think back, did you make any alterations to any Lua code, and thereafter this problem ocurred? If thats the case you might try opening  one
of the backup files that were recorded before this problem began. Another alternative is the run mcMach4GUI.exe from the Windows command line
with the switch: mcMach4GUI.exe/e    the 'slash e' should allow you to open Mach directly into screen edit mode which would allow you to edit out the
offending code.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Lua Error
« Reply #2 on: September 17, 2021, 10:29:28 PM »
It happens on a clean installation with the only addition is the plug-in for my PMDX controller.  In the profiles created by Mach4 there is no problem.  The Profiles created by The PMDX plug-in installer all have the same problem.  I don't know what it changes when it installs.  It is the latest build for both PMDX and Mach4.
Re: Lua Error
« Reply #3 on: September 18, 2021, 01:02:08 AM »
Hi,
I can only suggest that the PMDX recommended plugin is somehow corrupt.

Over a period of time the version of Lua used by Mach4 has changed, from 5.1 in the early days to 5.3 now. In some cases code that
compiles with Lua 5.2 will not compile with Lua 5.3. PMDX has a very good reputation for support, so I would be asking Steve in the  first instance.

The other alternative is to hell with PMDX's suggest profile....just generate your own. Start with a individually named copy of wx4.set, or whatever your
preferred Mach supplied profile is, and modify it to suit your own needs. Note that you must start with a named copy of the Mach supplied profile
or otherwise all your tweaks and additions will get overwritten when you next update to the latest Mach build. How do I know......???.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Lua Error
« Reply #4 on: September 18, 2021, 05:24:13 AM »
Try deleting all .mcc files in the macros folder for the profile you are using and restart Mach. It should then recompile everything and give you mcLua.mcc