[BUG] Client side scripts randomly not working

Athanatos

  • Hero Member
  • Posts: 985
[BUG] Client side scripts randomly not working
«  »Last edited
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:
Code: [Select]
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:
Code: [Select]
::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.
Developer of RCNR, Zombie Survival, VLSM(C++) and Infected City Survival

MatheuS

  • Wiki Contributor
  • LBR | Co-Leader & Brasil Real RPG | Developer
  • Posts: 466
[BUG] Re: Client side scripts randomly not working
« Reply #1,  »
Did you try to use it like this?

Code: [Select]
::test <- "Test Message";

function Script::ScriptLoad()
{
    Console.Print(::test);
}

Code: [Select]
function Script::ScriptLoad()
{
    ::test <- "Test Message";
    Console.Print(::test);
}
Code: [Select]
if( !sucess ) tryAgain();

Thanks to the VCMP community. It was the happiest period of my life.

Athanatos

  • Hero Member
  • Posts: 985
[BUG] Re: Client side scripts randomly not working
« Reply #2,  »
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.
Developer of RCNR, Zombie Survival, VLSM(C++) and Infected City Survival