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
A command is said to perform a jump if it changes the flow of control irreversibly.
The definition is sound, but the term is not. A lot of literature uses jump to mean something more broad that what we are looking for. The meaning we pursue is the same as of an instruction that ends a basic block. Examples of usage in the current specification:
[...] The execution of a jump to outside the scope block leaves the lexical scope.
[...] After the set of statements are executed, control is transfered to the end of the IF block, unless execution of the statements resulted in a jump out of the block.
[...] This statement performs a jump to the label specified by identifier if the compare flag of the conditional element holds true. Otherwise, the flow of control is unchanged.
[...]
Even DMA Design used jump to refer to something more broad. On their GTA2script Manual they use jump to refer to the operation performed by a GOSUB.
With the new script system, it’s a lot easier to “jump” to other subroutines in the scriptfile without the messy line numbers. Instead you label a section of commands, and later in the code you “GOSUB” to it. When the subroutine code finishes processing, the game will return to the line after the GOSUB command, effectively ‘inserting’ the code contained at the label.
[...]
NOTE: Subroutines are very powerful, but be careful again with using them too much - they code make your code messy & difficult to follow. As you no longer need linenumbers, jumping about the file shouldn’t be needed quite as much - just insert the new code!
[...]
This is a powerful new command that launches a mission midgame from a different file to the current one. The new file must have a block of commands starting with a MISSIONSTART command & ending in a MISSIONEND command, similar to ‘LEVELSTART … LEVELEND’. When the command is run, the game will load in the file & ‘jump’ to the MISSIONSTART line. Think of it making the script do a ‘GOSUB’ to a label, it just so happens the jump is into a different file, with the label being the filename rather than the actual label… That make sense?
[...]
In this example, the program waits until a ped has reached a given location, incrementing a counter each turn. Functions need not be called as a new thread, they can be ‘jumped to’ and run in sequence instead of parallel. The GOSUB label call acts ‘in sequence’. There is no GOTO, only GOSUB so that the program must return out of the function. Example code:
That manual is quite informal, nevertheless, the term is not good enough. A better one have to exist.
The text was updated successfully, but these errors were encountered:
A jump is currently defined as:
The definition is sound, but the term is not. A lot of literature uses jump to mean something more broad that what we are looking for. The meaning we pursue is the same as of an instruction that ends a basic block. Examples of usage in the current specification:
Even DMA Design used jump to refer to something more broad. On their GTA2script Manual they use jump to refer to the operation performed by a GOSUB.
That manual is quite informal, nevertheless, the term is not good enough. A better one have to exist.
The text was updated successfully, but these errors were encountered: