Closed Aldrin-John-Olaer-Manalansan closed 3 months ago
I take it back 🤦 , Sanny builder 4 messed up the arrangement of the opcode's parameters, wtf?
In new SBL modes all opcodes have their arguments in the original conventional order: all inputs first, outputs after. 0AA2 had their params re-ordered in legacy SA 1.0 mode.
Quick solution: don't use opcode syntax in new SBL mode. Sanny will correctly arrange params in all commands:
{$CLEO}
nop
if not 0@ = load_dynamic_library "Kernel32.dll"
then terminate_this_custom_script
end
terminate_this_custom_script
Yep, error message clearly informs you that input parameters is invalid. Decompiled code shows you switched arguments around. This script is not working in CLEO4 too, but it just fails in silence. I'm surprised it is not crashing, but it would anyway if the (not)loaded library was put to use later.
I have a script that uses foreign functions from MSIAPI. They are working properly on Cleo 4.4.1, but after I migrated to Cleo 5 then this error message shows up:
I have come up with a very simple test script that only tries to execute Opcode 0AA2 with conditions:
Sanny builder 3 correctly decompiles it:
and Sanny builder 4 as well correctly decompiles it:
So I'm sure that Cleo 5 has the issue.
Take note that I didn't use any DLL Procs for this test because I find it unecessary to test as well, since the failure happens when the DLL gets loaded.
Using this cleo script, Error message pops up, while ingame a red error message overlay is at the top of the screen.
Single Player:
SAMP
This confirms that opcode 0AA2 doesn't work the way it should be. Or maybe I'm using it wrong?