GTA: Modification Area

A website for the GTA modding scene

Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Big-game starts raising Schneider's profile
Sun Mar 04, 2012 2:28 am by lavivi

» [Help] cleo created lighting
Thu Oct 14, 2010 1:03 am by findmy012

» Mission Question
Thu Oct 14, 2010 1:02 am by findmy012

» [IV] Spoiler Script
Thu Oct 14, 2010 1:02 am by findmy012

» Mission mod [help]
Sat Sep 18, 2010 5:50 pm by jayd00

» Bc7 Mod Help
Fri Aug 20, 2010 11:19 am by pengpeng

» Found a bug
Fri Dec 18, 2009 4:22 am by _CJ360_

» [IV] Novitec Rosso 599 GTB
Tue Nov 17, 2009 4:22 pm by Kotton

» Hello/Guidance Request
Mon Oct 12, 2009 6:45 am by Adler

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Affiliates
image

Image

Image

Image

Image

Image

Image

Image

Image

Image

image

Image

steve-m.com

Image


----- Русский -----

Если ваш сайт содержит большую коллекцию SCM/CLEO-скриптов (больше 16), напишите на мой e-mail, и я добавлю его в список. Приветствуются скрипты, которые не встречаются на других сайтах ... Спасибо. ))))


----- English -----

If your website has a big enough collection of SCM/CLEO scripts (more than 16) notify me by e-mail
, and I will add it to the list. The unique scripts are preferable ... Thank you. ))))

Log in

I forgot my password



December 2016
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728293031 

Calendar Calendar


You are not connected. Please login or register

Jump to 0 Offset

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Jump to 0 Offset on Fri Mar 06, 2009 9:44 am

The jump to 0 offset is a bug of the games engine. Which is caused by the engine's error. If you're making an endless loop starting from the very beginning of the script, your script will contain a so-called "ZERO JUMP" for instance here is a example:

Code:

// <script start>

:script_01

wait 0
// <script>
jump @script_01

For instance the jump "script_01" every label there is compiled with a relative offset. So, relative means that this label's position will be calculated from the memory address where a mission or script are located at.

So what is wrong with the script above? What offset? The @script_01 label will have ZERO, as it's linking with the starting point of the script. You can even write jump 0 instead, and it will be compiled same.

The GTA engine processes jumps slightly incorrectly. Come face to a jump 0,
the engine thinks that it's a GLOBAL label, not a LOCAL one. And global labels are processed relatively to the main.scm's starting position, which is 0xA49960 in the games memory. This jump @script_01 actually will lead you to the beginning of the main.scm file, however not your script's beginning. So you will see a buggy-unstable effect of the game restarting it's self.

Solving the problem is very easy, add any opcode(commonly 0000, 0001 or 03A4).

Code:

// <script start>
0000:

:script_01

wait 0
// <script>
jump @script_01

This is now OK, the label will be compiled with offset -2 (0xFFFFFFFE),
negative values are relative by the engine.

Commonly users make this mistake(not putting anything there), if there not aware of this problem in the engine, or they had just forgot, which you will find, may happen quite a lot.

View user profile http://gtamodding.com

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum