Vice City: Multiplayer

VC:MP Discussion => Support => Bugs and Crashes => Topic started by: NicusorN5 on Jan 07, 2020, 05:23 PM

Title: [BUG] Client side scripts randomly not working
Post by: NicusorN5 on Jan 07, 2020, 05:23 PM
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.
Title: Re: [BUG] Client side scripts randomly not working
Post by: MatheuS on Jan 09, 2020, 02:13 PM
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);
}
Title: Re: [BUG] Client side scripts randomly not working
Post by: NicusorN5 on Jan 09, 2020, 04:01 PM
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.