Description
Uncompiled client side main.nut scripts dont work.
Reproducible
Sometimes.
What you were doing when the bug happened
Starting my script to 0. I got the following error:
MSG: Main Script line = (1) column = (1) : error expression expected
Warning in CScripting::Initialise: Loading main script file failed with error message: expression expected.
Warning in CScripting::Initialise: Attempting manual closure load.
Error in CScripting::Initialise: Loading bytecode stream failed with error message: invalid stream.
The code was the following:
::test <- "Test Message";
function Script::ScriptLoad()
{
Console.Print(test);
}
I tried recreating the script file, rewriting the code, changing the line endings from \n to \r\n .Nothing worked.
What you think caused the bug
¯\_(ツ)_/¯ Client side maybe thinking the uncompiled script is maybe a compiled one?
WORKAROUND
Compile the script using the Squirreil Compiler. Fixed the issue, but still reporting because this is an awful bug.
Did you try to use it like this?
::test <- "Test Message";
function Script::ScriptLoad()
{
Console.Print(::test);
}
function Script::ScriptLoad()
{
::test <- "Test Message";
Console.Print(::test);
}
The script can be succesfullly compiled using sq-compiler-gui. But I already got a workaround by using an empty compiled script.
+The error is at the first line and column.