You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EAccessViolation when attempting to compile via CLI #117
When I try to compile a small code (.txt) to .cs using command line in Sanny Builder, I get “Access violation” error.
Error screenshot:
Script source code:
{$CLEO .cs}
0000:
repeat
wait 0
until player.Defined(0)
player.Money(0) += 500
018C: play_sound 1054 at 0.0 0.0 0.0
0A93: terminate_this_custom_script
This source file can be compiled perfectly fine if manually open in SB. But when it is compiled through CLI, the resulting .cs gets somehow corrupted: the script actually works in the game but its decompiled code is full of some trash: PyTest.txt
Additional information:
Tested on SB ver. 3.6.2 and 3.5.1.
Launched in .py, cmd, and sanny.exe shortcut.
Launching as admin didn't help.
The launch command in the shortcut is the following: "C:\Program Files (x86)\Sanny Builder 3\sanny.exe" -m sa --no-splash -c "D:\Games\GTA SA\CLEO\PyTest.txt" "D:\Games\GTA SA\CLEO\PyTest.cs".
Attempting to compile with SB v3.6.2 installed on D: drive yielded the same result.
Attempting to compile from .txt with UTF-8 with BOM encoding results in this absurd: PyTest.txt
Me and @wmysterio have struggled with this problem for some time but we didn't manage to find a solution yet. Thanks for any help!
I tested with {$NOSOURCE}. SB saved file with encoding ASCII (maybe). If use his or convert this file to ANSI or UTF-8 without BOM then compiling/decompiling complete successfully. Need answer from @VitalRus95 .
Vital's file generate compile.log with error: Unknown command п»ї{$CLEO .cs}. This is typical when use UTF-8 (with BOM) encoding. Need try to teach SB to save the source in the desired encoding so as not to use {$NOSOURCE} unnecessarily.
I tested with {$NOSOURCE}. SB saved file with encoding ASCII (maybe). If use his or convert this file to ANSI or UTF-8 without BOM then compiling/decompiling complete successfully. Need answer from @VitalRus95 .
Vital's file generate compile.log with error: Unknown command п»ї{$CLEO .cs}. This is typical when use UTF-8 (with BOM) encoding. Need try to teach SB to save the source in the desired encoding so as not to use {$NOSOURCE} unnecessarily.
Yes, both Python and SB generate .txt with UTF-8 (without BOM) encoding (as indicated in Notepad++). Yet manually it can be both compiled and decompiled without any issues and without {$NOSOURCE}.
As a workaround add {$NOSOURCE} at the top of your script and it should compile.
{$NOSOURCE} works nice! No error is thrown, the script gets compiled and decompiled fine. Thanks a lot for this suggestion, I hope it won't be too difficult to eliminate the bug in future versions of SB! Good luck!
Activity
x87 commentedon Dec 21, 2020
@VitalRus95 Confirming this bug.
As a workaround add
{$NOSOURCE}at the top of your script and it should compile.wmysterio commentedon Dec 22, 2020
I tested with
{$NOSOURCE}. SB saved file with encodingASCII(maybe). If use his or convert this file toANSIorUTF-8 without BOMthen compiling/decompiling complete successfully. Need answer from @VitalRus95 .Vital's file generate
compile.logwitherror: Unknown command п»ї{$CLEO .cs}. This is typical when useUTF-8 (with BOM)encoding. Need try to teach SB to save the source in the desired encoding so as not to use{$NOSOURCE}unnecessarily.VitalRus95 commentedon Dec 22, 2020
Yes, both Python and SB generate .txt with UTF-8 (without BOM) encoding (as indicated in Notepad++). Yet manually it can be both compiled and decompiled without any issues and without
{$NOSOURCE}.VitalRus95 commentedon Dec 22, 2020
{$NOSOURCE}works nice! No error is thrown, the script gets compiled and decompiled fine. Thanks a lot for this suggestion, I hope it won't be too difficult to eliminate the bug in future versions of SB! Good luck!