Hello Guest it is June 06, 2020, 06:10:58 AM

Author Topic: Script editor strange behavior - or is it me?  (Read 175 times)

0 Members and 1 Guest are viewing this topic.

Script editor strange behavior - or is it me?
« 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
Re: Script editor strange behavior - or is it me?
« Reply #1 on: February 28, 2020, 11:37:29 PM »
Hi,
this post belongs on the Mach4 General Discussion Board and no doubt tweakie will shift it there.

Quote
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

My wife left with my best friend...
     and I miss him!
Re: Script editor strange behavior - or is it me?
« Reply #2 on: March 02, 2020, 10:15:35 AM »
I get it, thanks!!
Re: Script editor strange behavior - or is it me?
« Reply #3 on: March 02, 2020, 11:50:24 AM »
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)

Re: Script editor strange behavior - or is it me?
« Reply #4 on: March 02, 2020, 03:56:29 PM »
Thanks, yes that is exactly what I thought the problem is