Feb 22 2010, 11:15 PM Post #1 | |
Coding like a Rockstar! Posts: 1,468 From: ??? Joined: 28-May 09 | Jump To 0 Offset The infamous "Jump to 0 offset" bug is usually noticed either by Sanny reporting it upon an attempt at compiling or when the game restarts from the beginning without ending the current: Fix This is caused by not naming a thread with: SANNY 03A4: name_thread 'NAME' However. Since every thread has to be named different and there is a chance of 2 CLEO threads ending up with the same name (and therefore crashing or bugging the game)... A workaround was found. Instead of using 03A4... Use: CODE 0000: NOP At the beginning of your script... Before any other opcode. Easy. -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
Nov 6 2014, 02:11 PM Post #2 | |
Ameteur Member Posts: 42 Joined: 3-November 14 | but that won't work in SCM scripts. I noticed that if like i made :NIKO at the first of the script and at the middle of the script i do jump @NIKO then this occurs. It happens to me because i do some errors while typing. -------------------- Rest in Peace Yeardley Diamond (Dec. 21, 1985 - Aug. 20, 2014) Rest in Peace Kitty0706 (1994 - Jan. 25, 2015) |
Nov 7 2014, 01:10 PM Post #3 | |
Coding like a Rockstar! Posts: 1,468 From: ??? Joined: 28-May 09 | OLD topic. The real reason is simply because you're not allowed to jump to the very first (0th) byte of non-main scripts. The engine works out offsets based on whether they're above or below 0. If it's below 0, the offset will be negated and added to the base of the current script address. If it's 0 or above, the offset will be used relative to the MAIN segment (entire main.scm file), which of course means that if you jump to 0, you'll jump to the start of the main.scm. That's why naming the thread or adding any other code before the earliest point you jump to fixes the problem. -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |