Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: marc1b on February 28, 2020, 02:25:19 PM
-
I'm trying to edit my ScreenScript.lua - the below function appears to be missing the declaration for inst and I get a nil error every time the function is called
No problem, I insert the missing line. The editor won't let me save the file, access is denied. So I do a "save as", exit and rename the file.
I check it to make sure my changes are there.
Then I open Mach and to my surprise if I view the screen script the change is not there. If I exit Mach and edit the file again sure enough it is gone.
I must be missing something
function GetFixOffsetVars()
local FixOffset = mc.mcCntlGetPoundVar(inst, 4014)
FixOffset = FixOffset * 10
local PoundVarX = 5221
if (FixOffset < 7) then
PoundVarX = 5221 + ((FixOffset - 1) * 20)
else
PoundVarX = 7001 + ((FixOffset - 7) * 20)
end
PoundVarY = PoundVarX + 1
PoundVarZ = PoundVarX + 2
return PoundVarX, PoundVarY, PoundVarZ
end
-
Hi,
this post belongs on the Mach4 General Discussion Board and no doubt tweakie will shift it there.
I'm trying to edit my ScreenScript.lua
ScreenScrpit.lua IS NOT EDITABLE.
It is in fact ALL the Lua code fragments/marcos put together into one large file, it is not nor was ever intended to be
editable. If you wish to edit it you must edit that Lua fragment and that edited fragment will get included in the new ScreenScript.lua.
Craig
-
I get it, thanks!!
-
i think you missing the "inst" parameter define
its function and even you define it before on the main ,you need define inside the function
(about 6- month they upgrade the version then its become like that)
-
Thanks, yes that is exactly what I thought the problem is
-
Hi, where can i edit a specific LUA fragment of the screen script? I typed in a syntax error and mach4 just closes after starting. I know exactly which is the syntax error. I hope you can answer rapidly so i can go on with the development of my screen and my profile. Thanks.
-
Operator->edit screen. Click the profile in the Screen Tree Manager. Click the Events icon in the properties tab. Click the ellipses on the screen load script. locate the offending code, edit and save.
If you haven't watched the screen editing video it is worth a view:
https://www.youtube.com/watch?v=P1xZkFgS5cQ
HTH
RT
-
Hi.
The situation was i couldn“t enter the screen editor because the GUI would close almost as soon as i picked the profile i wanted to work with, at start. Luckily one guy on a Facebook forum helped me as he proposed an excellent solution: add a couple of commands to the route of the file in the properties of the Mach4 loader desktop shortcut, so the software could go right to the screen editor at start up, and i could correct the syntax errors to have the screen script running in the right way.
-
Daniel,
Just out of curiosity what did you need to do to the shortcut to open screen editor on startup?
Bill
-
C:\Mach4Hobby\Mach4GUI.exe /pnameofprofile /e
-
Thanks Daniel