Difference between revisions of "SCM language"

From GTAMods Wiki
Jump to navigation Jump to search
m (Changed DO-WHILE in DO-WHILE_TRUE as in GBHScript coding (GTA2), due to an inevitable collision with the WHILE statement because of the lack of a distinguishing token.)
(Article corrected according to the reverse engineering applied to R* compiler left in the android version of GTA Vice City 10th Anniversary (thanks a lot to Link2012 too).)
Line 1: Line 1:
 
{{This|This section deals with the native SCM syntax of GTA 3 series, nothing other than [[GTA 3|III]], [[GTA VC|VC]], [[GTA SA|SA]], [[GTA LCS|LCS]] and [[GTA VCS|VCS]].<br/>
 
{{This|This section deals with the native SCM syntax of GTA 3 series, nothing other than [[GTA 3|III]], [[GTA VC|VC]], [[GTA SA|SA]], [[GTA LCS|LCS]] and [[GTA VCS|VCS]].<br/>
 
It may contain non-standard SCM definitions as R* hasn't published enough documentation about it yet.}}
 
It may contain non-standard SCM definitions as R* hasn't published enough documentation about it yet.}}
{{TocRight}}On the occasion of the GTAIII's tenth anniversary, after a long period of darkness where we fell about the real ''SCM'' syntax, R* finally treated us by attaching part of its own original source code into the GTAIII Anniversary game, available for iOS and Android devices. As far back as 2001, a snip of some debugging scripts has been already provided with ''main.sc'' and ''debug.sc'' files. However, many secrets are unrevealed yet, thus some things cannot be documented fully and so they can be only guessed. The ''SCM'' format abbreviation is one of countless proofs of this inconvenience, which may stand for ''Script Control Merged''. Other doubts come with source files, whose ''SC'' extension appears to be very close to ''Script Control''. At first, someone could have asked oneself how R* named its own programming language: ''R#''? ''R-Sharp''? ''Rockstar Sharp''? Who knows. We simply call it '''SCM language''' due to the lack of information. Nevertheless, the '''SCR language''' name is cropping up gradually.
+
{{TocRight}}On the occasion of the GTAIII's tenth anniversary, after a long period of darkness where we fell about the real ''SCM'' syntax, R* finally treated us by attaching part of its own original source code into the GTAIII Anniversary game, available for iOS and Android devices. As far back as 2001, a snip of some debugging scripts has been already provided with ''main.sc'' and ''debug.sc'' files. However, many secrets are unrevealed yet, thus some things cannot be documented fully and so they can be only guessed. The ''SCM'' format abbreviation is one of countless proofs of this inconvenience, which may stand for ''Script Multifile''. Other doubts come with source files, whose ''SC'' extension appears to be very close to ''Mission SCript''. At first, someone could have asked oneself how R* named its own programming language: ''R#''? ''R-Sharp''? ''Rockstar Sharp''? Who knows. We simply call it '''SCM language''' due to the lack of information. Nevertheless, the '''SCR language''' name is cropping up gradually. However, it is definitely based on [[Wikipedia:BASIC|BASIC]].
  
  
Line 37: Line 37:
 
  [...] /* Some inline comment */ [...] /* Some inline comment */ [...]
 
  [...] /* Some inline comment */ [...] /* Some inline comment */ [...]
  
;Limit
+
==Highlighters==
:Multiline comments cannot be nested.
 
  
==Brackets==
+
''Highlighters'' behaviour sounds trivial, that's to say they simply highlight one or more [[#Arguments|arguments]] per [[#Commands|command]] within ''round brackets'', individually or together. However, a ''comma'' can be used aswell to distinguish each argument. In {{icon|3}}, they appear to be used only for '''SETUP_ZONE_PED_INFO''' (in a various order) and ''GXT keys'':
  
Brackets play an important role, especially when organizing multiple [[#Structure|scripts]] in a single file becomes necessary.
+
SETUP_ZONE_PED_INFO FISHFAC DAY (0) 0 0 0 (0 0 0 0) 0
 +
PRINT_BIG (T4X4_1) 5000 2
  
===Curly brackets===
+
==Scopes==
  
''Curly brackets'' (or ''multiline brackets'') act like a [[#Scope|local variable scope]]. Essentially, they enclose the code where [[#Local|local variables]] are used, including [[#Timers|timers]]. They can be opened and closed many times in a [[#Structure|script]]:
+
''Scopes'' are delimited by ''curly brackets'' (or ''multiline brackets'') which act like a [[#Local|local]] [[#Variables|variable]] [[#Scope|scopes]]. Essentially, they enclose the code where local variables are used, including [[#Timers|timers]]. They can be opened and closed many times in a [[#Structure|script]]:
  
 
  {
 
  {
Line 52: Line 52:
 
  }
 
  }
  
===Round brackets===
+
;Limit
 
+
:Scopes cannot be nested.
Actually, the ''round brakets'' (or ''multi inline brackets'') behaviour sounds trivial, that's to say they simply highlight one or more [[#Arguments|arguments]] per [[#Commands|command]], individually or together. In {{icon|3}}, they appear to be used only for '''SETUP_ZONE_PED_INFO''' (in a various order) and ''GXT keys'':
 
 
 
SETUP_ZONE_PED_INFO FISHFAC DAY (0) 0 0 0 (0 0 0 0) 0
 
PRINT_BIG (T4X4_1) 5000 2
 
 
 
They might lock up ''null'' values.
 
  
 
==Labels==
 
==Labels==
Line 68: Line 62:
 
   
 
   
 
  {lblname}:
 
  {lblname}:
 
 
  [...]
 
  [...]
  
Line 76: Line 69:
  
 
A ''variable'' is a ''storage location'' assigned to a ''symbolic name'' which contains a ''value'' of any ''type''.
 
A ''variable'' is a ''storage location'' assigned to a ''symbolic name'' which contains a ''value'' of any ''type''.
 +
 +
===Value===
 +
 +
A ''value'' represents ''any data of any type'' it is.
  
 
===Scope===
 
===Scope===
Line 87: Line 84:
 
====Local====
 
====Local====
 
----
 
----
The ''local scope'' wraps a ''localized part of the source code''. Variables defined as ''locals'' are visible only in the ''code enclosed by [[#Curly Brackets|curly brackets]]''. They are declared by appending the '''LVAR''' prefix.
+
The ''local scope'' wraps a ''localized part of the source code''. Variables defined as ''locals'' are visible only in the ''code enclosed by curly brackets''. You can put them everywhere and as many times as you want in the source code. They are declared by appending the '''LVAR''' prefix.
  
 
=====Timers=====
 
=====Timers=====
  
A ''timer'' is a ''singular local variable'' whose value rises automatically. It starts incrementing since the beginning of the [[#Structure|script]] where it has been placed and grows endlessly. There are ''2 usable timers'' which are already defined as '''TIMERA''' and '''TIMERB''', therefore they do not need to be declared.
+
A ''timer'' is a ''special local variable'' whose value rises automatically. It starts incrementing since the beginning of the script where it has been placed and grows endlessly. There are ''2 usable timers'' which are already defined as '''TIMERA''' and '''TIMERB''', therefore they do not need to be declared.
  
 
===Types===
 
===Types===
Line 99: Line 96:
 
====INT====
 
====INT====
  
The '''INT''' type handles ''32-bit signed integer'' values. It is also used to store values with less bytes, such as a ''bool'', a ''char'' and a ''short int''.
+
The '''INT''' type handles ''32-bit signed integers''. It is also used to store [[#Value|values]] with less bytes, such as a [[Wikipedia:Primitive_data_type#Booleans|bool]], a [[Wikipedia:Character_(computing)#char|char]] and a [[Wikipedia:Integer_(computer_science)#Short_integer|short int]].
  
 
====FLOAT====
 
====FLOAT====
  
The '''FLOAT''' type handles ''32-bit floating-point'' values. As it normally does, decimal precision is usually stuck to 6 digits beyond which it may get lost.
+
The '''FLOAT''' type handles ''32-bit floating-points''. As it normally does, decimal precision of a [[Wikipedia:Floating_point|float]] is usually stuck to 6 digits beyond which it may get lost.
  
====CONST====
+
====TEXT_LABEL====
  
'''CONST''' is a ''special'' type that handles ''32-bit signed integer'' values. It is used only to compare [[#Constants|constants]] of ''model identifiers'', ''task statuses'', ''ped events'' and such. It mightn't be used directly but divided into other subordinal types. At the moment, it is merely a suggestion because constants are processed in bulk apparently instead of file by file.
+
The '''TEXT_LABEL''' type handles ''8-byte strings''. Generally, a [[Wikipedia:String_(computer_science)|string]] is an ''array of 1-byte characters''. It requires ''7 characters plus the [[Wikipedia:Null_character|null-terminator]]'' (a blank byte meaning the ''end of the string''). It is used to hold ''GXT keys'' (those of ''town zones'', ''interiors'', ''help textes'' or ''dialogue subtitles'') ''script names'' or any short string.
  
 
;Limit
 
;Limit
:'''CONST''' variables are supported since {{icon|vc}}.
+
:'''TEXT_LABEL''' variables are supported in {{icon|sa}} and {{icon|vcs}}.
  
 
====STRING====
 
====STRING====
  
The '''STRING''' type handles ''8-byte strings''. Generally, a ''string'' is an ''array of 1-byte characters''. It often requires ''7 characters plus the null-terminator'' (a blank byte meaning the ''end of the string''). It is used to hold ''GXT keys'' (those of ''town zones'', ''interiors'', ''help textes'' or ''dialogue subtitles'') or ''script names''.
+
The '''STRING''' type handles ''16-byte strings''. Like the previous, this type holds ''15 characters plus the null-terminator''. It is used to store ''model and texture names of player clothes'', ''animation names'' or any long string. It may be a ghost type as later R* compilers might choose between the two string types automatically according to the length of the string itself.
 +
 
 +
;Limit
 +
:'''STRING''' variables and values are supported in {{icon|sa}}.
 +
 
 +
====OFFSET====
 +
 
 +
The '''OFFSET''' type handles ''16-byte strings''. They can refer to either a ''[[#Labels|label]] name'' or a ''file name''.
  
 
;Limit
 
;Limit
:'''STRING''' variables are supported in {{icon|sa}} and {{icon|vcs}}.
+
:'''OFFSET''' variables aren't available.
 +
 
 +
====NUMBER (pseudo)====
  
====NAME====
+
The '''NUMBER''' type handles ''32-bit signed integers'' or ''32-bit floating-points''. It is used only to assign and compare ''numbers'' to '''INT''' or '''FLOAT''' variables. It is a pseudo type of '''INT''' or '''FLOAT'''.
  
The '''NAME''' type handles ''16-byte strings''. Like the previous type, it often holds ''15 characters plus the null-terminator''. It is used to store ''model and texture names of player clothes'' or ''animation names''. It may be a ghost type as R*'s compiler might choose between the two string types automatically according to the length of the string itself.
+
====CONSTANT (pseudo)====
 +
 
 +
The '''CONSTANT''' type handles ''32-bit signed integers''. It is used only to assign and compare [[#Constants|constants]] to '''INT''' variables regarding ''model [[#Identifiers|identifiers]]'', ''task statuses'', ''ped events'' and such. It is a pseudo type of '''INT'''.
  
 
;Limit
 
;Limit
:It is supported in {{icon|sa}}.
+
:The [[#Arithmetic|assignment]] and [[#Comparison|comparison]] of '''CONSTANT''' values are supported since {{icon|vc}}.
 +
 
 +
====BUFFER====
 +
 
 +
The '''BUFFER''' type handles ''128-byte strings''. It holds ''127 characters plus the null-terminator''. Strings of such type must be put in ''quotation marks'':
 +
 
 +
SAVE_STRING_TO_DEBUG_FILE "128B TEXT"
 +
 
 +
;Limits
 +
:'''BUFFER''' values are supported since {{icon|sa}}.
 +
:'''BUFFER''' variables aren't available.
 +
 
 +
====VARLEN====
 +
 
 +
The '''VARLEN''' type handles ''N-byte strings''. It holds ''N characters plus the null-terminator''. Strings of this type mustn't exceed 255 characters.
 +
 
 +
;Limits
 +
:'''VARLEN''' values are supported since {{icon|sa}}.
 +
:'''VARLEN''' variables aren't available.
  
 
===Declaration===
 
===Declaration===
Line 132: Line 158:
 
  {varscope}_{vartype} {varname0}[,] [... {varnameN}]
 
  {varscope}_{vartype} {varname0}[,] [... {varnameN}]
  
As mentioned in the sections above, local variables have to be put within [[#Curly brackets|curly brackets]]:
+
As mentioned in the sections above, local variables have to be put within curly brackets:
  
 
  {
 
  {
Line 143: Line 169:
  
 
;Limit
 
;Limit
:Whereas the ''variable buffer'' is limited, you can declare a certain amount of globals and locals. ''Numerical'' ([[#INT|INT]], [[#FLOAT|FLOAT]]) and special ([[#CONST|CONST]]) types take 1 variable, while string types ([[#STRING|STRING]], [[#NAME|NAME]]) occupy respectively 2 and 4 variables to store some data (have a look [[#Variables_2|here]] for further details).
+
:Whereas the ''variable buffer'' is limited, you can declare a certain amount of globals and locals. [[#INT|INT]] and [[#FLOAT|FLOAT]]) types take 1 variable, while [[#TEXT_LABEL|TEXT_LABEL]] and [[#STRING|STRING]] types occupy respectively 2 and 4 variables to store their data (have a look [[#Variables_2|here]] for further details).
  
 
====Arrays====
 
====Arrays====
  
A ''array'' is a ''collection of variables'' having the same type which can be accessed by an ''index'', an integer value enclosed by ''square brackets'':
+
A ''array'' is a ''collection of variables'' having the same type which can be accessed by an ''index'', a 1-based integer lesser than or equal to the size specified, enclosed by ''square brackets'':
  
  {varscope}_{vartype} {varname0}{[arrsize0]}[,] [... {varnameN}{[arrsizeN]}]
+
  {
 +
    {varscope}_{vartype} {varname0}{[arrsize0]}[,] [... {varnameN}{[arrsizeN]}]
 +
 +
    [...]
 +
}
  
;Limit
+
;Limits
:It is supported since {{icon|sa}}.
+
:The usage of arrays is allowed since {{icon|vc}}.
 +
:Variable indices are quite buggy in {{icon|vc}} and therefore unrecommended, but they are fully supported since {{icon|sa}}.
 +
 
 +
====Handles====
 +
 
 +
A ''handle'' is an univocal identifier assigned to a game entity. It is given by the following statement:
 +
<source lang=cpp>short nHandle = (iEntityIndexInPool << 8) | ucEntityFlag;</source>
 +
R* compiler won't let you assign different entity types to the same variable or using a variable which hasn't been assigned to any '''CREATE_*''' or '''ADD_*''' entity [[#Commands|commands]].
  
 
==Operators==
 
==Operators==
Line 160: Line 197:
 
===Arithmetic===
 
===Arithmetic===
  
''Arithmetic operators'' compute some of the most common algebric calculations between either a variable and a value or two variables. As well as in some programming language happens, string ([[#STRING|STRING]], [[#NAME|NAME]]) and special ([[#CONST|CONST]]) types are free from these operators, except for the ''basic assigment''  (see also [[#Operators composition|Operators composition]]):
+
''Arithmetic operators'' compute some of the most common algebric calculations between either a [[#Variables|variable]] and a [[#Value|value]] or two variables. As well as in some programming language happens, [[#CONSTANT|CONSTANT]], [[#TEXT_LABEL|TEXT_LABEL]] and [[#STRING|STRING]] types are free from these operators, except for the ''basic assigment''  (see also [[#Operators composition|Operators composition]]):
  
 
{|class=wikitable
 
{|class=wikitable
 
!width=70px|Operator
 
!width=70px|Operator
 
!width=200px colspan=2|Name
 
!width=200px colspan=2|Name
!width=180px|Syntax
+
!width=200px|Syntax
!width=485px|Description
+
!width=500px|Description
 
|-
 
|-
 
!<code>=</code>
 
!<code>=</code>
Line 181: Line 218:
 
|align=center colspan=2|Subtraction
 
|align=center colspan=2|Subtraction
 
|align=center|<code>expr0 '''-''' expr1</code>
 
|align=center|<code>expr0 '''-''' expr1</code>
|Subtract ''expr1'' to ''expr0''
+
|Subtract ''expr1'' from ''expr0''
 
|-
 
|-
 
!<code>*</code>
 
!<code>*</code>
Line 192: Line 229:
 
|align=center|<code>expr0 '''/''' expr1</code>
 
|align=center|<code>expr0 '''/''' expr1</code>
 
|Divide ''expr0'' by ''expr1''
 
|Divide ''expr0'' by ''expr1''
 +
|-
 +
!<code>+@</code>
 +
|align=center colspan=2|Timed addition
 +
|align=center|<code>expr0 '''+@''' expr1</code>
 +
|Multiply ''expr2'' by delta time and add the result to ''expr1''
 +
|-
 +
!<code>-@</code>
 +
|align=center colspan=2|Timed subtraction
 +
|align=center|<code>expr0 '''-@''' expr1</code>
 +
|Multiply ''expr2'' by delta time and subtract the result from ''expr1''
 
|-
 
|-
 
!rowspan=2|<code>++</code>
 
!rowspan=2|<code>++</code>
Line 220: Line 267:
 
!width=70px|Operators
 
!width=70px|Operators
 
!width=200px|Name
 
!width=200px|Name
!width=180px|Syntax
+
!width=200px|Syntax
!width=485px|Description
+
!width=500px|Description
 
|-
 
|-
 
!<code>= +</code>
 
!<code>= +</code>
Line 231: Line 278:
 
|align=center|Subtraction and assignment
 
|align=center|Subtraction and assignment
 
|align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''-''' expr2</code>
 
|align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''-''' expr2</code>
|Subtract ''expr2'' to ''expr1'' and store the result to ''expr0''
+
|Subtract ''expr2'' from ''expr1'' and store the result to ''expr0''
 
|-
 
|-
 
!<code>= *</code>
 
!<code>= *</code>
Line 242: Line 289:
 
|align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''/''' expr2</code>
 
|align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''/''' expr2</code>
 
|Divide ''expr1'' by ''expr2'' and store the result to ''expr0''
 
|Divide ''expr1'' by ''expr2'' and store the result to ''expr0''
 +
|-
 +
!<code>= +@</code>
 +
|align=center|Timed addition and assignment
 +
|align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''+@''' expr2</code>
 +
|Multiply ''expr2'' by delta time, add the result to ''expr1'' and store everything to ''expr0''
 +
|-
 +
!<code>= -@</code>
 +
|align=center|Timed subtraction and assignment
 +
|align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''-@''' expr2</code>
 +
|Multiply ''expr2'' by delta time, subtract the result from ''expr1'' and store everything to ''expr0''
 
|}
 
|}
  
Line 252: Line 309:
 
===Compound assignment===
 
===Compound assignment===
  
''Compound assignment operators'' store values or [[#Scope|variable]]'s content to other variables having a particular type afterwards the computation of an arithmetic operation, to squeeze the code and clear it up from granted repetitions:
+
''Compound assignment operators'' store [[#Value|values]] or [[#Variables|variable]] content to other variables having a particular type afterwards the computation of an arithmetic operation, to squeeze the code and clear it up from granted repetitions:
  
 
{|class=wikitable
 
{|class=wikitable
 
!width=70px|Operator
 
!width=70px|Operator
 
!width=200px|Name
 
!width=200px|Name
!width=180px|Syntax
+
!width=200px|Syntax
!width=485px|Description
+
!width=500px|Description
 
|-
 
|-
 
!<code>+=</code>
 
!<code>+=</code>
Line 268: Line 325:
 
|align=center|Subtraction assignment
 
|align=center|Subtraction assignment
 
|align=center|<code>expr0 '''-=''' expr1</code>
 
|align=center|<code>expr0 '''-=''' expr1</code>
|Subtract ''expr1'' to ''expr0'' and store the result to ''expr0''
+
|Subtract ''expr1'' from ''expr0'' and store the result to ''expr0''
 
|-
 
|-
 
!<code>*=</code>
 
!<code>*=</code>
Line 279: Line 336:
 
|align=center|<code>expr0 '''/=''' expr1</code>
 
|align=center|<code>expr0 '''/=''' expr1</code>
 
|Divide ''expr0'' by ''expr1'' and store the result to ''expr0''
 
|Divide ''expr0'' by ''expr1'' and store the result to ''expr0''
 +
|-
 +
!<code>+=@</code>
 +
|align=center|Timed addition assignment
 +
|align=center|<code>expr0 '''+=@''' expr1</code>
 +
|Multiply ''expr1'' by delta time, add the result to ''expr0'' and store everything to ''expr0''
 +
|-
 +
!<code>-=@</code>
 +
|align=center|Timed subtraction assignment
 +
|align=center|<code>expr0 '''-=@''' expr1</code>
 +
|Multiply ''expr1'' by delta time, subtract the result from ''expr0'' and store everything to ''expr0''
 
|}
 
|}
  
 
===Uncompounded assignment===
 
===Uncompounded assignment===
  
''Uncompounded assignment operators'' are those on their own, or rather they are neither derivable nor decomposable similarly as those compounds:
+
''Uncompounded assignment operators'' are those on their own, or rather they are neither derivable nor decomposable similarly as those [[#Compound assignment|compounds]]:
  
 
{|class=wikitable
 
{|class=wikitable
 
!width=70px|Operator
 
!width=70px|Operator
 
!width=200px|Name
 
!width=200px|Name
!width=180px|Syntax
+
!width=200px|Syntax
!width=485px|Description
+
!width=500px|Description
|-
 
!<code>=+</code>
 
|align=center|Time step addition assignment
 
|align=center|<code>expr0 '''=+''' expr1</code>
 
|Multiply ''expr1'' by time step, add the result to ''expr0'' and store everything to ''expr0''
 
|-
 
!<code>=-</code>
 
|align=center|Time step subtraction assignment
 
|align=center|<code>expr0 '''=-''' expr1</code>
 
|Multiply ''expr1'' by time step, subtract the result to ''expr0'' and store everything to ''expr0''
 
 
|-
 
|-
 
!<code>=#</code>
 
!<code>=#</code>
Line 317: Line 374:
 
!width=70px|Operators
 
!width=70px|Operators
 
!width=200px|Name
 
!width=200px|Name
!width=180px|Syntax
+
!width=200px|Syntax
!width=485px|Description
+
!width=500px|Description
 
|-
 
|-
 
!<code>NOT</code>
 
!<code>NOT</code>
Line 338: Line 395:
 
===Comparison===
 
===Comparison===
  
''Comparison operators'' test the truth or falsity of the relation between either a variable and a value, a value and a variable or two [[#Scope|variables]]:
+
''Comparison operators'' test the truth or falsity of the relation between either a [[#Variables|variable]] and a [[#Value|value]], a value and a variable or two variables:
  
 
{|class=wikitable
 
{|class=wikitable
 
!width=70px|Operator
 
!width=70px|Operator
 
!width=200px|Name
 
!width=200px|Name
!width=180px|Syntax
+
!width=200px|Syntax
!width=485px|Description
+
!width=500px|Description
 
|-
 
|-
 
!<code>=</code>
 
!<code>=</code>
Line 372: Line 429:
 
|}
 
|}
  
Theorically, string types ([[#STRING|STRING]], [[#NAME|NAME]]) should be compared with the first operator only, but the presence of '''COMPARE_STRING''' increase the doubts concerning the existence of such operator for strings.
+
Theorically, [[#STRING|STRING]] values should be compared with the first operator only, but the presence of '''COMPARE_STRING''' increase the doubts concerning the existence of such operator for this type.
  
 
==Commands==
 
==Commands==
  
A ''command'' is a ''symbolic name'' associated to an ''opcode'' which executes a ''portion of code'' that specifies the operation to be performed by passing ''zero or more [[#Arguments|arguments]]''. [[#Opcodes|Opcodes]] do not return values that can be assigned to a [[#Variables|variable]], even though the boolean flag is kept whenever they are used as ''conditions''. It follows the common programming syntax adopted for ''procedure or function calls'':
+
A ''command'' is a ''symbolic name'' associated to an [[#Opcodes|opcode]] which executes a ''portion of code'' that specifies the operation to be performed by passing ''zero or more [[#Arguments|arguments]]''. Opcodes do not return [[#Value|values]] that can be assigned to a [[#Variables|variable]], even though the boolean flag is kept whenever they are used as ''conditions''. It follows the common programming syntax adopted for ''procedure or function calls'':
  
 
  {commandname} [{anyvalue0|varname0} ... {anyvalueN|varnameN}]
 
  {commandname} [{anyvalue0|varname0} ... {anyvalueN|varnameN}]
Line 386: Line 443:
 
* {{icon|3}} {{icon|vc}} {{icon|sa}} {{icon|lcs}} {{icon|vcs}}:
 
* {{icon|3}} {{icon|vc}} {{icon|sa}} {{icon|lcs}} {{icon|vcs}}:
 
** '''OPERATORS'''
 
** '''OPERATORS'''
** '''ABSI'''
+
** '''ABS'''
** '''ABSF'''
 
 
* {{icon|sa}}:
 
* {{icon|sa}}:
** '''COMPARE_STRING'''
+
** '''IS_TEXT_LABEL_NULL'''
** '''SAVE_STRING_TO_DEBUG_FILE'''
+
** '''IS_STRING_NULL'''
 
** '''IS_BIT_SET'''
 
** '''IS_BIT_SET'''
 
** '''SET_BIT'''
 
** '''SET_BIT'''
 
** '''CLEAR_BIT'''
 
** '''CLEAR_BIT'''
** '''IS_STRING_NULL'''
+
** '''COMPARE_STRING'''
** '''STRING_STRING'''
 
 
* {{icon|lcs}} {{icon|vcs}}:
 
* {{icon|lcs}} {{icon|vcs}}:
** '''CALL_FUNCTION'''
+
** '''CALL'''
  
 
{{incomplete}}
 
{{incomplete}}
Line 403: Line 458:
 
===WAIT===
 
===WAIT===
  
A '''WAIT''' skips the execution of a [[#Structure|script]] according to some milliseconds after which it will resume again. Indeed, it is absolutely necessary into ''infinite loops'' or those that break after more than one frame, such as the [[#WHILE|WHILE]] statement. In this case, a value equal to 0 is passed.
+
'''WAIT''' skips the execution of a [[#Structure|script]] according to some milliseconds after which it will resume again. Indeed, it is absolutely necessary into ''infinite loops'' or those that break after more than one frame, such as the [[#WHILE|WHILE]] statement. In this case, a [[#INT|INT]] equal to 0 is passed.
  
 
===GOTO===
 
===GOTO===
  
A '''GOTO''' is the jump to the [[#Labels|label]] of any location of the source code. It is also used internally to build other [[#Statements|statements]] or singularly but then it mustn't point off the current context:
+
'''GOTO''' jumps to the [[#Labels|label]] of any location of the source code. It is also used internally to build other [[#Statements|statements]] or singularly but then it mustn't point off the current context:
  
 +
// File: any.sc
 +
 
  jump0:
 
  jump0:
 
  GOTO jumpN
 
  GOTO jumpN
+
 
  [...]
+
  // File: any.sc
 
   
 
   
 
  jumpN:
 
  jumpN:
 
  GOTO jump0
 
  GOTO jump0
  
==Constants==
+
===ANDOR===
  
A ''constant'' is a ''symbolic name'' associated to a specific ''value''. When compiling, their caption is converted in the assigned value. They are listed into ''TXT'' files, whose name follows the '''Pascal Notation''' which implyies that all first letters of the words are in uppercase and other characters are lowercase (eg. ''AudioEvents.txt''). These files respect the syntax below:
+
'''ANDOR''' set out the way the comparison among more conditions have to occur (see also [[#Comparing rule|Comparing rule]]).
  
{constname0} {constvalue0}
+
===GOTO_IF_TRUE===
 
{constnameN} {constvalueN}
 
  
''Constant names and values'' are divided by as many ''spaces'' or ''tabulations'' as you want. ''Constant lines'' are distinguished by two '''\n''' (new line) characters. The ''model names'' which aren't assigned to a constant are still valid (see also [[#Identifiers|Identifiers]]).
+
'''GOTO_IF_TRUE''' operates in conjunction with [[#ANDOR|ANDOR]] and jumps to a [[#Labels|label]] if the returned boolean flag is true.
  
===Others===
+
===GOTO_IF_FALSE===
  
The [[#Arguments|arguments]] of some [[#Commands|commands]] accept only ''constant values'' of a single ''namespace''. Instead, the [[#CONST|CONST]] type can hold every constant of any namespace.
+
Unlike [[#GOTO_IF_TRUE|GOTO_IF_TRUE]], '''GOTO_IF_FALSE''' jumps to the disired [[#Labels|label]] only if the comparison returns false.
  
{{incomplete}}
+
===SAVE_STRING_TO_DEBUG_FILE===
 +
 
 +
'''SAVE_STRING_TO_DEBUG_FILE''' accepts an [[#Arguments|argument]] which can admit up to ''127 characters plus the null-terminator''. In the compiling process, the argument is skipped but its string is copied to a predefined ''128-bytes buffer'', compiled afterwards. These are the predetermined bytes that seem to do nothing:
 +
 
 +
00 00 41 00 09 2E 00 00 00 00 00 00 <span style="color: silver">00</span> 00 00 00
 +
<span style="color: blue">09 2E 00 00</span> 00 00 00 00 1C FB 12 00 D8 A8 41 00
 +
00 00 41 00 09 2E 00 00 00 00 00 00 <span style="color: silver">01</span> 00 00 00
 +
<span style="color: blue">09 2E 00 00</span> 00 00 00 00 1C FB 12 00 D8 A8 41 00
 +
00 00 41 00 09 2E 00 00 00 00 00 00 <span style="color: silver">02</span> 00 00 00
 +
<span style="color: blue">09 2E 00 00</span> 00 00 00 00 1C FB 12 00 D8 A8 41 00
 +
00 00 41 00 09 2E 00 00 00 00 00 00 <span style="color: silver">03</span> 00 00 00
 +
<span style="color: blue">09 2E 00 00</span> 00 00 00 00 1C FB 12 00 D8 A8 41 00
 +
 
 +
Dynamic values within a block are marked in <span style="color: silver">grey</span>, while those which differs among each block are coloured in <span style="color: blue">blue</span>. Possibly rubbish data.
 +
 
 +
==Constants==
 +
 
 +
A ''constant'' is a ''symbolic name'' associated to a specific [[#Value|value]]. When compiling, their caption is converted in the assigned value. In {{icon|3}} and {{icon|vc}}, they are hardcoded as everything inside the compiler. Since {{icon|vc}}, names and identifiers of objects within [[OBJS]] and [[TOBJ]] blocks are loaded from every ''IDE'' file defined into [[gta.dat|gta_vc.dat]], then those of vehicles and pedestrians within [[PEDS]] and [[CARS]] blocks are retrieved from [[default.ide]]. In {{icon|sa}}, they are listed into ''TXT'' files, whose name follows the [[Wikipedia:CamelCase|Pascal Case]] (eg. ''AudioEvents.txt''). These files respect the syntax below:
 +
 
 +
{constname0} {constvalue0}
 +
 +
{constnameN} {constvalueN}
 +
 
 +
''Constant names and values'' are divided by as many ''spaces'' or ''tabulations'' as you want. ''Constant lines'' are distinguished by two '''\n''' (new line) characters. The ''model names'' which aren't assigned to a constant are still valid (see also [[#Identifiers|Identifiers]]). Keep in mind [[#Arguments|arguments]] of some [[#Commands|commands]] having the [[#CONSTANT|CONSTANT]] type accept only ''constant values'' of a single ''namespace''.
  
 
==Formatting==
 
==Formatting==
Line 438: Line 516:
  
 
{|class=wikitable
 
{|class=wikitable
!Entity
+
!
 
!Uppercase
 
!Uppercase
 
!Lowercase
 
!Lowercase
 
|-
 
|-
|Label||||align=center|X
+
|[[#Label|Label]]||||align=center|X
 
|-
 
|-
|Declaration||align=center|X||
+
|[[#Declaration|Declaration]]||align=center|X||
 
|-
 
|-
|Variable||||align=center|X
+
|[[#Variables|Variable]]||||align=center|X
 
|-
 
|-
|Command||align=center|X||
+
|[[#Commands|Command]]||align=center|X||
 
|-
 
|-
|Constant||align=center|X||
+
|[[#Constants|Constant]]||align=center|X||
 
|-
 
|-
|Statement||align=center|X||
+
|[[#Statements|Statement]]||align=center|X||
 
|}
 
|}
  
Line 459: Line 537:
 
==Structure==
 
==Structure==
  
The source code is split up into several ''SC'' files which comprehend ''main'', ''gosubs'', ''scripts'', ''missions'', ''streams'' and ''functions''.
+
The source code is split up into several ''SC'' files which comprehend ''main file'', ''foreign gosubs'', ''subscripts'', ''mission scripts'', and ''triggers''.
  
===Main===
+
===Main file===
 
----
 
----
''Main'' is the most significant part of the whole source. It consists of a single file that can include many script files through '''LAUNCH_*''' and '''START_*''' [[#Commands|commands]]. It is characterized by the absence of the [[#Local|local scope]].
+
The ''main file'' is the most significant part of the whole source. It can include many script files and/or embedded ''gosubs'', ''scripts'' or ''functions''. Originally, it is characterized by the absence of the [[#Local|local]] [[#Scope|scope]]. It must be put outside the directory, having the same name as the main script file, where all other foreign scripts must be. R* compiler will search into subfolders too:
  
===Gosubs===
+
<directory>
----
+
| main
A ''gosub'' is the jump to the [[#Labels|label]] of a ''subroutine'', which executes some code and returns back to the place where it was called with '''RETURN'''.  
+
|  | gosub
 +
|  |  |- gosub1.sc
 +
|  |  \- gosubN.sc
 +
|  | subscript
 +
|  |  |- subscript1.sc
 +
|  |  \- subscriptN.sc
 +
|  | mission_guy
 +
|  |  |- mission_guy1.sc
 +
|  |  \- mission_guyN.sc
 +
|  |- gosub.sc
 +
| |- subscript.sc
 +
|  \- mission.sc
 +
\- main.sc
  
====Embedded====
+
===Foreign gosubs===
 
----
 
----
''Embedded gosubs'' are those enclosed into a script file. They allow the use of the [[#Scope|local scope]] for [[#Timers|timers]] but they cannot declare [[#Local|local variables]]. Actually, they can inherit the local scope of the parent script but then they cannot be called by any other script.
+
''Foreign gosubs'' (also called ''subroutines'') are ''main extension files''. They are called using the '''GOSUB_FILE''' [[#Commands|command]] which jumps to a specific [[#Labels|label]] and executes some code that returns back to the place where it has been called with '''RETURN'''. You are able to specify the gosub label to start jumping at aswell:
  
=====Trigger=====
+
// File: main.sc
 +
 +
GOSUB_FILE gosub0 gosub.sc
  
  GOSUB gosub
+
  // File: gosub.sc
 
+
=====Code=====
+
  gosub0:
 
 
  gosub:
 
 
  {
 
  {
 
     [...]
 
     [...]
Line 485: Line 575:
 
  RETURN
 
  RETURN
  
====File====
+
;Limit
----
+
:Foreign gosubs were introduced since {{icon|3}}. They were unused in {{icon|vc}} and got removed in {{icon|sa}}, but then they were reimplemented in {{icon|lcs}} and {{icon|vcs}}.
''File gosubs'' are those included into a script file singularly. '''LAUNCH_GOSUB''' jumps to the desired gosub defined into the input file that can call other embedded gosubs or scripts.
 
  
=====Trigger=====
+
====Gosubs====
  
LAUNCH_GOSUB gosub0 gosub.sc
+
As mentioned, ''gosubs'' are also embedded in any script file. They follow almost the same rules, except they are called by '''GOSUB''' and can actually inehrit the [[#Local|local]] [[#Scope|scope]] of the parent script:
  
=====Code=====
+
// File: any.sc
 +
 +
GOSUB gosub0
  
  // File: gosub.sc
+
  // File: any.sc
 
:gosub0
 
{
 
    [LVAR_{vartype} {varname0}[,] [... {varnameN}]]
 
 
    GOSUB gosubN
 
 
    [...]
 
}
 
RETURN
 
 
   
 
   
  gosubN:
+
  gosub0:
 
  {
 
  {
 
     [...]
 
     [...]
Line 513: Line 594:
 
  RETURN
 
  RETURN
  
;Limit
+
;Note
:File gosubs were introduced since {{icon|3}}. They were unused in {{icon|vc}} and got removed in {{icon|sa}}, but then they were reimplemented in {{icon|lcs}} and {{icon|vcs}}.
+
:R* compiler doesn't take care if the code within a scope jumps to a gosub inside which another scope is declared. It is strongly recommended to pay attention at this issue or you will fall down into an irreparable local [[#Variables|variable]] mismatch.
  
===Scripts===
+
===Subscripts===
 
----
 
----
A ''script'' is a code block which takes part of a ''queue of other scripts''. As long as it isn't terminated with '''TERMINATE_THIS_SCRIPT''' or '''TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME''' (elsewhere in another script), its execution never expires till the end of the game process. Each one works independently, even though they are able to share [[#Global|global variables]].
+
''Subscripts'' are code blocks which take part of a ''queue of other scripts''. They are denoted by the presence of '''MISSION_START''' at the very top of the mission file. As long as they aren't ended with '''MISSION_END''', their execution never expires till the end of the game process. Each one works independently, even though they are able to share [[#Global|global]] [[#Variables|variables]]:
  
====Embedded====
+
// File: main.sc
----
+
''Embedded scripts'' are those started by ''SC'' files where their body is included into. Note '''START_NEW_SCRIPT''' has an undefined amount of [[#Arguments|arguments]] which match with each [[#Local|local variable]] of the starting script.
+
LAUNCH_MISSION subscript.sc
  
=====Trigger=====
+
// File: subscript.sc
 
+
  START_NEW_SCRIPT script [{anyvalue0|varname0} ... {anyvalueN|varnameN}]
+
MISSION_START
 
+
=====Code=====
+
  [VAR_{vartype} {varname0}[,] [... {varnameN}]]
 
+
   
  script:
+
  SCRIPT_NAME main
  SCRIPT_NAME script
 
 
   
 
   
  script_loop:
+
  subscript_loop:
 
  {
 
  {
 
     [LVAR_{vartype} {varname0}[,] [... {varnameN}]]
 
     [LVAR_{vartype} {varname0}[,] [... {varnameN}]]
Line 539: Line 619:
 
     [...]
 
     [...]
 
  }
 
  }
  //GOTO script_loop
+
  //GOTO subscript_loop
  TERMINATE_THIS_SCRIPT
+
  MISSION_END
  
====File====
+
;Note
----
+
:'''MISSION_START''' is a special and fake directive that isn't assigned to any [[#Commands|command]].
''File scripts'' are those which enclose none or more embedded scripts other than their ''main script''. The '''''MISSION''' opening and closing [[#Commands|commands]]'' let us supposing scripts that own a ''SC'' file are computed as missions. '''MISSION_START''' is a special directive which doesn't get compiled, whereas '''MISSION_END''' is an alias of '''TERMINATE_THIS_SCRIPT'''. Yet, you can also start the scripts embedded in other files.
 
  
=====Trigger=====
+
====Scripts====
  
START_TEST_SCRIPT script.sc
+
As for [[#Gosubs|gosubs]], ''scripts'' can be embedded everywhere in a script file. They are started by '''START_NEW_SCRIPT''' which has an undefined amount of [[#Arguments|arguments]], whose type must match with those of each [[#Local|local]] variable of the starting script in order to be passed, else the compilation will interrupt. Unlike subscripts, they get terminated by '''TERMINATE_THIS_SCRIPT''' or '''TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME''' (elsewhere in another script):
  
=====Code=====
+
// File: any.sc
 +
 +
START_NEW_SCRIPT script [{anyvalue0|varname0} ... {anyvalueN|varnameN}]
  
  // File: script.sc
+
  // File: any.sc
 
   
 
   
  MISSION_START
+
  script:
 +
{
 +
    SCRIPT_NAME script
 
   
 
   
  [VAR_{vartype} {varname0}[,] [... {varnameN}]]
+
  script_loop:
 
SCRIPT_NAME main
 
 
   
 
   
main_loop:
 
{
 
 
     [LVAR_{vartype} {varname0}[,] [... {varnameN}]]
 
     [LVAR_{vartype} {varname0}[,] [... {varnameN}]]
 
    START_NEW_SCRIPT script [{anyvalue0|varname0} ... {anyvalueN|varnameN}]
 
 
   
 
   
 
     [...]
 
     [...]
}
 
//GOTO main_loop
 
MISSION_END
 
 
script:
 
SCRIPT_NAME script
 
 
   
 
   
script_loop:
+
    //GOTO script_loop
{
+
     TERMINATE_THIS_SCRIPT
    [LVAR_{vartype} {varname0}[,] [... {varnameN}]]
 
 
     [...]
 
 
  }
 
  }
//GOTO script_loop
 
TERMINATE_THIS_SCRIPT
 
  
===Missions===
+
;Notes
----
+
:Scripts must have a local [[#Scope|scope]].
A ''mission'' is a script which takes part of the ''mission block''. When it is launched, the pointer is moved to the corresponding mission [[#Offsets|offset]] located somewhere in the mission block. Do not forget to begin a mission with '''MISSION_START''' (ghost [[#Commands|command]]) and stop its execution with '''MISSION_END'''. Although missions are script files, you are able to start embedded scripts, whether they are put in the current file or not.
+
:Script commands must be inserted within or after the local scope.
 +
:Since {{icon|vc}}, the ''opening curly bracket'' must be put before the script [[#Labels|label]] when more arguments are passed.
  
====Trigger====
+
====Functions====
  
LAUNCH_MISSION mission.sc
+
{{incomplete}}
  
====Code====
+
===Mission scripts===
 +
----
 +
''Mission scripts'' are [[#Subscripts|subscripts]] which take part of the ''mission block'', which is basically a subscript started once. When they are launched with '''LOAD_AND_LAUNCH_MISSION''', the pointer is moved to the corresponding mission [[#Offsets|offset]] located somewhere in the mission block. Do not forget to begin a mission with '''MISSION_START''' and end it with '''MISSION_END''':
 +
 
 +
// File: main.sc
 +
 +
LOAD_AND_LAUNCH_MISSION mission.sc
  
 
  // File: mission.sc
 
  // File: mission.sc
Line 638: Line 711:
 
  RETURN
 
  RETURN
  
===Streams===
+
===Triggers===
 
----
 
----
 
{{incomplete}}
 
{{incomplete}}
  
===Functions===
+
==Statements==
----
 
{{incomplete}}
 
  
==Statements==
+
As usual, the evolution of something implies its development over the years. Alongside, the ''statements'' implementation has been distributed equally into every chapter. Their definitions are similar to those used in ''pseudocodes'' resulting in a ''raw source code''. However, you are still able to build your own control flows:
  
As usual, the evolution of something implies its development over the years. Alongside, the ''statements'' implementation has been distributed equally into every chapter. Their definitions are similar to those used in ''pseudocodes'' resulting in a ''raw source code''.
+
ANDOR {value}
 +
  [NOT] {condition0}
 +
  [[NOT] {condition8}]
 +
GOTO_IF_FALSE ELSE
 +
    {consequence}
 +
    [GOTO ENDIF]
 +
ELSE:
 +
    [{alternative}
 +
ENDIF:]
  
 
===IF===
 
===IF===
  
'''IF''' is one of the most widespread ''conditional statements'' which executes some codes by evaluating a boolean flag, also known as a condition. According to the returning value, either the ''consequence'' or the ''alternative'' will be performed. The condition result can be inverted by appending the '''NOT''' [[#Logical|logical operator]] before. More conditions require the use of the remaining logical operators, they are '''AND''', when verifying if all ''checks'' are true, and '''OR''', while testing if one of all checks is true. The syntax below summarize the whole explanation:
+
'''IF''' is one of the most widespread ''conditional statements'' which executes some codes by evaluating a boolean flag, the returning value of one or more conditions. According to the returning value, either the ''consequence'' or the ''alternative'' will be performed. The condition result can be inverted by appending the '''NOT''' [[#Logical|logical operator]] before. More conditions require the use of the remaining logical operators, they are '''AND''', when verifying if all ''checks'' are true, and '''OR''', while testing if one of all checks is true. The syntax below summarize the whole explanation:
  
 
  IF [NOT] {condition0}
 
  IF [NOT] {condition0}
Line 662: Line 741:
  
 
;Limit
 
;Limit
:More than ''9 conditions'' per statement are't supported.
+
:More than ''9 conditions'' per statement are't allowed.
 +
 
 +
===IFNOT===
 +
 
 +
'''IFNOT''' is a variation of the '''IF''' statement as already stated. As opposed to its closest relative, the conditions evaluetion is reversed, that is the ''consequence'' is perfomed when the boolean flag is false, else the ''alternative'' is executed:
 +
 
 +
IFNOT [NOT] {condition0}
 +
[AND|OR [NOT] {condition8}]
 +
    {consequence}
 +
[ELSE
 +
    {alternative}]
 +
ENDIF
 +
 
 +
;Limit
 +
:It is supported since {{icon|lcs}}.
  
 
===WHILE===
 
===WHILE===
Line 673: Line 766:
 
  ENDWHILE
 
  ENDWHILE
  
===DO-WHILE===
+
===WHILENOT===
  
'''DO-WHILE''' is a variation of the '''WHILE''' statement as already stated. It performs the ''consequence'' until the boolean flag becomes false. As opposed to its closest relative, the evaluation of the boolean flag happens after the execution of the ''consequence''. Do not mix it with the '''DO-LOOP''' construct (not implemented by R*):
+
'''WHILENOT''' acts seemingly like the '''WHILE''' statement, as all condition truths are inverted and therefore the ''consequence'' is performed over and over again until the boolean flag becomes true:
  
  DO
+
  WHILENOT [NOT] {condition0}
 +
[AND|OR [NOT] {condition8}]
 
     {consequence}
 
     {consequence}
  WHILE_TRUE [NOT] {condition0}
+
  ENDWHILE
[AND|OR [NOT] {condition8}]
 
  
;Limits
+
;Limit
:It is supported since {{icon|vc}}.
+
:It is supported since {{icon|lcs}}.
  
===FOR===
+
===REPEAT===
  
Similar to the '''WHILE''' construct, '''FOR''' ''iterates'' some code depending on an incremental variable which goes through the given range, whose ending value must be subsequent to its beginning:
+
Similar to the '''WHILE''' construct, '''REPEAT''' ''iterates'' the ''consequence'' repeatedly depending on a 0-value incremental [[#Variables|variable]] which rises till the times specified:
  
  FOR {varname} FROM {value0} TO {valueN}
+
  REPEAT {times} {varname}
 
     {consequence}
 
     {consequence}
  ENDFOR
+
  ENDREPEAT
  
 
;Limits
 
;Limits
:It is supported since {{icon|sa}}.
+
:It is supported since {{icon|vc}}.
:The range accepts only integer values.
+
:The times must be positive.
:Values must be subsequent.
 
 
:The code will be read at least once in any case.
 
:The code will be read at least once in any case.
  
Line 722: Line 814:
 
==Structure==
 
==Structure==
  
For further information about the SCM file format, read [[Mission_Scripting (Overview)|this]] article. Take into account the compiling order of each ''SC'' file is ''main-gosubs-scripts-missions'' apart from the reading order of the [[#Commands|commands]] used to include them. [[#Streams|streams]] are compiled individually into the ''script.img'' file. On the other hand, [[#Functions|functions]] are compiled like [[#Embedded|embedded gosubs]].
+
For further information about the SCM file format, read [[Mission_Scripting (Overview)|this]] article. Take into account the compiling order of each ''SC'' file is [[#Main file|main file]] - [[#Foreign gosubs|foreign gosubs]] - [[#Subscripts|subscripts]] - [[#Mission scripts|mission scripts]] apart from the reading order of the commands used to include them. [[#Triggers|triggers]] are compiled individually into the ''script.img'' file. On the other hand, [[#Functions|functions]] are compiled like [[#Gosubs|gosubs]].
  
 
==Identifiers==
 
==Identifiers==
  
''Undefined constants'' of model identifiers, whose name refers to a ''DFF'' which is presumably archived into any of the ''IMGs'', loaded by the game, are overwritten by a decrementing value in the order they get compiled. These ''model names'' are then put into the second segment of the ''SCM header''. Those of [[#Missions|missions]] and [[#Streams|streams]] respect the same rule except the fact they are turned into a 0-based growing identifier.
+
''Undefined [[#Constants|constants]]'' of model identifiers, whose name refers to a [[DFF]] which is presumably archived into any of the [[IMG]]s, loaded by the game, are overwritten by a decrementing value in the order they get compiled. These ''model names'' are then put into the second segment of the ''SCM header''. Those of [[#Mission scripts|mission scripts]] and [[#Triggers|triggers]] respect the same rule except the fact they are turned into a 0-based growing identifier.
  
 
==Offsets==
 
==Offsets==
  
An ''offset'' is a ''32-bit signed integer'' value which points to a location of the source code. Those within [[#Main|main]], [[#Gosubs|gosub]] and [[#Scripts|script]] files are ''absolute offsets'' that start from the beginning of the main script, while the ones inside [[#Missions|mission]] and [[#Streams|stream]] files are ''relative offsets'' starting from their beginning. The offset is related to [[#Global|global variables]] aswell, whose interval goes from ''8'' and ends to ''FFFC'', each one is aligned to the nearest 4 bytes.
+
An ''offset'' is a ''32-bit signed integer'' which points to a location of the source code. Those within the [[#Main file|main file]], [[#Foreign gosubs|foreign gosubs]] and [[#Subscripts|subscripts]] are ''absolute offsets'' that start from the beginning of the main script, while the ones inside [[#Mission scripts|mission scripts]] and [[#Triggers|triggers]] are ''relative offsets'' starting from their beginning. The offset is related to [[#Global|global]] [[#Variables|variables]] aswell, whose interval goes from ''8'' and ends to ''FFFC'', each one is aligned to the nearest 4 bytes.
  
 
==Variables==
 
==Variables==
  
The following table shows the [[#Variables|variables]] range of the [[#Scope|local scope]] for each game version:
+
The following table shows the [[#Variables|variables]] range of the [[#Local|local]] [[#Scope|scope]] for each game version:
  
 
{|class=wikitable style=text-align:center
 
{|class=wikitable style=text-align:center
!width=100px|Scope
+
!width=125px|Context
 
!width=50px|{{icon|3}}
 
!width=50px|{{icon|3}}
 
!width=50px|{{icon|vc}}
 
!width=50px|{{icon|vc}}
Line 744: Line 836:
 
!width=50px|{{icon|vcs}}
 
!width=50px|{{icon|vcs}}
 
|-
 
|-
|align=left|Gosub||0-15||0-15||n/a||0-95||0-95
+
|align=left|[[#Foreign gosubs|Foreign gosub]]/[[#Gosubs|Gosub]]||0-15||0-15||n/a||0-95||0-95
 
|-
 
|-
|align=left|Script||0-15||0-15||0-31||0-95||0-95
+
|align=left|[[#Subscripts|Subscript]]/[[#Scripts|Script]]||0-15||0-15||0-31||0-95||0-95
 
|-
 
|-
|align=left|Mission{{ref|mblock|[*]}}||0-15||0-15||0-1023||0-95||0-95
+
|align=left|[[#Mission scripts|Mission script]]{{ref|mblock|[*]}}||0-15||0-15||0-1023||0-95||0-95
 
|-
 
|-
|align=left|Stream||n/a||n/a||0-31||n/a||n/a
+
|align=left|[[#Triggers|Trigger]]||n/a||n/a||0-31||n/a||n/a
 
|-
 
|-
|align=left|Function||n/a||n/a||n/a||0-95||0-95
+
|align=left|[[#Functions|Function]]||n/a||n/a||n/a||0-95||0-95
 
|-
 
|-
 
!colspan=6|
 
!colspan=6|
 
|-
 
|-
|align=left|Timer||16-17||16-17||32-33||10-11?||254-255
+
|align=left|[[#Timers|Timer]]||16-17||16-17||32-33||10-11?||254-255
 
|}
 
|}
  
 
;Note
 
;Note
:{{note|mblock}} Although the [[#Missions|mission]] block is allocated as an ''unique [[#Scripts|script]]'', [[#Local|locals]] point to the same storage location, therefore they are some kind of [[#Global|globals]] for missions uniquely.
+
:{{note|mblock}} Although the mission block is allocated as an ''unique subscript'', locals point to the same storage location, therefore they are some kind of [[#Globals|globals]] for missions uniquely.
  
 
==Operators composition==
 
==Operators composition==
  
As far as you wouldn't know, SCM's operators always take two operands to compute an operation. Their composition is listed below:
+
As far as you wouldn't know, SCM's [[#Operators|operators]] always take two operands to compute an operation. Their composition is listed below:
  
 
{|class=wikitable
 
{|class=wikitable
 
!width=70px|Operator/s
 
!width=70px|Operator/s
 
!width=200px colspan=2|Name
 
!width=200px colspan=2|Name
!width=180px|Syntax
+
!width=200px|Syntax
 
!width=180px|Composition
 
!width=180px|Composition
 
|-
 
|-
Line 809: Line 901:
 
|align=center|<code>expr0 '''=''' expr1 '''/''' expr2</code>
 
|align=center|<code>expr0 '''=''' expr1 '''/''' expr2</code>
 
|align=center|<code>expr0 '''=''' expr1<br/>expr0 '''/=''' expr2</code>
 
|align=center|<code>expr0 '''=''' expr1<br/>expr0 '''/=''' expr2</code>
 +
|-
 +
!<code>= +@</code>
 +
|align=center colspan=2|Timed addition and assignment
 +
|align=center|<code>expr0 '''=''' expr1 '''+@''' expr2</code>
 +
|align=center|<code>expr0 '''=''' expr1<br/>expr0 '''+=@''' expr2</code>
 +
|-
 +
!<code>= -@</code>
 +
|align=center colspan=2|Timed subtraction and assignment
 +
|align=center|<code>expr0 '''=''' expr1 '''-@''' expr2</code>
 +
|align=center|<code>expr0 '''=''' expr1<br/>expr0 '''-=@''' expr2</code>
 
|}
 
|}
  
 
==Opcodes==
 
==Opcodes==
  
An ''opcode'' is a ''16-bit unsigned integer'' value referring to a portion of code the game executes when it is called by passing an undefined or absent amount of ''arguments''. The maximum number of available opcodes is ''0x7FFF'', since the last bit (''0x8000'') is set whenever they are used as ''negative conditions'' (those with the '''NOT''' [[#Logical|logical operator]]).
+
An ''opcode'' is a ''16-bit unsigned integer'' referring to a portion of code the game executes when it is called by passing an undefined or absent amount of ''arguments''. The maximum number of available opcodes is ''0x7FFF'', since the last bit (''0x8000'') is set whenever they are used as ''negative conditions'' (those with the '''NOT''' [[#Logical|logical operator]]).
  
 
===Arguments===
 
===Arguments===
  
An ''argument'' is some data given as input to an opcode. Normally, opcodes have a defined amount of arguments up to 32. Those not, such as '''START_NEW_SCRIPT''', can pass as many arguments as the available [[#Local|local variables]] are, except [[#Timers|timers]]. This limitation is game specific.
+
An ''argument'' is some data given as input to an opcode. Normally, opcodes have a defined amount of arguments up to 32. Those not, such as '''START_NEW_SCRIPT''', can pass as many arguments as the available [[#Local|local]] [[#Variables|variables]] are, except [[#Timers|timers]]. This limitation is game specific.
  
 
===Internal===
 
===Internal===
  
Here is the list of all [[#Commands|commands]] handled arbitrarily by a hypothetical compiler:
+
Here is the list of all commands handled arbitrarily by the R* compiler:
  
{|class=wikitable
+
'''Legend:'''
|-
+
* '''Variable:'''<code>
!Acronym!!Description!!Acronym!!Description!!Acronym!!Description!!Acronym!!Description!!Acronym!!Description
+
** V, [[#Value|VALUE]]
|-
+
** G, [[#Global|GLOBAL]]
!IV
+
** L, [[#Local|LOCAL]]
|'''INT''' value
+
</code>
!FV
+
* '''Type:'''<code>
|'''FLOAT''' value
+
** I, [[#INT|INT]]
!CV
+
** F, [[#FLOAT|FLOAT]]
|'''CONST''' value
+
** T, [[#TEXT_LABEL|TEXT_LABEL]]
!SV
+
** S, [[#STRING|STRING]]
|'''STRING''' value
+
** O, [[#OFFSET|OFFSET]]
!NV
+
** N, [[#NUMBER|NUMBER]]
|'''NAME''' value
+
** C, [[#CONSTANT|CONSTANT]]
|-
+
** B, [[#BUFFER|BUFFER]]
!GI
+
** V, [[#VARLEN|VARLEN]]
|Global '''INT'''
+
</code>
!GF
+
'''List:'''
|Global '''FLOAT'''
+
{|class=wikitable style=text-align:center
!GC
+
!rowspan=2 colspan=2|Command
|Global '''CONST'''
 
!GS
 
|Global '''STRING'''
 
!GN
 
|Global '''NAME'''
 
|-
 
!LI
 
|Local '''INT'''
 
!LF
 
|Local '''FLOAT'''
 
!LC
 
|Local '''CONST'''
 
!LS
 
|Local '''STRING'''
 
!LN
 
|Local '''NAME'''
 
|}
 
 
 
{|class=wikitable style=text-align:center
 
!rowspan=2 colspan=2|Command or Operator
 
 
!rowspan=2|Opcode
 
!rowspan=2|Opcode
 
!rowspan=2|Args<br/>count
 
!rowspan=2|Args<br/>count
!colspan=32|Arguments
+
!colspan=20|Arguments
 
|-
 
|-
 
!width=20px|1
 
!width=20px|1
Line 885: Line 967:
 
!width=20px|17
 
!width=20px|17
 
!width=20px|18
 
!width=20px|18
 +
!width=20px|...
 
!width=20px|19
 
!width=20px|19
!width=20px|20
 
!width=20px|21
 
!width=20px|22
 
!width=20px|23
 
!width=20px|24
 
!width=20px|25
 
!width=20px|26
 
!width=20px|27
 
!width=20px|28
 
!width=20px|29
 
!width=20px|30
 
!width=20px|31
 
!width=20px|32
 
 
|-
 
|-
|colspan=36|{{icon|3}} {{icon|vc}} {{icon|sa}} {{icon|lcs}} {{icon|vcs}}
+
|colspan=25|{{icon|3}} {{icon|vc}} {{icon|sa}} {{icon|lcs}} {{icon|vcs}}
 
|-
 
|-
 
!colspan=2|MISSION_START{{ref|misdef|[*]}}
 
!colspan=2|MISSION_START{{ref|misdef|[*]}}
 
|
 
|
 
!0
 
!0
|colspan=32|
+
|colspan=20|
 
|-
 
|-
!colspan=2|GOTO{{ref|semihd|[*]}}
+
!colspan=2|GOTO{{ref|statem|[*]}}
 
|0002
 
|0002
 
!1
 
!1
|IV
+
|VO||colspan=19|
|colspan=31|
 
 
|-
 
|-
|colspan=36|{{icon|3}} {{icon|vc}} {{icon|sa}} {{icon|lcs}}
+
|colspan=25|{{icon|3}} {{icon|vc}} {{icon|sa}} {{icon|lcs}}
 
|-
 
|-
!rowspan=6|MOVI{{ref|operat|[*]}}
+
!rowspan=4|=!!SET_VAR_INT
!rowspan=2|VN
 
 
|0004
 
|0004
!rowspan=6|2
+
!rowspan=4|2
|GI
+
|GI||VI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
|0006
+
!SET_VAR_FLOAT
|LI
+
|0005||GF||VF||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!SET_LVAR_INT
|0084
+
|0006||LI||VI||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|0085
+
!SET_LVAR_FLOAT
|LI
+
|0007||LF||VF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|008A
+
!rowspan=4|+=!!ADD_VAL_TO_INT_VAR
|GI
+
|0008
|LI
+
!rowspan=4|2
|colspan=30|
+
|GI||VI||colspan=18|
 
|-
 
|-
|008B
+
!ADD_VAL_TO_FLOAT_VAR
|LI
+
|0009||GF||VF||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|MOVF{{ref|operat|[*]}}
+
!ADD_VAL_TO_INT_LVAR
!rowspan=2|VN
+
|000A||LI||VI||colspan=18|
|0005
 
!rowspan=6|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|0007
+
!ADD_VAL_TO_FLOAT_LVAR
|LF
+
|000B||LF||VF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=4|-=!!SUB_VAL_FROM_INT_VAR
|0086
+
|000C
|GF
+
!rowspan=4|2
|GF
+
|GI||VI||colspan=18|
|colspan=30|
 
 
|-
 
|-
|0087
+
!SUB_VAL_FROM_FLOAT_VAR
|LF
+
|000D||GF||VF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|0088
+
!SUB_VAL_FROM_INT_LVAR
|GF
+
|000E||LI||VI||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|0089
+
!SUB_VAL_FROM_FLOAT_LVAR
|LF
+
|000F||LF||VF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|ADDI{{ref|operat|[*]}}
+
!rowspan=4|*=!!MULT_INT_VAR_BY_VAL
!rowspan=2|VN
+
|0010
|0008
+
!rowspan=4|2
!rowspan=6|2
+
|GI||VI||colspan=18|
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|000A
+
!MULT_FLOAT_VAR_BY_VAL
|LI
+
|0011||GF||VF||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!MULT_INT_LVAR_BY_VAL
|0058
+
|0012||LI||VI||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|005A
+
!MULT_FLOAT_LVAR_BY_VAL
|LI
+
|0013||LF||VF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|005C
+
!rowspan=4|/=!!DIV_INT_ANY_BY_VAL
|LI
+
|0014
|GI
+
!rowspan=4|2
|colspan=30|
+
|GI||VI||colspan=18|
 
|-
 
|-
|005E
+
!DIV_FLOAT_VAR_BY_VAL
|GI
+
|0015||GF||VF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|ADDF{{ref|operat|[*]}}
+
!DIV_INT_LVAR_BY_VAL
!rowspan=2|VN
+
|0016||LI||VI||colspan=18|
|0009
 
!rowspan=6|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|000B
+
!DIV_FLOAT_LVAR_BY_VAL
|LF
+
|0017||LF||VF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=16|>!!IS_INT_VAR_GREATER_THAN_NUMBER
|0059
+
|0018
|GF
+
!rowspan=16|2
|GF
+
|GI||VN||colspan=18|
|colspan=30|
 
 
|-
 
|-
|005B
+
!IS_INT_LVAR_GREATER_THAN_NUMBER
|LF
+
|0019||LI||VN||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|005D
+
!IS_NUMBER_GREATER_THAN_INT_VAR
|LF
+
|001A||VN||GI||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
|005F
+
!IS_NUMBER_GREATER_THAN_INT_LVAR
|GF
+
|001B||VN||LI||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|SUBI{{ref|operat|[*]}}
+
!IS_INT_VAR_GREATER_THAN_INT_VAR
!rowspan=2|VN
+
|001C||GI||GI||colspan=18|
|000C
 
!rowspan=6|2
 
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|000E
+
!IS_INT_LVAR_GREATER_THAN_INT_LVAR
|LI
+
|001D||LI||LI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!IS_INT_VAR_GREATER_THAN_INT_LVAR
|0060
+
|001E||GI||LI||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|0062
+
!IS_INT_LVAR_GREATER_THAN_INT_VAR
|LI
+
|001F||LI||GI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|0064
+
!IS_FLOAT_VAR_GREATER_THAN_NUMBER
|LI
+
|0020||GF||VN||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
|0066
+
!IS_FLOAT_LVAR_GREATER_THAN_NUMBER
|GI
+
|0021||LF||VN||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|SUBF{{ref|operat|[*]}}
+
!IS_NUMBER_GREATER_THAN_FLOAT_VAR
!rowspan=2|VN
+
|0022||VN||GF||colspan=18|
|000D
 
!rowspan=6|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|000F
+
!IS_NUMBER_GREATER_THAN_FLOAT_LVAR
|LF
+
|0023||VN||LF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!IS_FLOAT_VAR_GREATER_THAN_FLOAT_VAR
|0061
+
|0024||GF||GF||colspan=18|
|GF
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|0063
+
!IS_FLOAT_LVAR_GREATER_THAN_FLOAT_LVAR
|LF
+
|0025||LF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|0065
+
!IS_FLOAT_VAR_GREATER_THAN_FLOAT_LVAR
|LF
+
|0026||GF||LF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
|0067
+
!IS_FLOAT_LVAR_GREATER_THAN_FLOAT_VAR
|GF
+
|0027||LF||GF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|MULI{{ref|operat|[*]}}
+
!rowspan=16|>=!!IS_INT_VAR_GREATER_OR_EQUAL_TO_NUMBER
!rowspan=2|VN
+
|0028
|0010
+
!rowspan=16|2
!rowspan=6|2
+
|GI||VN||colspan=18|
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|0012
+
!IS_INT_LVAR_GREATER_OR_EQUAL_TO_NUMBER
|LI
+
|0029||LI||VN||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!IS_NUMBER_GREATER_OR_EQUAL_TO_INT_VAR
|0068
+
|002A||VN||GI||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|006A
+
!IS_NUMBER_GREATER_OR_EQUAL_TO_INT_LVAR
|LI
+
|002B||VN||LI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|006C
+
!IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_VAR
|GI
+
|002C||GI||GI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|006E
+
!IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_LVAR
|LI
+
|002D||LI||LI||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|MULF{{ref|operat|[*]}}
+
!IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_LVAR
!rowspan=2|VN
+
|002E||GI||LI||colspan=18|
|0011
 
!rowspan=6|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|0013
+
!IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_VAR
|LF
+
|002F||LI||GI||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_NUMBER
|0069
+
|0030||GF||VN||colspan=18|
|GF
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|006B
+
!IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_NUMBER
|LF
+
|0031||LF||VN||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|006D
+
!IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_VAR
|GF
+
|0032||VN||GF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|006F
+
!IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_LVAR
|LF
+
|0033||VN||LF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|DIVI{{ref|operat|[*]}}
+
!IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_VAR
!rowspan=2|VN
+
|0034||GF||GF||colspan=18|
|0014
 
!rowspan=6|2
 
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|0016
+
!IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR
|LI
+
|0035||LF||LF||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR
|0070
+
|0036||GF||LF||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|0072
+
!IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_VAR
|LI
+
|0037||LF||GF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|0074
+
!rowspan=10|=!!IS_INT_VAR_EQUAL_TO_NUMBER
|GI
+
|0038
|LI
+
!rowspan=10|2
|colspan=30|
+
|GI||VN||colspan=18|
 
|-
 
|-
|0076
+
!IS_INT_LVAR_EQUAL_TO_NUMBER
|LI
+
|0039||LI||VN||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|DIVF{{ref|operat|[*]}}
+
!IS_INT_VAR_EQUAL_TO_INT_VAR
!rowspan=2|VN
+
|003A||GI||GI||colspan=18|
|0015
 
!rowspan=6|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|0017
+
!IS_INT_LVAR_EQUAL_TO_INT_LVAR
|LF
+
|003B||LI||LI||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!IS_INT_VAR_EQUAL_TO_INT_LVAR
|0071
+
|003C||GI||LI||colspan=18|
|GF
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|0073
+
!IS_FLOAT_VAR_EQUAL_TO_NUMBER
|LF
+
|0042||GF||VN||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|0075
+
!IS_FLOAT_LVAR_EQUAL_TO_NUMBER
|GF
+
|0043||LF||VN||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|0077
+
!IS_FLOAT_VAR_EQUAL_TO_FLOAT_VAR
|LF
+
|0044||GF||GF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=8|CMPGI{{ref|operat|[*]}}
+
!IS_FLOAT_LVAR_EQUAL_TO_FLOAT_LVAR
!rowspan=2|VN
+
|0045||LF||LF||colspan=18|
|0018
 
!rowspan=8|2
 
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|0019
+
!IS_FLOAT_VAR_EQUAL_TO_FLOAT_LVAR
|LI
+
|0046||GF||LF||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
!colspan=2|GOTO_IF_FALSE{{ref|statem|[*]}}
|001A
+
|004D
|IV
+
!1
|GI
+
|VO||colspan=19|
|colspan=30|
 
 
|-
 
|-
|001B
+
!colspan=2|TERMINATE_THIS_SCRIPT
|IV
+
|rowspan=2|004E
|LI
+
!rowspan=2|0
|colspan=30|
+
|rowspan=2 colspan=20|
 
|-
 
|-
!rowspan=4|VV
+
!colspan=2|MISSION_END
|001C
 
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|001D
+
!colspan=2|START_NEW_SCRIPT{{ref|undefa|[*]}}
|LI
+
|004F
|LI
+
!1
|colspan=30|
+
|VO||colspan=19|_ _ _
 
|-
 
|-
|001E
+
!colspan=2|GOSUB
|GI
+
|0050
|LI
+
!1
|colspan=30|
+
|VO||colspan=19|
 
|-
 
|-
|001F
+
!colspan=2|RETURN
|LI
+
|0051
|GI
+
!0
|colspan=30|
+
|colspan=20|
 
|-
 
|-
!rowspan=8|CMPGF{{ref|operat|[*]}}
+
!rowspan=8|+=!!ADD_INT_VAR_TO_INT_VAR
!rowspan=2|VN
+
|0058
|0020
 
 
!rowspan=8|2
 
!rowspan=8|2
|GF
+
|GI||GI||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
|0021
+
!ADD_FLOAT_VAR_TO_FLOAT_VAR
|LF
+
|0059||GF||GF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
!ADD_INT_LVAR_TO_INT_LVAR
|0022
+
|005A||LI||LI||colspan=18|
|FV
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|0023
+
!ADD_FLOAT_LVAR_TO_FLOAT_LVAR
|FV
+
|005B||LF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!ADD_INT_VAR_TO_INT_LVAR
|0024
+
|005C||LI||GI||colspan=18|
|GF
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|0025
+
!ADD_FLOAT_VAR_TO_FLOAT_LVAR
|LF
+
|005D||LF||GF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|0026
+
!ADD_INT_LVAR_TO_INT_VAR
|GF
+
|005E||GI||LI||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|0027
+
!ADD_FLOAT_LVAR_TO_FLOAT_VAR
|LF
+
|005F||GF||LF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=8|CMPGEI{{ref|operat|[*]}}
+
!rowspan=8|-=!!SUB_INT_VAR_FROM_INT_VAR
!rowspan=2|VN
+
|0060|
|0028
 
 
!rowspan=8|2
 
!rowspan=8|2
|GI
+
|GI||GI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
|0029
+
!SUB_FLOAT_VAR_FROM_FLOAT_VAR
|LI
+
|0061||GF||GF||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
!SUB_INT_LVAR_FROM_INT_LVAR
|002A
+
|0062||LI||LI||colspan=18|
|IV
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|002B
+
!SUB_FLOAT_LVAR_FROM_FLOAT_LVAR
|IV
+
|0063||LF||LF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!SUB_INT_VAR_FROM_INT_LVAR
|002C
+
|0064||LI||GI||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|002D
+
!SUB_FLOAT_VAR_FROM_FLOAT_LVAR
|LI
+
|0065||LF||GF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|002E
+
!SUB_INT_LVAR_FROM_INT_VAR
|GI
+
|0066||GI||LI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|002F
+
!SUB_FLOAT_LVAR_FROM_FLOAT_VAR
|LI
+
|0067||GF||LF||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=8|CMPGEF{{ref|operat|[*]}}
+
!rowspan=8|*=!!MULT_INT_VAR_BY_INT_VAR
!rowspan=2|VN
+
|0068
|0030
 
 
!rowspan=8|2
 
!rowspan=8|2
|GF
+
|GI||GI||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
|0031
+
!MULT_FLOAT_VAR_BY_FLOAT_VAR
|LF
+
|0069||GF||GF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
!MULT_INT_LVAR_BY_INT_LVAR
|0032
+
|006A||LI||LI||colspan=18|
|FV
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|0033
+
!MULT_FLOAT_LVAR_BY_FLOAT_LVAR
|FV
+
|006B||LF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!MULT_INT_VAR_BY_INT_LVAR
|0034
+
|006C||GI||LI||colspan=18|
|GF
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|0035
+
!MULT_FLOAT_VAR_BY_FLOAT_LVAR
|LF
+
|006D||GF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|0036
+
!MULT_INT_LVAR_BY_INT_VAR
|GF
+
|006E||LI||GI||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|0037
+
!MULT_FLOAT_LVAR_BY_FLOAT_VAR
|LF
+
|006F||LF||GF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=5|CMPEI{{ref|operat|[*]}}
+
!rowspan=8|/=!!DIV_INT_VAR_BY_INT_VAR
!rowspan=2|VN
+
|0070
|0038
+
!rowspan=8|2
!rowspan=5|2
+
|GI||GI||colspan=18|
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|0039
+
!DIV_FLOAT_VAR_BY_FLOAT_VAR
|LI
+
|0071||GF||GF||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=3|VV
+
!DIV_INT_LVAR_BY_INT_LVAR
|003A
+
|0072||LI||LI||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|003B
+
!DIV_FLOAT_LVAR_BY_FLOAT_LVAR
|LI
+
|0073||LF||LF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|003C
+
!DIV_INT_VAR_BY_INT_LVAR
|GI
+
|0074||GI||LI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=5|CMPEF{{ref|operat|[*]}}
+
!DIV_FLOAT_VAR_BY_FLOAT_LVAR
!rowspan=2|VN
+
|0075||GF||LF||colspan=18|
|0042
 
!rowspan=5|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|0043
+
!DIV_INT_LVAR_BY_INT_VAR
|LF
+
|0076||LI||GI||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=3|VV
+
!DIV_FLOAT_LVAR_BY_FLOAT_VAR
|0044
+
|0077||LF||GF||colspan=18|
|GF
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|0045
+
!rowspan=6|+=@!!ADD_TIMED_VAL_TO_FLOAT_VAR
|LF
 
|LF
 
|colspan=30|
 
|-
 
|0046
 
|GF
 
|LF
 
|colspan=30|
 
|-
 
!rowspan=6|ADDTSF{{ref|operat|[*]}}
 
!rowspan=2|VN
 
 
|0078
 
|0078
 
!rowspan=6|2
 
!rowspan=6|2
|GF
+
|GF||FV||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
|0079
+
!ADD_TIMED_VAL_TO_FLOAT_LVAR
|LF
+
|0079||LF||FV||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!ADD_TIMED_FLOAT_VAR_TO_FLOAT_VAR
|007A
+
|007A||GF||GF||colspan=18|
|GF
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|007B
+
!ADD_TIMED_FLOAT_LVAR_TO_FLOAT_LVAR
|LF
+
|007B||LF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|007C
+
!ADD_TIMED_FLOAT_LVAR_TO_FLOAT_VAR
|LF
+
|007C||LF||GF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
|007D
+
!ADD_TIMED_FLOAT_VAR_TO_FLOAT_LVAR
|GF
+
|007D||GF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|SUBTSF{{ref|operat|[*]}}
+
!rowspan=6|-=@!!SUB_TIMED_VAL_FROM_FLOAT_VAR
!rowspan=2|VN
 
 
|007E
 
|007E
 
!rowspan=6|2
 
!rowspan=6|2
|GF
+
|GF||FV||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
|007F
+
!SUB_TIMED_VAL_FROM_FLOAT_LVAR
|LF
+
|007F||LF||FV||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!SUB_TIMED_FLOAT_VAR_FROM_FLOAT_VAR
|0080
+
|0080||GF||GF||colspan=18|
|GF
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|0081
+
!SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_LVAR
|LF
+
|0081||LF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|0082
+
!SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_VAR
|LF
+
|0082||LF||GF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
|0083
+
!SUB_TIMED_FLOAT_VAR_FROM_FLOAT_LVAR
|GF
+
|0083||GF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|CVFI{{ref|operat|[*]}}
+
!rowspan=8|=!!SET_VAR_INT_TO_VAR_INT
!rowspan=4|VV
+
|0084|
|008C
+
!rowspan=8|2
!rowspan=4|2
+
|GI||GI||colspan=18|
|GI
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|008E
+
!SET_LVAR_INT_TO_LVAR_INT
|LI
+
|0085||LI||LI||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
|0090
+
!SET_VAR_FLOAT_TO_VAR_FLOAT
|GI
+
|0086||GF||GF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|0092
+
!SET_LVAR_FLOAT_TO_LVAR_FLOAT
|LI
+
|0087||LF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|CVIF{{ref|operat|[*]}}
+
!SET_VAR_FLOAT_TO_LVAR_FLOAT
!rowspan=4|VV
+
|0088||GF||LF||colspan=18|
|008D
 
!rowspan=4|2
 
|GF
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|008F
+
!SET_LVAR_FLOAT_TO_VAR_FLOAT
|LF
+
|0089||LF||GF||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
|0091
+
!SET_VAR_INT_TO_LVAR_INT
|GF
+
|008A||GI||LI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|0093
+
!SET_LVAR_INT_TO_VAR_INT
|LF
+
|008B||LI||GI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2 colspan=2|ABSI
+
!rowspan=8|=#!!CSET_VAR_INT_TO_VAR_FLOAT
|0094
+
|008C|
!rowspan=2|1
+
!rowspan=8|2
|GI
+
|GI||GF||colspan=18|
|colspan=31|
 
 
|-
 
|-
|0095
+
!CSET_VAR_FLOAT_TO_VAR_INT
|LI
+
|008D||GF||GI||colspan=18|
|colspan=31|
 
 
|-
 
|-
!rowspan=2 colspan=2|ABSF
+
!CSET_LVAR_INT_TO_VAR_FLOAT
|0096
+
|008E||LI||GF||colspan=18|
!rowspan=2|1
 
|GF
 
|colspan=31|
 
 
|-
 
|-
|0097
+
!CSET_LVAR_FLOAT_TO_VAR_INT
|LF
+
|008F||LF||GI||colspan=18|
|colspan=31|
 
 
|-
 
|-
!colspan=2|GOTO_IF_FALSE{{ref|statem|[*]}}
+
!CSET_VAR_INT_TO_LVAR_FLOAT
|004D
+
|0090||GI||LF||colspan=18|
!1
 
|IV
 
|colspan=31|
 
 
|-
 
|-
!colspan=2|TERMINATE_THIS_SCRIPT
+
!CSET_VAR_FLOAT_TO_LVAR_INT
|rowspan=2|004E
+
|0091||GF||LI||colspan=18|
!rowspan=2|0
 
|rowspan=2 colspan=32|
 
 
|-
 
|-
!colspan=2|MISSION_END
+
!CSET_LVAR_INT_TO_LVAR_FLOAT
 +
|0092||LI||LF||colspan=18|
 
|-
 
|-
!colspan=2|START_NEW_SCRIPT{{ref|undefa|[*]}}
+
!CSET_LVAR_FLOAT_TO_LVAR_INT
|004F
+
|0093||LF||LI||colspan=18|
!1
+
|-
|IV
+
!rowspan=4|ABS!!ABS_VAR_INT
|colspan=31|_ _ _
+
|0094
 +
!rowspan=4|1
 +
|GI||colspan=19|
 +
|-
 +
!ABS_LVAR_INT
 +
|0095||LI||colspan=19|
 
|-
 
|-
!colspan=2|GOSUB
+
!ABS_VAR_FLOAT
|0050
+
|0096||GF||colspan=19|
!1
 
|IV
 
|colspan=31|
 
 
|-
 
|-
!colspan=2|RETURN
+
!ABS_LVAR_FLOAT
|0051
+
|0097||LF||colspan=19|
!0
 
|colspan=32|
 
 
|-
 
|-
!colspan=2|COMPARING_RULE{{ref|statem|[*]}}
+
!colspan=2|ANDOR{{ref|statem|[*]}}
 
|00D6
 
|00D6
 
!1
 
!1
|IV
+
|VI||colspan=19|
|colspan=31|
 
 
|-
 
|-
!colspan=2|START_TEST_SCRIPT{{ref|likely|[*]}}
+
!colspan=2|LAUNCH_MISSION
 
|00D7
 
|00D7
 
!1
 
!1
|IV
+
|VO||colspan=19|
|colspan=31|
 
 
|-
 
|-
|colspan=36|{{icon|3}} {{icon|vc}} {{icon|sa}}
+
|colspan=25|{{icon|3}} {{icon|vc}} {{icon|sa}}
 
|-
 
|-
!colspan=2|LAUNCH_MISSION
+
!colspan=2|LOAD_AND_LAUNCH_MISSION
 
|0417
 
|0417
 
!1
 
!1
|IV
+
|VO||colspan=19|
|colspan=31|
 
 
|-
 
|-
|colspan=36|{{icon|3}} {{icon|vc}} {{icon|lcs}}
+
|colspan=25|{{icon|3}} {{icon|vc}}
 
|-
 
|-
!colspan=2|GOTO_IF_TRUE{{ref|statem|[*]}}
+
!colspan=2|GOSUB_FILE
|004C
+
|02CD
!1
+
!2
|IV
+
|VO||VO||colspan=18|
|colspan=31|
 
 
|-
 
|-
!colspan=2|RETURN_TRUE{{ref|likely|[*]}}
+
|colspan=25|{{icon|vc}} {{icon|sa}}
|00C5
 
!0
 
|colspan=32|
 
 
|-
 
|-
!colspan=2|RETURN_FALSE{{ref|likely|[*]}}
+
!rowspan=4|=!!IS_INT_VAR_EQUAL_TO_CONSTANT
|00C6
+
|04A3
!0
+
!rowspan=4|2
|colspan=32|
+
|GC||VC||colspan=18|
 
|-
 
|-
|colspan=36|{{icon|3}} {{icon|vc}}
+
!IS_INT_LVAR_EQUAL_TO_CONSTANT
 +
|04A4||LC||VC||colspan=18|
 
|-
 
|-
!colspan=2|LAUNCH_GOSUB{{ref|likely|[*]}}
+
!SET_VAR_INT_TO_CONSTANT
|02CD
+
|04AE||GC||VC||colspan=18|
!2
 
|IV
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|colspan=36|{{icon|vc}} {{icon|sa}}
+
!SET_LVAR_INT_TO_CONSTANT
 +
|04AF||LC||VC||colspan=18|
 
|-
 
|-
!rowspan=2|MOVC{{ref|operat|[*]}}
+
!rowspan=4|>!!IS_INT_VAR_GREATER_THAN_CONSTANT
!rowspan=2|VN
 
|04AE
 
!rowspan=2|2
 
|GC
 
|CV
 
|colspan=30|
 
|-
 
|04AF
 
|LC
 
|CV
 
|colspan=30|
 
|-
 
!rowspan=4|CMPGC{{ref|operat|[*]}}
 
!rowspan=2|VN
 
 
|04B0
 
|04B0
 
!rowspan=4|2
 
!rowspan=4|2
|GC
+
|GC||VC||colspan=18|
|CV
 
|colspan=30|
 
 
|-
 
|-
|04B1
+
!IS_INT_LVAR_GREATER_THAN_CONSTANT
|LC
+
|04B1||LC||VC||colspan=18|
|CV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
!IS_CONSTANT_GREATER_THAN_INT_VAR
 
|04B2
 
|04B2
|CV
+
|VC||GC||colspan=18|
|GC
 
|colspan=30|
 
 
|-
 
|-
|04B3
+
!IS_CONSTANT_GREATER_THAN_INT_LVAR
|CV
+
|04B3||VC||LC||colspan=18|
|LC
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|CMPGEC{{ref|operat|[*]}}
+
!rowspan=4|>=!!IS_INT_VAR_GREATER_OR_EQUAL_TO_CONSTANT
!rowspan=2|VN
 
 
|04B4
 
|04B4
 
!rowspan=4|2
 
!rowspan=4|2
|GC
+
|GC||VC||colspan=18|
|CV
 
|colspan=30|
 
 
|-
 
|-
|04B5
+
!IS_INT_LVAR_GREATER_OR_EQUAL_TO_CONSTANT
|LC
+
|04B5||LC||VC||colspan=18|
|CV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
!IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR
 
|04B6
 
|04B6
|CV
+
|VC||GV||colspan=18|
|GV
 
|colspan=30|
 
|-
 
|04B7
 
|CV
 
|LC
 
|colspan=30|
 
|-
 
!rowspan=2|CMPEC{{ref|operat|[*]}}
 
!rowspan=2|VN
 
|04A3
 
!rowspan=2|2
 
|GC
 
|CV
 
|colspan=30|
 
|-
 
|04A4
 
|LC
 
|CV
 
|colspan=30|
 
|-
 
|colspan=36|{{icon|sa}}
 
|-
 
!rowspan=6|MOVS{{ref|operat|[*]}}
 
!rowspan=2|VN
 
|05A9
 
!rowspan=6|2
 
|GS
 
|SV
 
|colspan=30|
 
|-
 
|05AA
 
|LS
 
|SV
 
|colspan=30|
 
|-
 
!rowspan=4|VV
 
|05A9
 
|GS
 
|GS
 
|colspan=30|
 
|-
 
|05AA
 
|LS
 
|LS
 
|colspan=30|
 
|-
 
|05A9
 
|GS
 
|LS
 
|colspan=30|
 
 
|-
 
|-
|05AA
+
!IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_LVAR
|LS
+
|04B7||VC||LC||colspan=18|
|GS
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|MOVN{{ref|operat|[*]}}
+
|colspan=25|{{icon|sa}}
!rowspan=2|VN
 
|06D1
 
!rowspan=6|2
 
|GN
 
|NV
 
|colspan=30|
 
 
|-
 
|-
|06D2
+
!rowspan=20|=!!rowspan=3|SET_ANY_TEXT_LABEL_TO_VAR_TEXT_LABEL{{ref|likely|[*]}}
|LN
+
|rowspan=3|05A9
|NV
+
!rowspan=20|2
|colspan=30|
+
|GT||VT||colspan=18|
 
|-
 
|-
!rowspan=4|VV
+
|GT||GT||colspan=18|
|06D1
 
|GN
 
|GN
 
|colspan=30|
 
 
|-
 
|-
|06D2
+
|GT||LT||colspan=18|
|LN
 
|LN
 
|colspan=30|
 
 
|-
 
|-
|06D1
+
!rowspan=3|SET_ANY_TEXT_LABEL_TO_LVAR_TEXT_LABEL{{ref|likely|[*]}}
|GN
+
|rowspan=3|05AA
|LN
+
|LT||VT||colspan=18|
|colspan=30|
 
 
|-
 
|-
|06D2
+
|LT||GT||colspan=18|
|LN
 
|GN
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|CMPES{{ref|operat|[*]}}<br/>COMPARE_STRING
+
|LT||LT||colspan=18|
!rowspan=2|VN
 
|05AD
 
!rowspan=6|2
 
|GS
 
|SV
 
|colspan=30|
 
 
|-
 
|-
|05AE
+
!rowspan=3|IS_TEXT_LABEL_VAR_EQUAL_TO_TEXT_LABEL_ANY{{ref|likely|[*]}}
|LS
+
|rowspan=3|05AD
|SV
+
|GT||VT||colspan=18|
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
|GT||GT||colspan=18|
|05AD
 
|GS
 
|GS
 
|colspan=30|
 
 
|-
 
|-
|05AE
+
|GT||LT||colspan=18|
|LS
 
|LS
 
|colspan=30|
 
 
|-
 
|-
|05AD
+
!rowspan=3|IS_TEXT_LABEL_LVAR_EQUAL_TO_TEXT_LABEL_ANY{{ref|likely|[*]}}
|GS
+
|rowspan=3|05AE
|LS
+
|LT||VT||colspan=18|
|colspan=30|
 
 
|-
 
|-
|05AE
+
|LT||GT||colspan=18|
|LS
 
|GS
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|CMPEN{{ref|operat|[*]}}<br/>COMPARE_STRING
+
|LT||LT||colspan=18|
!rowspan=2|VN
 
|08F9
 
!rowspan=6|2
 
|GN
 
|NV
 
|colspan=30|
 
 
|-
 
|-
|08FA
+
!rowspan=3|SET_ANY_STRING_TO_VAR_STRING{{ref|likely|[*]}}
|LN
+
|rowspan=3|06D1
|NV
+
|GS||VS||colspan=18|
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
|GS||GS||colspan=18|
|08F9
 
|GN
 
|GN
 
|colspan=30|
 
 
|-
 
|-
|08FA
+
|GS||LS||colspan=18|
|LN
 
|LN
 
|colspan=30|
 
 
|-
 
|-
|08F9
+
!rowspan=3|SET_ANY_STRING_TO_LVAR_STRING{{ref|likely|[*]}}
|GN
+
|rowspan=3|06D2
|LN
+
|LS||VS||colspan=18|
|colspan=30|
 
 
|-
 
|-
|08FA
+
|LS||GS||colspan=18|
|LN
 
|GN
 
|colspan=30|
 
 
|-
 
|-
!CMPEI{{ref|operat|[*]}}
+
|LS||LS||colspan=18|
!VV
 
|07D6
 
!2
 
|LI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
!CMPEF{{ref|operat|[*]}}
+
!IS_INT_LVAR_EQUAL_TO_INT_VAR
!VV
+
|07D6||LI||GI||colspan=18|
|07D7
 
!2
 
|LF
 
|GF
 
|colspan=30|
 
 
|-
 
|-
!colspan=2|SAVE_STRING_TO_DEBUG_FILE{{ref|dbgstr|[*]}}{{ref|argvar|[*]}}
+
!IS_FLOAT_LVAR_EQUAL_TO_FLOAT_VAR
|05B6
+
|07D7||LF||GF||colspan=18|
!0
 
|colspan=32|
 
 
|-
 
|-
!rowspan=4 colspan=2|IS_STRING_NULL
+
!rowspan=2|IS_TEXT_LABEL_NULL!!IS_TEXT_LABEL_NULL_VAR_TEXT_LABEL{{ref|likely|[*]}}
 
|0844
 
|0844
!rowspan=4|1
+
!rowspan=2|1
|GS
+
|GT||colspan=19|
|colspan=31|
 
 
|-
 
|-
|0845
+
!IS_TEXT_LABEL_NULL_LVAR_TEXT_LABEL{{ref|likely|[*]}}
|LS
+
|0845||LT||colspan=19|
|colspan=31|
 
 
|-
 
|-
 +
!rowspan=2|IS_STRING_NULL!!IS_STRING_NULL_VAR_STRING{{ref|likely|[*]}}
 
|0846
 
|0846
|GN
+
!rowspan=2|1
|colspan=31|
+
|GS||colspan=19|
 
|-
 
|-
|0847
+
!IS_STRING_NULL_LVAR_STRING{{ref|likely|[*]}}
|LN
+
|0847||LS||colspan=19|
|colspan=31|
 
 
|-
 
|-
!rowspan=2 colspan=2|INIT_TABLE_OF_GOTO{{ref|statem|[*]}}
+
!rowspan=2 colspan=2|INIT_TABLE_OF_GOTO{{ref|statem|[*]}}{{ref|likely|[*]}}
 
|rowspan=2|0871
 
|rowspan=2|0871
 
!rowspan=2|18
 
!rowspan=2|18
|GI
+
|GI||VI||VI||VO||VI||VO||VI||VO||VI||V0||VI||VO||VI||VO||VI||VO||VI||VO||colspan=2|
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|colspan=14|
 
 
|-
 
|-
|LI
+
|LI||VI||VI||VO||VI||VO||VI||VO||VI||VO||VI||VO||VI||VO||VI||VO||VI||VO||colspan=2|
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|colspan=14|
 
 
|-
 
|-
!colspan=2|APPEND_GOTO_TO_TABLE{{ref|statem|[*]}}
+
!colspan=2|APPEND_GOTO_TO_TABLE{{ref|statem|[*]}}{{ref|likely|[*]}}
 
|0872
 
|0872
 
!18
 
!18
|IV
+
|VI||VO||VI||VO||VI||VO||VI||VO||VI||VO||VI||VO||VI||VO||VI||VO||VI||VO||colspan=2|
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|IV
 
|colspan=14|
 
 
|-
 
|-
!rowspan=6|IS_BIT_SET
+
!rowspan=6|IS_BIT_SET!!IS_BIT_SET_VAR_INT_NUMBER{{ref|likely|[*]}}
!rowspan=2|VN
 
 
|08B4
 
|08B4
 
!rowspan=6|2
 
!rowspan=6|2
|GI
+
|GI||VN||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
|08B7
+
!IS_BIT_SET_VAR_INT_VAR_INT{{ref|likely|[*]}}
|LI
+
|08B5||GI||GI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!IS_BIT_SET_VAR_INT_LVAR_INT{{ref|likely|[*]}}
|08B5
+
|08B6||GI||LI||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|08B6
+
!IS_BIT_SET_LVAR_INT_NUMBER{{ref|likely|[*]}}
|GI
+
|08B7||LI||VN||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|08B8
+
!IS_BIT_SET_LVAR_INT_VAR_INT{{ref|likely|[*]}}
|LI
+
|08B8||LI||GI||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
|08B9
+
!IS_BIT_SET_LVAR_INT_LVAR_INT{{ref|likely|[*]}}
|LI
+
|08B9||LI||LI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|SET_BIT
+
!rowspan=6|SET_BIT_SET!!SET_BIT_VAR_INT_NUMBER{{ref|likely|[*]}}
!rowspan=2|VN
 
 
|08BA
 
|08BA
 
!rowspan=6|2
 
!rowspan=6|2
|GI
+
|GI||VN||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
|08BD
+
!SET_BIT_VAR_INT_VAR_INT{{ref|likely|[*]}}
|LI
+
|08BB||GI||GI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!SET_BIT_VAR_INT_LVAR_INT{{ref|likely|[*]}}
|08BB
+
|08BC||GI||LI||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|08BC
+
!SET_BIT_LVAR_INT_NUMBER{{ref|likely|[*]}}
|GI
+
|08BD||LI||VN||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|08BE
+
!SET_BIT_LVAR_INT_VAR_INT{{ref|likely|[*]}}
|LI
+
|08BE||LI||GI||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
|08BF
+
!SET_BIT_LVAR_INT_LVAR_INT{{ref|likely|[*]}}
|LI
+
|08BF||LI||LI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|CLEAR_BIT
+
!rowspan=6|CLEAR_BIT_SET!!CLEAR_BIT_VAR_INT_NUMBER{{ref|likely|[*]}}
!rowspan=2|VN
 
 
|08C0
 
|08C0
 
!rowspan=6|2
 
!rowspan=6|2
|GI
+
|GI||VN||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
|08C3
+
!CLEAR_BIT_VAR_INT_VAR_INT{{ref|likely|[*]}}
|LI
+
|08C1||GI||GI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!CLEAR_BIT_VAR_INT_LVAR_INT{{ref|likely|[*]}}
|08C1
+
|08C2||GI||LI||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|08C2
+
!CLEAR_BIT_LVAR_INT_NUMBER{{ref|likely|[*]}}
|GI
+
|08C3||LI||VN||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|08C4
+
!CLEAR_BIT_LVAR_INT_VAR_INT{{ref|likely|[*]}}
|LI
+
|08C4||LI||GI||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
|08C5
+
!CLEAR_BIT_LVAR_INT_LVAR_INT{{ref|likely|[*]}}
|LI
+
|08C5||LI||LI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2 colspan=2|STRING_STRING
+
!rowspan=6|=<br/>COMPARE_STRING{{ref|likely|[*]}}!!rowspan=3|IS_STRING_VAR_EQUAL_TO_STRING_ANY{{ref|likely|[*]}}<br/>COMPARE_STRING_VAR_STRING_ANY_STRING{{ref|likely|[*]}}
|098B
+
|rowspan=3|08F9
!rowspan=2|3
+
!rowspan=6|2
|GS
+
|GS||VS||colspan=18|
|GS
 
|GS
 
|colspan=29|
 
 
|-
 
|-
|098C
+
|GS||GS||colspan=18|
|GN
 
|GN
 
|GN
 
|colspan=29|
 
 
|-
 
|-
|colspan=36|{{icon|lcs}}
+
|GS||LS||colspan=18|
 
|-
 
|-
!rowspan=2|MOVC{{ref|operat|[*]}}
+
!rowspan=3|IS_STRING_LVAR_EQUAL_TO_STRING_ANY{{ref|likely|[*]}}<br/>COMPARE_STRING_LVAR_STRING_ANY_STRING{{ref|likely|[*]}}
!rowspan=2|VN
+
|rowspan=3|08FA
|04B3
+
|LS||VS||colspan=18|
!rowspan=2|2
 
|GC
 
|CV
 
|colspan=30|
 
 
|-
 
|-
|04B4
+
|LS||GS||colspan=18|
|LC
 
|CV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|CMPGC{{ref|operat|[*]}}
+
|LS||LS||colspan=18|
!rowspan=2|VN
 
|04B5
 
!rowspan=2|2
 
|GC
 
|CV
 
|colspan=30|
 
 
|-
 
|-
|04B6
+
|colspan=25|{{icon|lcs}}
|LC
 
|CV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
!colspan=2|GOTO_IF_TRUE{{ref|statem|[*]}}
|04B7
+
|004C
!rowspan=2|2
+
!1
|CV
+
|VI||colspan=19|
|GC
 
|colspan=30|
 
 
|-
 
|-
|04B8
+
!colspan=2|RETURN_TRUE
|CV
+
|00C5
|LC
+
!0
|colspan=30|
+
|colspan=20|
 
|-
 
|-
!rowspan=4|CMPGEC{{ref|operat|[*]}}
+
!colspan=2|RETURN_FALSE
!rowspan=2|VN
+
|00C6
|04B9
+
!0
!rowspan=2|2
+
|colspan=20|
|GC
 
|CV
 
|colspan=30|
 
|-
 
|04BA
 
|LC
 
|CV
 
|colspan=30|
 
|-
 
!rowspan=2|NV
 
|04BB
 
!rowspan=2|2
 
|CV
 
|GV
 
|colspan=30|
 
|-
 
|04BC
 
|CV
 
|LC
 
|colspan=30|
 
|-
 
!rowspan=2|CMPEC{{ref|operat|[*]}}
 
!rowspan=2|VN
 
|04A8
 
!rowspan=2|2
 
|GC
 
|CV
 
|colspan=30|
 
|-
 
|04A9
 
|LC
 
|CV
 
|colspan=30|
 
 
|-
 
|-
!colspan=2|COMPARING_RULE{{ref|statem|[*]}}
+
!colspan=2|ANDOR{{ref|statem|[*]}}
 
|00DB
 
|00DB
 
!1
 
!1
|IV
+
|VI||colspan=19|
|colspan=31|
 
 
|-
 
|-
!colspan=2|START_TEST_SCRIPT{{ref|likely|[*]}}
+
!colspan=2|LAUNCH_MISSION
 
|00DC
 
|00DC
 
!1
 
!1
|IV
+
|VO||colspan=19|
|colspan=31|
 
 
|-
 
|-
!colspan=2|LAUNCH_GOSUB{{ref|likely|[*]}}
+
!colspan=2|GOSUB_FILE
 
|02D2
 
|02D2
 
!2
 
!2
|IV
+
|VO||VO||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!colspan=2|LAUNCH_MISSION
+
!colspan=2|LOAD_AND_LAUNCH_MISSION
 
|041C
 
|041C
 
!1
 
!1
|IV
+
|VO||colspan=19|
|colspan=31|
 
 
|-
 
|-
!rowspan=2 colspan=2|CALL_FUNCTION{{ref|undefa|[*]}}{{ref|argvar|[*]}}
+
!rowspan=4|=!!IS_INT_VAR_EQUAL_TO_CONSTANT
|05AE
+
|04A8
!rowspan=2|4
+
!rowspan=4|2
|rowspan=2|IV
+
|GC||VC||colspan=18|
|rowspan=2|IV
 
|rowspan=2|IV
 
|rowspan=2|IV
 
|rowspan=2 colspan=28|_ _ _
 
 
|-
 
|-
|05AF
+
!IS_INT_LVAR_EQUAL_TO_CONSTANT
 +
|04A9||LC||VC||colspan=18|
 
|-
 
|-
|colspan=36|{{icon|vcs}}
+
!SET_VAR_INT_TO_CONSTANT
 +
|04B3||GC||VC||colspan=18|
 
|-
 
|-
!rowspan=6|MOVI{{ref|operat|[*]}}
+
!SET_LVAR_INT_TO_CONSTANT
!rowspan=2|VN
+
|04B4||LC||VC||colspan=18|
|rowspan=2|0004
 
!rowspan=6|2
 
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|LI
+
!rowspan=4|>!!IS_INT_VAR_GREATER_THAN_CONSTANT
|IV
+
|04B5
|colspan=30|
+
!rowspan=4|2
 +
|GC||VC||colspan=18|
 
|-
 
|-
!rowspan=4|VV
+
!IS_INT_LVAR_GREATER_THAN_CONSTANT
|rowspan=4|0035
+
|04B6||LC||VC||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|LI
+
!IS_CONSTANT_GREATER_THAN_INT_VAR
|LI
+
|04B7||VC||GC||colspan=18|
|colspan=30|
 
 
|-
 
|-
|GI
+
!IS_CONSTANT_GREATER_THAN_INT_LVAR
|LI
+
|04B8||VC||LC||colspan=18|
|colspan=30|
 
 
|-
 
|-
|LI
+
!rowspan=4|>=!!IS_INT_VAR_GREATER_OR_EQUAL_TO_CONSTANT
|GI
+
|04B9
|colspan=30|
+
!rowspan=4|2
 +
|GC||VC||colspan=18|
 
|-
 
|-
!rowspan=6|MOVF{{ref|operat|[*]}}
+
!IS_INT_LVAR_GREATER_OR_EQUAL_TO_CONSTANT
!rowspan=2|VN
+
|04BA||LC||VC||colspan=18|
|rowspan=2|0005
 
!rowspan=6|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|LF
+
!IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR
|FV
+
|04BB||VC||GV||colspan=18|
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_LVAR
|rowspan=4|0036
+
|04BC||VC||LC||colspan=18|
|GF
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
!rowspan=2|CALL{{ref|undefa|[*]}}{{ref|argvar|[*]}}!!CALL_05AE
|LF
+
|05AE
|colspan=30|
+
!rowspan=2|1
 +
|rowspan=2|VO
 +
|rowspan=2 colspan=19|_ _ _
 
|-
 
|-
|GF
+
!CALL_05AF
|LF
+
|05AF
|colspan=30|
 
 
|-
 
|-
|LF
+
|colspan=25|{{icon|vcs}}
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|MOVS{{ref|operat|[*]}}
+
!rowspan=6|=!!rowspan=2|SET_ANY_INT
!rowspan=2|VN
+
|rowspan=2|0004
|rowspan=2|0006
 
 
!rowspan=6|2
 
!rowspan=6|2
|GS
+
|GI||VI||colspan=18|
|SV
 
|colspan=30|
 
 
|-
 
|-
|LS
+
|LI||VI||colspan=18|
|SV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=2|SET_ANY_FLOAT
|rowspan=4|0037
+
|rowspan=2|0005
|GS
+
|GF||VF||colspan=18|
|GS
 
|colspan=30|
 
 
|-
 
|-
|LS
+
|LF||VF||colspan=18|
|LS
 
|colspan=30|
 
 
|-
 
|-
|GS
+
!rowspan=2|SET_ANY_TEXT_LABEL
|LS
+
|rowspan=2|0006
|colspan=30|
+
|GT||VT||colspan=18|
 
|-
 
|-
|LS
+
|LT||VT||colspan=18|
|GS
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|ADDI{{ref|operat|[*]}}
+
!rowspan=4|+=!!rowspan=2|ADD_VAL_TO_INT_ANY
!rowspan=2|VN
 
 
|rowspan=2|0007
 
|rowspan=2|0007
!rowspan=6|2
+
!rowspan=4|2
|GI
+
|GI||VI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|LI||VI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=2|ADD_VAL_TO_FLOAT_ANY
|rowspan=4|0029
+
|rowspan=2|0008
|GI
+
|GF||VF||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|LF||VF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|GI
+
!rowspan=4|-=!!rowspan=2|SUB_VAL_FROM_INT_ANY
|LI
+
|rowspan=2|0009
|colspan=30|
+
!rowspan=4|2
 +
|GI||VI||colspan=18|
 
|-
 
|-
|LI
+
|LI||VI||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|ADDF{{ref|operat|[*]}}
+
!rowspan=2|SUB_VAL_FROM_FLOAT_ANY
!rowspan=2|VN
+
|rowspan=2|000A
|rowspan=2|0008
+
|GF||VF||colspan=18|
!rowspan=6|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LF||VF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=4|*=!!rowspan=2|MULT_INT_ANY_BY_VAL
|rowspan=4|002A
+
|rowspan=2|000B
|GF
+
!rowspan=4|2
|GF
+
|GI||VI||colspan=18|
|colspan=30|
 
 
|-
 
|-
|LF
+
|LI||VI||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|GF
+
!rowspan=2|MULT_FLOAT_ANY_BY_VAL
|LF
+
|rowspan=2|000C
|colspan=30|
+
|GF||VF||colspan=18|
 
|-
 
|-
|LF
+
|LF||VF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|SUBI{{ref|operat|[*]}}
+
!rowspan=4|/=!!rowspan=2|DIV_INT_ANY_BY_VAL
!rowspan=2|VN
+
|rowspan=2|000D
|rowspan=2|0009
+
!rowspan=4|2
!rowspan=6|2
+
|GI||VI||colspan=18|
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|LI||VI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=2|DIV_FLOAT_ANY_BY_VAL
|rowspan=4|002B
+
|rowspan=2|000E
|GI
+
|GF||VF||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|LF||VF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|GI
+
!rowspan=16|>!!rowspan=2|IS_INT_ANY_GREATER_THAN_NUMBER
|LI
+
|rowspan=2|000F
|colspan=30|
+
!rowspan=16|2
 +
|GI||VN||colspan=18|
 
|-
 
|-
|LI
+
|LI||VN||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|SUBF{{ref|operat|[*]}}
+
!rowspan=2|IS_NUMBER_GREATER_THAN_INT_ANY
!rowspan=2|VN
+
|rowspan=2|0010
|rowspan=2|000A
+
|VN||GI||colspan=18|
!rowspan=6|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|VN||LI||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=4|IS_INT_ANY_GREATER_THAN_INT_ANY
|rowspan=4|002C
+
|rowspan=4|0011
|GF
+
|GI||GI||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|GI||LI||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|GF
+
|LI||GI||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LI||LI||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|MULI{{ref|operat|[*]}}
+
!rowspan=2|IS_FLOAT_ANY_GREATER_THAN_NUMBER
!rowspan=2|VN
+
|rowspan=2|0012
|rowspan=2|000B
+
|GF||VN||colspan=18|
!rowspan=6|2
 
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|LF||VN||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=2|IS_NUMBER_GREATER_THAN_FLOAT_ANY
|rowspan=4|002D
+
|rowspan=2|0013
|GI
+
|VN||GF||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|VN||LF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|GI
+
!rowspan=4|IS_FLOAT_ANY_GREATER_THAN_FLOAT_ANY
|LI
+
|rowspan=4|0014
|colspan=30|
+
|GF||GF||colspan=18|
 
|-
 
|-
|LI
+
|GF||LF||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|MULF{{ref|operat|[*]}}
+
|LF||GF||colspan=18|
!rowspan=2|VN
 
|rowspan=2|000C
 
!rowspan=6|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LF||LF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=16|>=!!rowspan=2|IS_INT_ANY_GREATER_OR_EQUAL_TO_NUMBER
|rowspan=4|002E
+
|rowspan=2|0015
|GF
+
!rowspan=16|2
|GF
+
|GI||VN||colspan=18|
|colspan=30|
 
 
|-
 
|-
|LF
+
|LI||VN||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|GF
+
!rowspan=2|IS_NUMBER_GREATER_OR_EQUAL_TO_INT_ANY
|LF
+
|rowspan=2|0016
|colspan=30|
+
|VN||GI||colspan=18|
 
|-
 
|-
|LF
+
|VN||LI||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|DIVI{{ref|operat|[*]}}
+
!rowspan=4|IS_INT_ANY_GREATER_OR_EQUAL_TO_INT_ANY
!rowspan=2|VN
+
|rowspan=4|0017
|rowspan=2|000D
+
|GI||GI||colspan=18|
!rowspan=6|2
 
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|GI||LI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
|LI||GI||colspan=18|
|rowspan=4|002F
 
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|LI||LI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|GI
+
!rowspan=2|IS_FLOAT_ANY_GREATER_OR_EQUAL_TO_NUMBER
|LI
+
|rowspan=2|0018
|colspan=30|
+
|GF||VN||colspan=18|
 
|-
 
|-
|LI
+
|LF||VN||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|DIVF{{ref|operat|[*]}}
+
!rowspan=2|IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_ANY
!rowspan=2|VN
+
|rowspan=2|0019
|rowspan=2|000E
+
|VN||GF||colspan=18|
!rowspan=6|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|VN||LF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=4|IS_FLOAT_ANY_GREATER_OR_EQUAL_TO_FLOAT_ANY
|rowspan=4|0030
+
|rowspan=4|001A
|GF
+
|GF||GF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|GF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|GF
+
|LF||GF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LF||LF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|CVFI{{ref|operat|[*]}}
+
!rowspan=12|=!!rowspan=2|IS_INT_ANY_EQUAL_TO_NUMBER
!rowspan=4|VV
+
|rowspan=2|001B
|rowspan=4|0038
+
!rowspan=12|2
!rowspan=4|2
+
|GI||VN||colspan=18|
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|LI||VN||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|GI
+
!rowspan=4|IS_INT_ANY_EQUAL_TO_INT_ANY
|LI
+
|rowspan=4|001C
|colspan=30|
+
|GI||GI||colspan=18|
 
|-
 
|-
|LI
+
|GI||LI||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|CVIF{{ref|operat|[*]}}
+
|LI||GI||colspan=18|
!rowspan=4|VV
 
|rowspan=4|0039
 
!rowspan=4|2
 
|GF
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LI||LI||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|GF
+
!rowspan=2|IS_FLOAT_ANY_EQUAL_TO_NUMBER
|LF
+
|rowspan=2|001D
|colspan=30|
+
|GF||VN||colspan=18|
 
|-
 
|-
|LF
+
|LF||VN||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=8|CMPGI{{ref|operat|[*]}}
+
!rowspan=4|IS_FLOAT_ANY_EQUAL_TO_FLOAT_ANY
!rowspan=2|VN
+
|rowspan=4|001E
|rowspan=2|000F
+
|GF||GF||colspan=18|
!rowspan=8|2
 
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|GF||LF||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
|LF||GF||colspan=18|
|rowspan=2|0010
 
|IV
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|IV
+
|LF||LF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=6|=!!rowspan=2|IS_TEXT_LABEL_ANY_EQUAL_TO_TEXT_LABEL
|rowspan=4|0011
+
|rowspan=2|001F
|GI
+
!rowspan=6|2
|GI
+
|GT||VT||colspan=18|
|colspan=30|
 
 
|-
 
|-
|LI
+
|LT||VT||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|GI
+
!rowspan=4|IS_ANY_TEXT_LABEL_EQUAL_TO_TEXT_LABEL_ANY
|LI
+
|rowspan=4|0020
|colspan=30|
+
|GT||GT||colspan=18|
 
|-
 
|-
|LI
+
|GT||LT||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=8|CMPGF{{ref|operat|[*]}}
+
|LT||GT||colspan=18|
!rowspan=2|VN
 
|rowspan=2|0012
 
!rowspan=8|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LT||LT||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
!colspan=2|GOTO_IF_TRUE{{ref|statem|[*]}}
|rowspan=2|0013
+
|0021
|FV
+
!1
|GF
+
|VO||colspan=19|
|colspan=30|
 
 
|-
 
|-
|FV
+
!colspan=2|GOTO_IF_FALSE{{ref|statem|[*]}}
|LF
+
|0022
|colspan=30|
+
!1
 +
|VO||colspan=19|
 
|-
 
|-
!rowspan=4|VV
+
!colspan=2|TERMINATE_THIS_SCRIPT
|rowspan=4|0014
+
|rowspan=2|0023
|GF
+
!rowspan=2|0
|GF
+
|rowspan=2 colspan=20|
|colspan=30|
+
|-
 +
!colspan=2|MISSION_END
 
|-
 
|-
|LF
+
!colspan=2|START_NEW_SCRIPT{{ref|undefa|[*]}}
|LF
+
|0024
|colspan=30|
+
!1
 +
|VO||colspan=20|_ _ _
 
|-
 
|-
|GF
+
!colspan=2|GOSUB
|LF
+
|0025
|colspan=30|
+
!1
 +
|VO||colspan=20|
 
|-
 
|-
|LF
+
!colspan=2|RETURN
|GF
+
|0026
|colspan=30|
+
!0
 +
|colspan=20|
 
|-
 
|-
!rowspan=8|CMPGEI{{ref|operat|[*]}}
+
!rowspan=8|+=!!rowspan=4|ADD_INT_ANY_TO_INT_ANY
!rowspan=2|VN
+
|rowspan=4|0029
|rowspan=2|0015
 
 
!rowspan=8|2
 
!rowspan=8|2
|GI
+
|GI||GI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|GI||LI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
|LI||GI||colspan=18|
|rowspan=2|0016
 
|IV
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|IV
+
|LI||LI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=4|ADD_FLOAT_ANY_FLOAT_ANY
|rowspan=4|0017
+
|rowspan=4|002A
|GI
+
|GF||GF||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|GF||LF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|GI
+
|LF||GF||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|LF||LF||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=8|CMPGEF{{ref|operat|[*]}}
+
!rowspan=8|-=!!rowspan=4|SUB_INT_ANY_FROM_INT_ANY
!rowspan=2|VN
+
|rowspan=4|002B
|rowspan=2|0018
 
 
!rowspan=8|2
 
!rowspan=8|2
|GF
+
|GI||GI||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|GI||LI||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
|LI||GI||colspan=18|
|rowspan=2|0019
 
|FV
 
|GF
 
|colspan=30|
 
 
|-
 
|-
|FV
+
|LI||LI||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|NV
+
!rowspan=4|SUB_FLOAT_ANY_FROM_FLOAT_ANY
|rowspan=4|001A
+
|rowspan=4|002C
|GF
+
|GF||GF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|GF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|GF
+
|LF||GF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LF||LF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|CMPEI{{ref|operat|[*]}}
+
!rowspan=8|*=!!rowspan=4|MULT_INT_ANY_BY_INT_ANY
!rowspan=2|VN
+
|rowspan=4|002D
|rowspan=2|001B
+
!rowspan=8|2
!rowspan=6|2
+
|GI||GI||colspan=18|
|GI
 
|IV
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|GI||LI||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
|LI||GI||colspan=18|
|rowspan=4|001C
 
|GI
 
|GI
 
|colspan=30|
 
 
|-
 
|-
|LI
+
|LI||LI||colspan=18|
|LI
 
|colspan=30|
 
 
|-
 
|-
|GI
+
!rowspan=4|MULT_FLOAT_ANY_BY_FLOAT_ANY
|LI
+
|rowspan=4|002E
|colspan=30|
+
|GF||GF||colspan=18|
 
|-
 
|-
|LI
+
|GF||LF||colspan=18|
|GI
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|CMPEF{{ref|operat|[*]}}
+
|LF||GF||colspan=18|
!rowspan=2|VN
 
|rowspan=2|001D
 
!rowspan=6|2
 
|GF
 
|FV
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LF||LF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=8|/=!!rowspan=4|DIV_INT_ANY_BY_INT_ANY
|rowspan=4|001E
+
|rowspan=4|002F
|GF
+
!rowspan=8|2
|GF
+
|GI||GI||colspan=18|
|colspan=30|
 
 
|-
 
|-
|LF
+
|GI||LI||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|GF
+
|LI||GI||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LI||LI||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|CMPES{{ref|operat|[*]}}<br/>COMPARE_STRING
+
!rowspan=4|DIV_FLOAT_ANY_BY_FLOAT_ANY
!rowspan=2|VN
+
|rowspan=4|0030
|rowspan=2|001F
+
|GF||GF||colspan=18|
!rowspan=6|2
 
|GS
 
|SV
 
|colspan=30|
 
|-
 
|LS
 
|SV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
|GF||LF||colspan=18|
|rowspan=4|0020
 
|GS
 
|GS
 
|colspan=30|
 
 
|-
 
|-
|LS
+
|LF||GF||colspan=18|
|LS
 
|colspan=30|
 
 
|-
 
|-
|GS
+
|LF||LF||colspan=18|
|LS
 
|colspan=30|
 
 
|-
 
|-
|LS
+
!rowspan=6|+=@!!rowspan=2|ADD_TIMED_VAL_TO_FLOAT_ANY
|GS
 
|colspan=30|
 
|-
 
!rowspan=6|ADDTSF{{ref|operat|[*]}}
 
!rowspan=2|VN
 
 
|rowspan=2|0031
 
|rowspan=2|0031
 
!rowspan=6|2
 
!rowspan=6|2
|GF
+
|GF||VF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LF||VF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=4|ADD_TIMED_FLOAT_ANY_TO_FLOAT_ANY
 
|rowspan=4|0032
 
|rowspan=4|0032
|GF
+
|GF||GF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|GF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|GF
+
|LF||GF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LF||LF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=6|SUBTSF{{ref|operat|[*]}}
+
!rowspan=6|-=@!!rowspan=2|SUB_TIMED_VAL_FROM_FLOAT_ANY
!rowspan=2|VN
 
 
|rowspan=2|0033
 
|rowspan=2|0033
 
!rowspan=6|2
 
!rowspan=6|2
|GF
+
|GF||VF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LF||VF||colspan=18|
|FV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|VV
+
!rowspan=4|SUB_TIMED_FLOAT_ANY_FROM_FLOAT_ANY
 
|rowspan=4|0034
 
|rowspan=4|0034
|GF
+
|GF||GF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|GF||LF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|GF
+
|LF||GF||colspan=18|
|LF
 
|colspan=30|
 
 
|-
 
|-
|LF
+
|LF||LF||colspan=18|
|GF
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2 colspan=2|ABSI
+
!rowspan=12|=!!rowspan=4|SET_ANY_INT_TO_ANY_INT
|rowspan=2|003A
+
|rowspan=4|0035
!rowspan=2|1
+
!rowspan=12|2
|GI
+
|GI||GI||colspan=18|
|colspan=31|
 
 
|-
 
|-
|LI
+
|GI||LI||colspan=18|
|colspan=31|
 
 
|-
 
|-
!rowspan=2 colspan=2|ABSF
+
|LI||GI||colspan=18|
|rowspan=2|003B
 
!rowspan=2|1
 
|GF
 
|colspan=31|
 
 
|-
 
|-
|LF
+
|LI||LI||colspan=18|
|colspan=31|
 
 
|-
 
|-
!rowspan=2|MOVC{{ref|operat|[*]}}
+
!rowspan=4|SET_ANY_FLOAT_TO_ANY_FLOAT
!rowspan=2|VN
+
|rowspan=4|0036
|rowspan=2|02E2
+
|GF||GF||colspan=18|
!rowspan=2|2
 
|GC
 
|CV
 
|colspan=30|
 
 
|-
 
|-
|LC
+
|GF||LF||colspan=18|
|CV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|CMPGC{{ref|operat|[*]}}
+
|LF||GF||colspan=18|
!rowspan=2|VN
 
|rowspan=2|02E3
 
!rowspan=4|2
 
|GC
 
|CV
 
|colspan=30|
 
 
|-
 
|-
|LC
+
|LF||LF||colspan=18|
|CV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
!rowspan=4|SET_ANY_TEXT_LABEL_TO_ANY_TEXT_LABEL
|rowspan=2|02E4
+
|rowspan=4|0037
|CV
+
|GT||GT||colspan=18|
|GC
 
|colspan=30|
 
 
|-
 
|-
|CV
+
|GT||LT||colspan=18|
|LC
 
|colspan=30|
 
 
|-
 
|-
!rowspan=4|CMPGEC{{ref|operat|[*]}}
+
|LT||GT||colspan=18|
!rowspan=2|VN
 
|rowspan=2|02E5
 
!rowspan=4|2
 
|GC
 
|CV
 
|colspan=30|
 
 
|-
 
|-
|LC
+
|LT||LT||colspan=18|
|CV
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|NV
+
!rowspan=8|=#!!rowspan=4|CSET_ANY_INT_TO_ANY_FLOAT
|rowspan=2|02E6
+
|rowspan=4|0038
|CV
+
!rowspan=8|2
|GV
+
|GI||GF||colspan=18|
|colspan=30|
 
 
|-
 
|-
|CV
+
|GI||LF||colspan=18|
|LC
 
|colspan=30|
 
 
|-
 
|-
!rowspan=2|CMPEC{{ref|operat|[*]}}
+
|LI||GF||colspan=18|
!rowspan=2|VN
+
|-
|rowspan=2|02DB
+
|LI||LF||colspan=18|
!rowspan=2|2
 
|GC
 
|CV
 
|colspan=30|
 
 
|-
 
|-
|LC
+
!rowspan=4|CSET_ANY_FLOAT_TO_ANY_INT
|CV
+
|rowspan=4|0039
|colspan=30|
+
|GF||GI||colspan=18|
 
|-
 
|-
!colspan=2|GOTO_IF_TRUE{{ref|statem|[*]}}
+
|GF||LI||colspan=18|
|0021
 
!1
 
|IV
 
|colspan=31|
 
 
|-
 
|-
!colspan=2|GOTO_IF_FALSE{{ref|statem|[*]}}
+
|LF||GI||colspan=18|
|0022
 
!1
 
|IV
 
|colspan=31|
 
 
|-
 
|-
!colspan=2|TERMINATE_THIS_SCRIPT
+
|LF||LI||colspan=18|
|rowspan=2|0023
 
!rowspan=2|0
 
|rowspan=2 colspan=32|
 
 
|-
 
|-
!colspan=2|MISSION_END
+
!rowspan=4|ABS!!rowspan=2|ABS_ANY_INT
 +
|rowspan=2|003A
 +
!rowspan=4|1
 +
|GI||colspan=19|
 
|-
 
|-
!colspan=2|START_NEW_SCRIPT{{ref|undefa|[*]}}
+
|LI||colspan=19|
|0024
 
!1
 
|IV
 
|colspan=31|_ _ _
 
 
|-
 
|-
!colspan=2|GOSUB
+
!rowspan=2|ABS_ANY_FLOAT
|0025
+
|rowspan=2|003B
!1
+
|GF||colspan=19|
|IV
 
|colspan=31|
 
 
|-
 
|-
!colspan=2|RETURN
+
|LF||colspan=19|
|0026
 
!0
 
|colspan=32|
 
 
|-
 
|-
!colspan=2|RETURN_TRUE{{ref|likely|[*]}}
+
!colspan=2|RETURN_TRUE
 
|005E
 
|005E
 
!0
 
!0
|colspan=32|
+
|colspan=20|
 
|-
 
|-
!colspan=2|RETURN_FALSE{{ref|likely|[*]}}
+
!colspan=2|RETURN_FALSE
 
|005F
 
|005F
 
!0
 
!0
|colspan=32|
+
|colspan=20|
 
|-
 
|-
!colspan=2|COMPARING_RULE{{ref|statem|[*]}}
+
!colspan=2|ANDOR{{ref|statem|[*]}}
 
|0078
 
|0078
 
!1
 
!1
|IV
+
|VI||colspan=19|
|colspan=31|
 
 
|-
 
|-
!colspan=2|START_TEST_SCRIPT{{ref|likely|[*]}}
+
!colspan=2|LAUNCH_MISSION
 
|0079
 
|0079
 
!1
 
!1
|IV
+
|VI||colspan=19|
|colspan=31|
 
 
|-
 
|-
!colspan=2|LAUNCH_GOSUB{{ref|likely|[*]}}
+
!colspan=2|GOSUB_FILE
 
|01BA
 
|01BA
 
!2
 
!2
|IV
+
|VO||VO||colspan=18|
|IV
 
|colspan=30|
 
 
|-
 
|-
!colspan=2|LAUNCH_MISSION
+
!colspan=2|LOAD_AND_LAUNCH_MISSION
 
|0289
 
|0289
 
!1
 
!1
|IV
+
|IV||colspan=19|
|colspan=31|
 
 
|-
 
|-
!rowspan=2 colspan=2|CALL_FUNCTION{{ref|undefa|[*]}}{{ref|argvar|[*]}}
+
!rowspan=4|=!!rowspan=2|IS_INT_ANY_EQUAL_TO_CONSTANT
 +
|rowspan=2|02DB
 +
!rowspan=4|2
 +
|GC||VC||colspan=18|
 +
|-
 +
|LC||VC||colspan=18|
 +
|-
 +
!rowspan=2|SET_ANY_INT_TO_CONSTANT
 +
|rowspan=2|02E2
 +
|GC||VC||colspan=18|
 +
|-
 +
|LC||VC||colspan=18|
 +
|-
 +
!rowspan=4|>!!rowspan=2|IS_INT_ANY_GREATER_THAN_CONSTANT
 +
|rowspan=2|02E3
 +
!rowspan=4|2
 +
|GC||VC||colspan=18|
 +
|-
 +
|LC||VC||colspan=18|
 +
|-
 +
!rowspan=2|IS_CONSTANT_GREATER_THAN_INT_ANY
 +
|rowspan=2|02E4
 +
|VC||GC||colspan=18|
 +
|-
 +
|VC||LC||colspan=18|
 +
|-
 +
!rowspan=4|>=!!rowspan=2|IS_INT_ANY_GREATER_OR_EQUAL_TO_CONSTANT
 +
|rowspan=2|02E5
 +
!rowspan=4|2
 +
|GC||VC||colspan=18|
 +
|-
 +
|LC||VC||colspan=18|
 +
|-
 +
!rowspan=2|IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_ANY
 +
|rowspan=2|02E6
 +
|VC||GV||colspan=18|
 +
|-
 +
|VC||LC||colspan=18|
 +
|-
 +
!rowspan=2|CALL{{ref|undefa|[*]}}{{ref|argvar|[*]}}!!CALL_037A
 
|037A
 
|037A
!rowspan=2|4
+
!rowspan=2|1
|rowspan=2|IV
+
|rowspan=2|VO
|rowspan=2|IV
+
|rowspan=2 colspan=19|_ _ _
|rowspan=2|IV
 
|rowspan=2|IV
 
|rowspan=2 colspan=28|_ _ _
 
 
|-
 
|-
 +
!CALL_037B
 
|037B
 
|037B
 
|}
 
|}
  
 
;Notes
 
;Notes
:{{note|misdef}} A special mission directive which is never compiled.
+
:{{note|misdef}} A special [[#Mission scripts|mission]] directive which is never compiled.
:{{note|semihd}} It is hidden when used to build [[#Statements|statements]].
+
:{{note|statem}} It is used also to build [[#Statements|statements]] internally.
:{{note|operat}} It is never used cause it is explicitly transformed in an [[#Operators|operator]].
+
:{{note|undefa}} It has an undefined amount of [[#Arguments|arguments]].
:{{note|statem}} It is used only to build statements.
+
:{{note|likely}} It is a likely definition of the standard command.
:{{note|undefa}} It has an undefined amount of arguments.
+
:{{note|argvar}} Arguments amount varies when compiling.
:{{note|likely}} It is a likely definition of the standard [[#Commands|command]].
+
 
:{{note|dbgstr}} The command still accepts an argument which can admit up to ''127 characters plus the null-terminator''. In the compiling process, the argument is skipped but its string is copied to a predefined ''128-bytes buffer'', compiled afterwards. These are the predetermined bytes that seem to do nothing:
+
{{incomplete}}
00 00 41 00 09 2E 00 00 00 00 00 00 <span style="color: silver">00</span> 00 00 00
+
 
<span style="color: blue">09 2E 00 00</span> 00 00 00 00 1C FB 12 00 D8 A8 41 00
 
00 00 41 00 09 2E 00 00 00 00 00 00 <span style="color: silver">01</span> 00 00 00
 
<span style="color: blue">09 2E 00 00</span> 00 00 00 00 1C FB 12 00 D8 A8 41 00
 
00 00 41 00 09 2E 00 00 00 00 00 00 <span style="color: silver">02</span> 00 00 00
 
<span style="color: blue">09 2E 00 00</span> 00 00 00 00 1C FB 12 00 D8 A8 41 00
 
00 00 41 00 09 2E 00 00 00 00 00 00 <span style="color: silver">03</span> 00 00 00
 
<span style="color: blue">09 2E 00 00</span> 00 00 00 00 1C FB 12 00 D8 A8 41 00
 
:Dynamic values within a block are marked in <span style="color: silver">grey</span>, while those which differs among each block are coloured in <span style="color: blue">blue</span>.
 
:{{note|argvar}} Arguments amount varies when compiling.
 
 
 
{{incomplete}}
 
 
 
 
===Uncommon===
 
===Uncommon===
  
Arguments of some commands keep uncommon values which look familiar after encoding:
+
[[#Arguments|Arguments]] of some commands keep uncommon [[#Value|values]] which look familiar after encoding:
  
 
{|class=wikitable style=text-align:center  
 
{|class=wikitable style=text-align:center  
Line 3,154: Line 2,288:
 
!GOSUB
 
!GOSUB
 
|1
 
|1
|Gosub label
+
|[[#Gosubs|Gosub]] label
 
|Offset
 
|Offset
 
|INT
 
|INT
 
|-
 
|-
!rowspan=2|LAUNCH_GOSUB
+
!rowspan=2|GOSUB_FILE
 
|1
 
|1
 
|Gosub label
 
|Gosub label
Line 3,165: Line 2,299:
 
|-
 
|-
 
|2
 
|2
|Gosub file
+
|[[#Foreign gosubs|Foreign gosub]] file
 
|-
 
|-
 
!START_NEW_SCRIPT
 
!START_NEW_SCRIPT
 
|1
 
|1
|Script label
+
|[[#Scripts|Script]] label
 
|0-based offset
 
|0-based offset
 
|INT
 
|INT
 
|-
 
|-
!START_TEST_SCRIPT
+
!LAUNCH_MISSION
 
|1
 
|1
|Script file
+
|[[#Subscripts|Subscript]] file
 
|0-based offset
 
|0-based offset
 
|INT
 
|INT
 
|-
 
|-
!LAUNCH_MISSION
+
!LOAD_AND_LAUNCH_MISSION
 
|1
 
|1
|Mission file
+
|[[#Mission scripts|Mission script]] file
|Mission ID
+
|Mission [[#Identifiers|identifier]]
 
|INT
 
|INT
 
|-
 
|-
|colspan=5|{{icon|3}} {{icon|vc}} {{icon|lcs}} {{icon|vcs}}
+
|colspan=5|{{icon|lcs}} {{icon|vcs}}
 
|-
 
|-
 
!GOTO_IF_TRUE
 
!GOTO_IF_TRUE
Line 3,193: Line 2,327:
 
|INT
 
|INT
 
|-
 
|-
|colspan=5|{{icon|lcs}} {{icon|vcs}}
+
!rowspan=4|CALL
|-
 
!rowspan=4|CALL_FUNCTION
 
 
|1
 
|1
|rowspan=4|Function label
+
|rowspan=4|[[#Functions|Function]] label
 
|Function arguments
 
|Function arguments
 
|rowspan=4|INT
 
|rowspan=4|INT
Line 3,205: Line 2,337:
 
|-
 
|-
 
|3
 
|3
|Parent script locals
+
|Parent script [[#Local|locals]]
 
|-
 
|-
 
|4
 
|4
 
|Offset
 
|Offset
|-
 
|colspan=5|{{icon|sa}}
 
|-
 
!SAVE_STRING_TO_DEBUG_FILE
 
|1
 
|Literal string
 
|128-byte immediate string
 
|STRING
 
 
|}
 
|}
  
Line 3,223: Line 2,347:
 
===Comparing rule===
 
===Comparing rule===
  
The ''comparing rule'' can handle up to ''9 checks'' per construct. ''006D'' ({{icon|3}}, {{icon|vc}}, {{icon|sa}}), ''00DB'' ({{icon|lcs}}) and ''0078'' ({{icon|vcs}} indicate you are verifying a single check (0) or multiple checks with either '''AND''' (1 to 8) or '''OR''' (21 to 28) [[#Logical|logical operators]].
+
The ''comparing rule'' can handle up to ''9 checks'' per construct. ''006D'' ({{icon|3}}, {{icon|vc}}, {{icon|sa}}), ''00DB'' ({{icon|lcs}}) and ''0078'' ({{icon|vcs}}) indicate you are verifying a single check (0) or multiple checks with either '''AND''' (1 to 8) or '''OR''' (21 to 28) [[#Logical|logical operators]] (see also [[#ANDOR|ANDOR]]).
  
 
==Analysis==
 
==Analysis==
Line 3,263: Line 2,387:
 
  {004D}
 
  {004D}
 
  {....}
 
  {....}
  {0002}
+
  {0002}
   ----  
+
   ----  
  {....}
+
  {....}
   ----  
+
   ----  
|
+
|
  {0078}
+
  {0078}
  {....}
+
  {....}
  {....}
+
  {....}
  {0022}
+
  {0022}
  {....}
+
  {....}
  {0002}
+
  {0002}
   ----  
+
   ----  
  {....}
+
  {....}
   ----  
+
   ----  
|
+
|
  COMPARING_RULE {value}
+
  ANDOR {value}
     [NOT] {condition0}
+
     [NOT] {condition0}
     [[NOT] {condition8}]
+
     [[NOT] {condition8}]
  GOTO_IF_FALSE ELSE
+
  GOTO_IF_FALSE ELSE
     {consequence}
+
     {consequence}
     [GOTO ENDIF
+
     [GOTO ENDIF]
  ELSE:
+
  ELSE:
     {alternative}]
+
     [{alternative}
  ENDIF:
+
ENDIF:]
 +
|}
 +
 
 +
===IFNOT===
 +
 
 +
Not that much to say more than the preceding construct, the [[#IFNOT|IFNOT]] statement is built nearly in the same way. In fact, the '''ELSE''' clause points to the ''alternative'', whereas the [[#GOTO|GOTO]] jumps to its end. The substantial difference consists in the substitution of [[#GOTO_IF_FALSE|GOTO_IF_FALSE]] with [[#GOTO_IF_TRUE|GOTO_IF_TRUE]]:
 +
 
 +
{|width=100%
 +
!width=50%|Decompiled
 +
!width=1px|{{icon|lcs}}
 +
!width=1px|{{icon|vcs}}
 +
!Compiled
 +
|-
 +
|
 +
IFNOT [NOT] {condition0}
 +
[AND|OR [NOT] {condition8}]
 +
    {consequence}
 +
[ELSE
 +
    {alternative}]
 +
ENDIF
 +
|
 +
{00DB}
 +
{....}
 +
{....}
 +
{004C}
 +
{....}
 +
{0002}
 +
  ----
 +
{....}
 +
  ----
 +
|
 +
{0078}
 +
{....}
 +
{....}
 +
{0021}
 +
{....}
 +
{0002}
 +
  ----
 +
{....}
 +
  ----
 +
|
 +
ANDOR {value}
 +
    [NOT] {condition0}
 +
    [[NOT] {condition8}]
 +
GOTO_IF_TRUE ELSE
 +
    {consequence}
 +
    [GOTO ENDIF]
 +
ELSE:
 +
    [{alternative}
 +
  ENDIF:]
 +
|}
 +
 
 +
===WHILE===
 +
 
 +
The [[#WHILE|WHILE]] statement is pretty much similar to the previous, even though when the ''consequence'' is read the code is moved to the beginning of the construct:
 +
 
 +
{|width=100%
 +
!width=50%|Decompiled
 +
!width=1px|{{icon|3}} {{icon|vc}} {{icon|sa}}
 +
!width=1px|{{icon|lcs}}
 +
!width=1px|{{icon|vcs}}
 +
!Compiled
 +
|-
 +
|
 +
WHILE [NOT] {condition0}
 +
[AND|OR [NOT] {condition8}]
 +
    {consequence}
 +
ENDWHILE
 +
|
 +
  ----
 +
{006D}
 +
{....}
 +
{....}
 +
{004D}
 +
{....}
 +
{0002}
 +
  ----
 +
|
 +
  ----
 +
{00DB}
 +
{....}
 +
{....}
 +
{004D}
 +
{....}
 +
{0002}
 +
  ----
 +
|
 +
  ----
 +
{0078}
 +
{....}
 +
{....}
 +
{0022}
 +
{....}
 +
{0002}
 +
  ----
 +
|
 +
WHILE:
 +
ANDOR {value}
 +
    [NOT] {condition0}
 +
    [[NOT] {condition8}]
 +
GOTO_IF_FALSE ENDWHILE
 +
    {consequence}
 +
    GOTO WHILE
 +
ENDWHILE:
 
|}
 
|}
  
===WHILE===
+
===WHILENOT===
  
The [[#WHILE|WHILE]] statement is pretty much similar to the previous, even though when the ''consequence'' is read the code is moved to the beginning of the construct:
+
To say the least, [[#WHILENOT|WHILENOT]] statement follows the same constitution of both [[#WHILE|WHILE]] and [[#IFNOT|IFNOT]] constructs, by exchanging [[#GOTO_IF_FALSE|GOTO_IF_FALSE]] with [[#GOTO_IF_TRUE|GOTO_IF_TRUE]]:
  
 
{|width=100%
 
{|width=100%
 
!width=50%|Decompiled
 
!width=50%|Decompiled
!width=1px|{{icon|3}} {{icon|vc}} {{icon|sa}}
 
 
!width=1px|{{icon|lcs}}
 
!width=1px|{{icon|lcs}}
 
!width=1px|{{icon|vcs}}
 
!width=1px|{{icon|vcs}}
Line 3,301: Line 2,527:
 
|-
 
|-
 
|
 
|
  WHILE [NOT] {condition0}
+
  WHILENOT [NOT] {condition0}
 
  [AND|OR [NOT] {condition8}]
 
  [AND|OR [NOT] {condition8}]
 
     {consequence}
 
     {consequence}
 
  ENDWHILE
 
  ENDWHILE
|
 
  ----
 
{006D}
 
{....}
 
{....}
 
{004D}
 
{....}
 
{0002}
 
  ----
 
 
|
 
|
 
   ----  
 
   ----  
Line 3,319: Line 2,536:
 
  {....}
 
  {....}
 
  {....}
 
  {....}
  {004D}
+
  {004C}
 
  {....}
 
  {....}
 
  {0002}
 
  {0002}
Line 3,328: Line 2,545:
 
  {....}
 
  {....}
 
  {....}
 
  {....}
  {0022}
+
  {0021}
 
  {....}
 
  {....}
 
  {0002}
 
  {0002}
 
   ----  
 
   ----  
 
|
 
|
  WHILE:
+
  WHILENOT:
  COMPARING_RULE {value}
+
  ANDOR {value}
 
     [NOT] {condition0}
 
     [NOT] {condition0}
 
     [[NOT] {condition8}]
 
     [[NOT] {condition8}]
  GOTO_IF_FALSE ENDWHILE
+
  GOTO_IF_TRUE ENDWHILE
 
     {consequence}
 
     {consequence}
     GOTO WHILE
+
     GOTO WHILENOT
 
  ENDWHILE:
 
  ENDWHILE:
 
|}
 
|}
  
===DO-WHILE===
+
===REPEAT===
 
 
Not that much to say more than the preceding construct, the [[#DO-WHILE|DO-WHILE]] statement is built nearly in the same way. In fact, the '''ELSE''' clause points to the end of the construct, the '''GOTO''' jumps to the its beginning, while the ''consequence'' is put before all conditions. Judging by its compiled code, it is the most certain definition that R* has originally used like the indisputable one of [[#IF|IF]] and [[#WHILE|WHILE]] constructs. However, a colliding issue with the '''WHILE''' statement can happen:
 
 
 
{|width=100%
 
!width=50%|Decompiled
 
!width=1px|{{icon|vc}} {{icon|sa}}
 
!width=1px|{{icon|lcs}}
 
!width=1px|{{icon|vcs}}
 
!Compiled
 
|-
 
|
 
DO
 
    {consequence}
 
WHILE_TRUE [NOT] {condition0}
 
[AND|OR [NOT] {condition8}]
 
|
 
  ----
 
{....}
 
{006D}
 
{....}
 
{....}
 
{004D}
 
{0002}
 
  ----
 
|
 
  ----
 
{....}
 
{00DB}
 
{....}
 
{....}
 
{004D}
 
{0002}
 
  ----
 
|
 
  ----
 
{....}
 
{0078}
 
{....}
 
{....}
 
{0022}
 
{0002}
 
  ----
 
|
 
DO:
 
{consequence}
 
COMPARING_RULE {value}
 
    [NOT] {condition0}
 
    [[NOT] {condition8}]
 
GOTO_IF_FALSE WHILE_TRUE
 
    GOTO DO
 
WHILE_TRUE:
 
|}
 
 
 
===FOR===
 
  
Seemingly, the [[#FOR|FOR]] statement is the first construct ever optimized as a result of a possible R*'s compiler fault. Moreover, it sounds ambiguous as it loops at least once. This was probably the intention of R*'s programmers, that is iterating at least once else the construct is useless. However, there are some chance they decide to use such structure to avoid some conflict with the [[#WHILE|WHILE]] or [[#DO-WHILE|DO-WHILE]] construct:
+
Seemingly, the [[#REPEAT|REPEAT]] statement is the first construct ever optimized as a result of a possible R* compiler fault. Moreover, it sounds ambiguous as it loops at least once. This was probably the intention of R* programmers, that is iterating at least once else the construct is useless. However, there are few chance they decide to use such structure to avoid some conflict with some other constructs:
  
 
{|width=100%
 
{|width=100%
 
!width=50%|Decompiled
 
!width=50%|Decompiled
!colspan=2|G/L {{icon|sa}} {{icon|lcs}}
+
!colspan=2|G/L {{icon|vc}} {{icon|sa}} {{icon|lcs}}
 
!width=1px|G/L {{icon|vcs}}
 
!width=1px|G/L {{icon|vcs}}
 
!Compiled
 
!Compiled
 
|-
 
|-
 
|
 
|
  FOR {varname} FROM {value0} TO {valueN}
+
  REPEAT {times} {varname}
 
     {consequence}
 
     {consequence}
  ENDFOR
+
  ENDREPEAT
 
|width=1px|
 
|width=1px|
 
  {0004}
 
  {0004}
Line 3,443: Line 2,606:
 
===CASE===
 
===CASE===
  
In {{icon|sa}}, the [[#CASE|CASE]] statement is more complex and efficient because the game uses internally a ''binary search algorithm'' to jump at the [[#Labels|label]] that matches with the value of a particular case. This method requires a known amount of cases which is up to 75. When a case is true, a ''consequence'' is executed and the code jumps to the end of the construct, otherwise the ''alternative'' may be performed. As the code is unoptimized, the [[#GOTO|GOTO]] of the last case is still compiled even though its label points to the end of the jump itself:
+
In {{icon|sa}}, the [[#CASE|CASE]] statement is more complex and efficient because the game uses internally a [[Wikipedia:Binary_search_algorithm|binary search algorithm]] to jump at the [[#Labels|label]] that matches with the value of a particular case. This method requires a known amount of cases which is up to 75. When a case is true, a ''consequence'' is executed and the code jumps to the end of the construct, otherwise the ''alternative'' may be performed. As the code is unoptimized, the [[#GOTO|GOTO]] of the last case is still compiled even though its label points to the end of the jump itself:
  
 
{|width=100%
 
{|width=100%
Line 3,554: Line 2,717:
 
  GOTO_IF_FALSE WHENN
 
  GOTO_IF_FALSE WHENN
 
     {consequence}
 
     {consequence}
     [GOTO ENDCASE0
+
     [GOTO ENDCASE0]
 
  WHENN:
 
  WHENN:
         {varname} = {valueN}
+
         [{varname} = {valueN}
 
     GOTO_IF_FALSE ELSE
 
     GOTO_IF_FALSE ELSE
 
         {consequence}
 
         {consequence}
         [GOTO ENDCASEN
+
         [GOTO ENDCASEN]
 
     ELSE:
 
     ELSE:
         {alternative}]
+
         [{alternative}
     ENDCASEN:]
+
     ENDCASEN:]]
 
  ENDCASE0:
 
  ENDCASE0:
 
|}
 
|}

Revision as of 20:44, 31 December 2012

This section deals with the native SCM syntax of GTA 3 series, nothing other than III, VC, SA, LCS and VCS.
It may contain non-standard SCM definitions as R* hasn't published enough documentation about it yet.

On the occasion of the GTAIII's tenth anniversary, after a long period of darkness where we fell about the real SCM syntax, R* finally treated us by attaching part of its own original source code into the GTAIII Anniversary game, available for iOS and Android devices. As far back as 2001, a snip of some debugging scripts has been already provided with main.sc and debug.sc files. However, many secrets are unrevealed yet, thus some things cannot be documented fully and so they can be only guessed. The SCM format abbreviation is one of countless proofs of this inconvenience, which may stand for Script Multifile. Other doubts come with source files, whose SC extension appears to be very close to Mission SCript. At first, someone could have asked oneself how R* named its own programming language: R#? R-Sharp? Rockstar Sharp? Who knows. We simply call it SCM language due to the lack of information. Nevertheless, the SCR language name is cropping up gradually. However, it is definitely based on BASIC.


Preliminary remarks


This article makes use of formatted codes to improve the reading comprehension. Note that:

  • Square brackets mean everything inside may be omitted.
  • Curly brackets denote the presence of useful codes but not necessarily needed.
  • Vertical bars divide what can be chosen alternatively.

Fundamentals

Comments

A comment is an additional text that may be helpful for the code writer or other users, in short for the reader. It is the only part of the source code which gets always ignored when compiling.

Inline

An inline comment, denoted by // (two slashes), makes everything that follows some plain text:

[...] // Some inline comment

Multiline

A multiline comment embraces a particular area of the source code, starting by the opening tag /* (slash and asterisk) and ending with */ (asterisk and slash):

[...]
/*
 * Some multiline comment
 * ...
 */
[...]

Currently, more than one multiline comment is allowed per line:

[...] /* Some inline comment */ [...] /* Some inline comment */ [...]

Highlighters

Highlighters behaviour sounds trivial, that's to say they simply highlight one or more arguments per command within round brackets, individually or together. However, a comma can be used aswell to distinguish each argument. In GTA III, they appear to be used only for SETUP_ZONE_PED_INFO (in a various order) and GXT keys:

SETUP_ZONE_PED_INFO FISHFAC DAY (0) 0 0 0 (0 0 0 0) 0
PRINT_BIG (T4X4_1) 5000 2

Scopes

Scopes are delimited by curly brackets (or multiline brackets) which act like a local variable scopes. Essentially, they enclose the code where local variables are used, including timers. They can be opened and closed many times in a script:

{
    [...]
}
Limit
Scopes cannot be nested.

Labels

A label is a sequence of characters which identifiy a location of the source code useful for jumps. It can be accessed by any part of the source code. To define a label just append : (colon) to its name:

[...]

{lblname}:
[...]

At the compiling time, they are automatically converted into an offset.

Variables

A variable is a storage location assigned to a symbolic name which contains a value of any type.

Value

A value represents any data of any type it is.

Scope


The usage of a variable depends on the scope, that is the context where a specific variable is declared. At this point, we can distinguish the global and local scope.

Global

The global scope grasps the whole source code. Variables defined as globals are visible in any script. They are declared by appending the VAR prefix.

Local


The local scope wraps a localized part of the source code. Variables defined as locals are visible only in the code enclosed by curly brackets. You can put them everywhere and as many times as you want in the source code. They are declared by appending the LVAR prefix.

Timers

A timer is a special local variable whose value rises automatically. It starts incrementing since the beginning of the script where it has been placed and grows endlessly. There are 2 usable timers which are already defined as TIMERA and TIMERB, therefore they do not need to be declared.

Types


Among the available types, some are equivalent to the most known programming types. Their length is up to 4, 8 and 16 bytes. Each type is appended as a suffix in the variable declaration.

INT

The INT type handles 32-bit signed integers. It is also used to store values with less bytes, such as a bool, a char and a short int.

FLOAT

The FLOAT type handles 32-bit floating-points. As it normally does, decimal precision of a float is usually stuck to 6 digits beyond which it may get lost.

TEXT_LABEL

The TEXT_LABEL type handles 8-byte strings. Generally, a string is an array of 1-byte characters. It requires 7 characters plus the null-terminator (a blank byte meaning the end of the string). It is used to hold GXT keys (those of town zones, interiors, help textes or dialogue subtitles) script names or any short string.

Limit
TEXT_LABEL variables are supported in San Andreas and Vice City Stories.

STRING

The STRING type handles 16-byte strings. Like the previous, this type holds 15 characters plus the null-terminator. It is used to store model and texture names of player clothes, animation names or any long string. It may be a ghost type as later R* compilers might choose between the two string types automatically according to the length of the string itself.

Limit
STRING variables and values are supported in San Andreas.

OFFSET

The OFFSET type handles 16-byte strings. They can refer to either a label name or a file name.

Limit
OFFSET variables aren't available.

NUMBER (pseudo)

The NUMBER type handles 32-bit signed integers or 32-bit floating-points. It is used only to assign and compare numbers to INT or FLOAT variables. It is a pseudo type of INT or FLOAT.

CONSTANT (pseudo)

The CONSTANT type handles 32-bit signed integers. It is used only to assign and compare constants to INT variables regarding model identifiers, task statuses, ped events and such. It is a pseudo type of INT.

Limit
The assignment and comparison of CONSTANT values are supported since Vice City.

BUFFER

The BUFFER type handles 128-byte strings. It holds 127 characters plus the null-terminator. Strings of such type must be put in quotation marks:

SAVE_STRING_TO_DEBUG_FILE "128B TEXT"
Limits
BUFFER values are supported since San Andreas.
BUFFER variables aren't available.

VARLEN

The VARLEN type handles N-byte strings. It holds N characters plus the null-terminator. Strings of this type mustn't exceed 255 characters.

Limits
VARLEN values are supported since San Andreas.
VARLEN variables aren't available.

Declaration


Defining a variable means assigning a token string to a memory cell at the compiling time. Variables must be declared in the following manner:

{varscope}_{vartype} {varname0}[,] [... {varnameN}]

As mentioned in the sections above, local variables have to be put within curly brackets:

{
    {varscope}_{vartype} {varname0}[,] [... {varnameN}]

    [...]
}

Inline variable declaration is allowed, you just have to separate them by spaces or tabulations. Adding a preceding comma before these characters is optional.

Limit
Whereas the variable buffer is limited, you can declare a certain amount of globals and locals. INT and FLOAT) types take 1 variable, while TEXT_LABEL and STRING types occupy respectively 2 and 4 variables to store their data (have a look here for further details).

Arrays

A array is a collection of variables having the same type which can be accessed by an index, a 1-based integer lesser than or equal to the size specified, enclosed by square brackets:

{
    {varscope}_{vartype} {varname0}{[arrsize0]}[,] [... {varnameN}{[arrsizeN]}]

    [...]
}
Limits
The usage of arrays is allowed since Vice City.
Variable indices are quite buggy in Vice City and therefore unrecommended, but they are fully supported since San Andreas.

Handles

A handle is an univocal identifier assigned to a game entity. It is given by the following statement:

short nHandle = (iEntityIndexInPool << 8) | ucEntityFlag;

R* compiler won't let you assign different entity types to the same variable or using a variable which hasn't been assigned to any CREATE_* or ADD_* entity commands.

Operators

In general, an operator is a token string that represents a math calculation or an operation of any other kind, in order to make the code understanding clearer at a glance.

Arithmetic

Arithmetic operators compute some of the most common algebric calculations between either a variable and a value or two variables. As well as in some programming language happens, CONSTANT, TEXT_LABEL and STRING types are free from these operators, except for the basic assigment (see also Operators composition):

Operator Name Syntax Description
= Assignment expr0 = expr1 Store expr1 to expr0
+ Addition expr0 + expr1 Add expr1 to expr0
- Subtraction expr0 - expr1 Subtract expr1 from expr0
* Multiplication expr0 * expr1 Multiply expr0 by expr1
/ Division expr0 / expr1 Divide expr0 by expr1
+@ Timed addition expr0 +@ expr1 Multiply expr2 by delta time and add the result to expr1
-@ Timed subtraction expr0 -@ expr1 Multiply expr2 by delta time and subtract the result from expr1
++ Increment Pre[*] ++ expr0 Increment expr0 by 1 and store the result to expr0
Post expr0 ++
-- Decrement Pre[*] -- expr0 Decrement expr0 by 1 and store the result to expr0
Post expr0 --
Note
^ Pre and post increments have no difference unlike what you would expect.

Yet, you can put the assignment and algebric operators together inline as follows:

Operators Name Syntax Description
= + Addition and assignment expr0 = expr1[*] + expr2 Add expr2 to expr1 and store the result to expr0
= - Subtraction and assignment expr0 = expr1[*] - expr2 Subtract expr2 from expr1 and store the result to expr0
= * Multiplication and assignment expr0 = expr1[*] * expr2 Multiply expr1 by expr2 and store the result to expr0
= / Division and assignment expr0 = expr1[*] / expr2 Divide expr1 by expr2 and store the result to expr0
= +@ Timed addition and assignment expr0 = expr1[*] +@ expr2 Multiply expr2 by delta time, add the result to expr1 and store everything to expr0
= -@ Timed subtraction and assignment expr0 = expr1[*] -@ expr2 Multiply expr2 by delta time, subtract the result from expr1 and store everything to expr0
Note
^ expr1 can represent expr0 too.
Limit
Multiple algebric operators per line are not allowed.

Compound assignment

Compound assignment operators store values or variable content to other variables having a particular type afterwards the computation of an arithmetic operation, to squeeze the code and clear it up from granted repetitions:

Operator Name Syntax Description
+= Addition assignment expr0 += expr1 Add expr1 to expr0 and store the result to expr0
-= Subtraction assignment expr0 -= expr1 Subtract expr1 from expr0 and store the result to expr0
*= Multiplication assignment expr0 *= expr1 Multiply expr0 by expr1 and store the result to expr0
/= Division assignment expr0 /= expr1 Divide expr0 by expr1 and store the result to expr0
+=@ Timed addition assignment expr0 +=@ expr1 Multiply expr1 by delta time, add the result to expr0 and store everything to expr0
-=@ Timed subtraction assignment expr0 -=@ expr1 Multiply expr1 by delta time, subtract the result from expr0 and store everything to expr0

Uncompounded assignment

Uncompounded assignment operators are those on their own, or rather they are neither derivable nor decomposable similarly as those compounds:

Operator Name Syntax Description
=# Conversion assignment expr0 =# expr1 Convert expr1 to any other type and store the result to expr0
Limit
Supported conversions are FLOAT to INT and INT to FLOAT.

Logical

Logical operators influence the way conditions are evalueted and enable to test more of them at a time. More than anything, they are built-in statements:

Operators Name Syntax Description
NOT Logical negation IF NOT condition0 Test if condition0 is false
AND Logical conjunction IF condition0
AND condition8
Test if both condition0 and conditionN are true
OR Logical disjunction IF condition0
OR condition8
Test if either condition0 or conditionN is true

Comparison

Comparison operators test the truth or falsity of the relation between either a variable and a value, a value and a variable or two variables:

Operator Name Syntax Description
= Equal to IF expr0 = expr1 Test if expr0 and expr1 are equal
> Greater than IF expr0 > expr1 Test if expr0 is greater than expr1
< Lesser than IF expr0 < expr1 Test if expr0 is lesser than expr1
>= Greater than or equal to IF expr0 >= expr1 Test if expr0 is greater than or equal to expr1
<= Lesser than or equal to IF expr0 <= expr1 Test if expr0 is lesser than or equal to expr1

Theorically, STRING values should be compared with the first operator only, but the presence of COMPARE_STRING increase the doubts concerning the existence of such operator for this type.

Commands

A command is a symbolic name associated to an opcode which executes a portion of code that specifies the operation to be performed by passing zero or more arguments. Opcodes do not return values that can be assigned to a variable, even though the boolean flag is kept whenever they are used as conditions. It follows the common programming syntax adopted for procedure or function calls:

{commandname} [{anyvalue0|varname0} ... {anyvalueN|varnameN}]

Built-in

Built-in commands are those which are associated to more opcodes that differ each other by argument types or actions:

  • GTA III Vice City San Andreas Liberty City Stories Vice City Stories:
    • OPERATORS
    • ABS
  • San Andreas:
    • IS_TEXT_LABEL_NULL
    • IS_STRING_NULL
    • IS_BIT_SET
    • SET_BIT
    • CLEAR_BIT
    • COMPARE_STRING
  • Liberty City Stories Vice City Stories:
    • CALL

This section is incomplete. You can help by fixing and expanding it.

WAIT

WAIT skips the execution of a script according to some milliseconds after which it will resume again. Indeed, it is absolutely necessary into infinite loops or those that break after more than one frame, such as the WHILE statement. In this case, a INT equal to 0 is passed.

GOTO

GOTO jumps to the label of any location of the source code. It is also used internally to build other statements or singularly but then it mustn't point off the current context:

// File: any.sc

jump0:
GOTO jumpN
// File: any.sc

jumpN:
GOTO jump0

ANDOR

ANDOR set out the way the comparison among more conditions have to occur (see also Comparing rule).

GOTO_IF_TRUE

GOTO_IF_TRUE operates in conjunction with ANDOR and jumps to a label if the returned boolean flag is true.

GOTO_IF_FALSE

Unlike GOTO_IF_TRUE, GOTO_IF_FALSE jumps to the disired label only if the comparison returns false.

SAVE_STRING_TO_DEBUG_FILE

SAVE_STRING_TO_DEBUG_FILE accepts an argument which can admit up to 127 characters plus the null-terminator. In the compiling process, the argument is skipped but its string is copied to a predefined 128-bytes buffer, compiled afterwards. These are the predetermined bytes that seem to do nothing:

00 00 41 00 09 2E 00 00 00 00 00 00 00 00 00 00 
09 2E 00 00 00 00 00 00 1C FB 12 00 D8 A8 41 00
00 00 41 00 09 2E 00 00 00 00 00 00 01 00 00 00 
09 2E 00 00 00 00 00 00 1C FB 12 00 D8 A8 41 00
00 00 41 00 09 2E 00 00 00 00 00 00 02 00 00 00 
09 2E 00 00 00 00 00 00 1C FB 12 00 D8 A8 41 00
00 00 41 00 09 2E 00 00 00 00 00 00 03 00 00 00 
09 2E 00 00 00 00 00 00 1C FB 12 00 D8 A8 41 00

Dynamic values within a block are marked in grey, while those which differs among each block are coloured in blue. Possibly rubbish data.

Constants

A constant is a symbolic name associated to a specific value. When compiling, their caption is converted in the assigned value. In GTA III and Vice City, they are hardcoded as everything inside the compiler. Since Vice City, names and identifiers of objects within OBJS and TOBJ blocks are loaded from every IDE file defined into gta_vc.dat, then those of vehicles and pedestrians within PEDS and CARS blocks are retrieved from default.ide. In San Andreas, they are listed into TXT files, whose name follows the Pascal Case (eg. AudioEvents.txt). These files respect the syntax below:

{constname0} {constvalue0}

{constnameN} {constvalueN}

Constant names and values are divided by as many spaces or tabulations as you want. Constant lines are distinguished by two \n (new line) characters. The model names which aren't assigned to a constant are still valid (see also Identifiers). Keep in mind arguments of some commands having the CONSTANT type accept only constant values of a single namespace.

Formatting

Everything is case-insensitive, that means the uppercase and lowercase letters are computed as the same character. Usually, the source code is formatted as shown in this table:

Uppercase Lowercase
Label X
Declaration X
Variable X
Command X
Constant X
Statement X

Compiling

Structure

The source code is split up into several SC files which comprehend main file, foreign gosubs, subscripts, mission scripts, and triggers.

Main file


The main file is the most significant part of the whole source. It can include many script files and/or embedded gosubs, scripts or functions. Originally, it is characterized by the absence of the local scope. It must be put outside the directory, having the same name as the main script file, where all other foreign scripts must be. R* compiler will search into subfolders too:

<directory>
| main
|  | gosub
|  |  |- gosub1.sc
|  |  \- gosubN.sc
|  | subscript
|  |  |- subscript1.sc
|  |  \- subscriptN.sc
|  | mission_guy
|  |  |- mission_guy1.sc
|  |  \- mission_guyN.sc
|  |- gosub.sc
|  |- subscript.sc
|  \- mission.sc
\- main.sc

Foreign gosubs


Foreign gosubs (also called subroutines) are main extension files. They are called using the GOSUB_FILE command which jumps to a specific label and executes some code that returns back to the place where it has been called with RETURN. You are able to specify the gosub label to start jumping at aswell:

// File: main.sc

GOSUB_FILE gosub0 gosub.sc
// File: gosub.sc

gosub0:
{
    [...]
}
RETURN
Limit
Foreign gosubs were introduced since GTA III. They were unused in Vice City and got removed in San Andreas, but then they were reimplemented in Liberty City Stories and Vice City Stories.

Gosubs

As mentioned, gosubs are also embedded in any script file. They follow almost the same rules, except they are called by GOSUB and can actually inehrit the local scope of the parent script:

// File: any.sc

GOSUB gosub0
// File: any.sc

gosub0:
{
    [...]
}
RETURN
Note
R* compiler doesn't take care if the code within a scope jumps to a gosub inside which another scope is declared. It is strongly recommended to pay attention at this issue or you will fall down into an irreparable local variable mismatch.

Subscripts


Subscripts are code blocks which take part of a queue of other scripts. They are denoted by the presence of MISSION_START at the very top of the mission file. As long as they aren't ended with MISSION_END, their execution never expires till the end of the game process. Each one works independently, even though they are able to share global variables:

// File: main.sc

LAUNCH_MISSION subscript.sc
// File: subscript.sc

MISSION_START

[VAR_{vartype} {varname0}[,] [... {varnameN}]]

SCRIPT_NAME main

subscript_loop:
{
    [LVAR_{vartype} {varname0}[,] [... {varnameN}]]

    [...]
}
//GOTO subscript_loop
MISSION_END
Note
MISSION_START is a special and fake directive that isn't assigned to any command.

Scripts

As for gosubs, scripts can be embedded everywhere in a script file. They are started by START_NEW_SCRIPT which has an undefined amount of arguments, whose type must match with those of each local variable of the starting script in order to be passed, else the compilation will interrupt. Unlike subscripts, they get terminated by TERMINATE_THIS_SCRIPT or TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME (elsewhere in another script):

// File: any.sc

START_NEW_SCRIPT script [{anyvalue0|varname0} ... {anyvalueN|varnameN}]
// File: any.sc

script:
{
    SCRIPT_NAME script

script_loop:

    [LVAR_{vartype} {varname0}[,] [... {varnameN}]]

    [...]

    //GOTO script_loop
    TERMINATE_THIS_SCRIPT
}
Notes
Scripts must have a local scope.
Script commands must be inserted within or after the local scope.
Since Vice City, the opening curly bracket must be put before the script label when more arguments are passed.

Functions

This section is incomplete. You can help by fixing and expanding it.

Mission scripts


Mission scripts are subscripts which take part of the mission block, which is basically a subscript started once. When they are launched with LOAD_AND_LAUNCH_MISSION, the pointer is moved to the corresponding mission offset located somewhere in the mission block. Do not forget to begin a mission with MISSION_START and end it with MISSION_END:

// File: main.sc

LOAD_AND_LAUNCH_MISSION mission.sc
// File: mission.sc

MISSION_START

GOSUB mission_start

IF HAS_DEATHARREST_BEEN_EXECUTED
    GOSUB mission_failed
ENDIF

GOSUB mission_cleanup

MISSION_END

[VAR_{vartype} {varname0}[,] [... {varnameN}]]

mission_start:

REGISTER_MISSION_GIVEN
SCRIPT_NAME mission

// Variables initialization

{
    [LVAR_{vartype} {varname0}[,] [... {varnameN}]]

    [...]
}
GOTO mission_passed

mission_failed:
[...]
RETURN

mission_passed:
REGISTER_MISSION_PASSED mission
//PLAYER_MADE_PROGRESS 1
[...]
RETURN

mission_cleanup:
// Mark everything as no longer needed
[...]
RETURN

Triggers


This section is incomplete. You can help by fixing and expanding it.

Statements

As usual, the evolution of something implies its development over the years. Alongside, the statements implementation has been distributed equally into every chapter. Their definitions are similar to those used in pseudocodes resulting in a raw source code. However, you are still able to build your own control flows:

ANDOR {value}
  [NOT] {condition0}
  [[NOT] {condition8}]
GOTO_IF_FALSE ELSE
    {consequence}
    [GOTO ENDIF]
ELSE:
    [{alternative}
ENDIF:]

IF

IF is one of the most widespread conditional statements which executes some codes by evaluating a boolean flag, the returning value of one or more conditions. According to the returning value, either the consequence or the alternative will be performed. The condition result can be inverted by appending the NOT logical operator before. More conditions require the use of the remaining logical operators, they are AND, when verifying if all checks are true, and OR, while testing if one of all checks is true. The syntax below summarize the whole explanation:

IF [NOT] {condition0}
[AND|OR [NOT] {condition8}]
    {consequence}
[ELSE
    {alternative}]
ENDIF
Limit
More than 9 conditions per statement are't allowed.

IFNOT

IFNOT is a variation of the IF statement as already stated. As opposed to its closest relative, the conditions evaluetion is reversed, that is the consequence is perfomed when the boolean flag is false, else the alternative is executed:

IFNOT [NOT] {condition0}
[AND|OR [NOT] {condition8}]
    {consequence}
[ELSE
    {alternative}]
ENDIF
Limit
It is supported since Liberty City Stories.

WHILE

Alike the IF construct, WHILE is a conditional statement. The only difference consists in how it performs the consequence, that is it loops every line of code built into if the boolean flag is true:

WHILE [NOT] {condition0}
[AND|OR [NOT] {condition8}]
    {consequence}
ENDWHILE

WHILENOT

WHILENOT acts seemingly like the WHILE statement, as all condition truths are inverted and therefore the consequence is performed over and over again until the boolean flag becomes true:

WHILENOT [NOT] {condition0}
[AND|OR [NOT] {condition8}]
    {consequence}
ENDWHILE
Limit
It is supported since Liberty City Stories.

REPEAT

Similar to the WHILE construct, REPEAT iterates the consequence repeatedly depending on a 0-value incremental variable which rises till the times specified:

REPEAT {times} {varname}
    {consequence}
ENDREPEAT
Limits
It is supported since Vice City.
The times must be positive.
The code will be read at least once in any case.

CASE

Basically, CASE is a group of concatenated IF statements. When a condition is false the next case gets performed, otherwise the consequence is executed and the code jumps to the end of the construct. If none of the cases is true, an ELSE clause may be carried out:

CASE {varname}
    WHEN {value0}
        {consequence}
    [WHEN {valueN}
        {consequence}]
    [ELSE
        {alternative}]
ENDCASE
Limits
It is supported since San Andreas.
The WHEN clause allows the use of integer values only.
In San Andreas, values must be sorted.
Multiple cases per consequence aren't allowed.

Decompiling

Structure

For further information about the SCM file format, read this article. Take into account the compiling order of each SC file is main file - foreign gosubs - subscripts - mission scripts apart from the reading order of the commands used to include them. triggers are compiled individually into the script.img file. On the other hand, functions are compiled like gosubs.

Identifiers

Undefined constants of model identifiers, whose name refers to a DFF which is presumably archived into any of the IMGs, loaded by the game, are overwritten by a decrementing value in the order they get compiled. These model names are then put into the second segment of the SCM header. Those of mission scripts and triggers respect the same rule except the fact they are turned into a 0-based growing identifier.

Offsets

An offset is a 32-bit signed integer which points to a location of the source code. Those within the main file, foreign gosubs and subscripts are absolute offsets that start from the beginning of the main script, while the ones inside mission scripts and triggers are relative offsets starting from their beginning. The offset is related to global variables aswell, whose interval goes from 8 and ends to FFFC, each one is aligned to the nearest 4 bytes.

Variables

The following table shows the variables range of the local scope for each game version:

Context GTA III Vice City San Andreas Liberty City Stories Vice City Stories
Foreign gosub/Gosub 0-15 0-15 n/a 0-95 0-95
Subscript/Script 0-15 0-15 0-31 0-95 0-95
Mission script[*] 0-15 0-15 0-1023 0-95 0-95
Trigger n/a n/a 0-31 n/a n/a
Function n/a n/a n/a 0-95 0-95
Timer 16-17 16-17 32-33 10-11? 254-255
Note
^ Although the mission block is allocated as an unique subscript, locals point to the same storage location, therefore they are some kind of globals for missions uniquely.

Operators composition

As far as you wouldn't know, SCM's operators always take two operands to compute an operation. Their composition is listed below:

Operator/s Name Syntax Composition
++ Increment Pre ++ expr0 expr0 += 1
Post expr0 ++
-- Decrement Pre -- expr0 expr0 -= 1
Post expr0 --
= + Addition and assignment expr0 = expr1 + expr2 expr0 = expr1
expr0 += expr2
= - Subtraction and assignment expr0 = expr1 - expr2 expr0 = expr1
expr0 -= expr2
= * Multiplication and assignment expr0 = expr1 * expr2 expr0 = expr1
expr0 *= expr2
= / Division and assignment expr0 = expr1 / expr2 expr0 = expr1
expr0 /= expr2
= +@ Timed addition and assignment expr0 = expr1 +@ expr2 expr0 = expr1
expr0 +=@ expr2
= -@ Timed subtraction and assignment expr0 = expr1 -@ expr2 expr0 = expr1
expr0 -=@ expr2

Opcodes

An opcode is a 16-bit unsigned integer referring to a portion of code the game executes when it is called by passing an undefined or absent amount of arguments. The maximum number of available opcodes is 0x7FFF, since the last bit (0x8000) is set whenever they are used as negative conditions (those with the NOT logical operator).

Arguments

An argument is some data given as input to an opcode. Normally, opcodes have a defined amount of arguments up to 32. Those not, such as START_NEW_SCRIPT, can pass as many arguments as the available local variables are, except timers. This limitation is game specific.

Internal

Here is the list of all commands handled arbitrarily by the R* compiler:

Legend:

List:

Command Opcode Args
count
Arguments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ... 19
GTA III Vice City San Andreas Liberty City Stories Vice City Stories
MISSION_START[*] 0
GOTO[*] 0002 1 VO
GTA III Vice City San Andreas Liberty City Stories
= SET_VAR_INT 0004 2 GI VI
SET_VAR_FLOAT 0005 GF VF
SET_LVAR_INT 0006 LI VI
SET_LVAR_FLOAT 0007 LF VF
+= ADD_VAL_TO_INT_VAR 0008 2 GI VI
ADD_VAL_TO_FLOAT_VAR 0009 GF VF
ADD_VAL_TO_INT_LVAR 000A LI VI
ADD_VAL_TO_FLOAT_LVAR 000B LF VF
-= SUB_VAL_FROM_INT_VAR 000C 2 GI VI
SUB_VAL_FROM_FLOAT_VAR 000D GF VF
SUB_VAL_FROM_INT_LVAR 000E LI VI
SUB_VAL_FROM_FLOAT_LVAR 000F LF VF
*= MULT_INT_VAR_BY_VAL 0010 2 GI VI
MULT_FLOAT_VAR_BY_VAL 0011 GF VF
MULT_INT_LVAR_BY_VAL 0012 LI VI
MULT_FLOAT_LVAR_BY_VAL 0013 LF VF
/= DIV_INT_ANY_BY_VAL 0014 2 GI VI
DIV_FLOAT_VAR_BY_VAL 0015 GF VF
DIV_INT_LVAR_BY_VAL 0016 LI VI
DIV_FLOAT_LVAR_BY_VAL 0017 LF VF
> IS_INT_VAR_GREATER_THAN_NUMBER 0018 2 GI VN
IS_INT_LVAR_GREATER_THAN_NUMBER 0019 LI VN
IS_NUMBER_GREATER_THAN_INT_VAR 001A VN GI
IS_NUMBER_GREATER_THAN_INT_LVAR 001B VN LI
IS_INT_VAR_GREATER_THAN_INT_VAR 001C GI GI
IS_INT_LVAR_GREATER_THAN_INT_LVAR 001D LI LI
IS_INT_VAR_GREATER_THAN_INT_LVAR 001E GI LI
IS_INT_LVAR_GREATER_THAN_INT_VAR 001F LI GI
IS_FLOAT_VAR_GREATER_THAN_NUMBER 0020 GF VN
IS_FLOAT_LVAR_GREATER_THAN_NUMBER 0021 LF VN
IS_NUMBER_GREATER_THAN_FLOAT_VAR 0022 VN GF
IS_NUMBER_GREATER_THAN_FLOAT_LVAR 0023 VN LF
IS_FLOAT_VAR_GREATER_THAN_FLOAT_VAR 0024 GF GF
IS_FLOAT_LVAR_GREATER_THAN_FLOAT_LVAR 0025 LF LF
IS_FLOAT_VAR_GREATER_THAN_FLOAT_LVAR 0026 GF LF
IS_FLOAT_LVAR_GREATER_THAN_FLOAT_VAR 0027 LF GF
>= IS_INT_VAR_GREATER_OR_EQUAL_TO_NUMBER 0028 2 GI VN
IS_INT_LVAR_GREATER_OR_EQUAL_TO_NUMBER 0029 LI VN
IS_NUMBER_GREATER_OR_EQUAL_TO_INT_VAR 002A VN GI
IS_NUMBER_GREATER_OR_EQUAL_TO_INT_LVAR 002B VN LI
IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_VAR 002C GI GI
IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_LVAR 002D LI LI
IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_LVAR 002E GI LI
IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_VAR 002F LI GI
IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_NUMBER 0030 GF VN
IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_NUMBER 0031 LF VN
IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_VAR 0032 VN GF
IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_LVAR 0033 VN LF
IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_VAR 0034 GF GF
IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR 0035 LF LF
IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR 0036 GF LF
IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_VAR 0037 LF GF
= IS_INT_VAR_EQUAL_TO_NUMBER 0038 2 GI VN
IS_INT_LVAR_EQUAL_TO_NUMBER 0039 LI VN
IS_INT_VAR_EQUAL_TO_INT_VAR 003A GI GI
IS_INT_LVAR_EQUAL_TO_INT_LVAR 003B LI LI
IS_INT_VAR_EQUAL_TO_INT_LVAR 003C GI LI
IS_FLOAT_VAR_EQUAL_TO_NUMBER 0042 GF VN
IS_FLOAT_LVAR_EQUAL_TO_NUMBER 0043 LF VN
IS_FLOAT_VAR_EQUAL_TO_FLOAT_VAR 0044 GF GF
IS_FLOAT_LVAR_EQUAL_TO_FLOAT_LVAR 0045 LF LF
IS_FLOAT_VAR_EQUAL_TO_FLOAT_LVAR 0046 GF LF
GOTO_IF_FALSE[*] 004D 1 VO
TERMINATE_THIS_SCRIPT 004E 0
MISSION_END
START_NEW_SCRIPT[*] 004F 1 VO _ _ _
GOSUB 0050 1 VO
RETURN 0051 0
+= ADD_INT_VAR_TO_INT_VAR 0058 2 GI GI
ADD_FLOAT_VAR_TO_FLOAT_VAR 0059 GF GF
ADD_INT_LVAR_TO_INT_LVAR 005A LI LI
ADD_FLOAT_LVAR_TO_FLOAT_LVAR 005B LF LF
ADD_INT_VAR_TO_INT_LVAR 005C LI GI
ADD_FLOAT_VAR_TO_FLOAT_LVAR 005D LF GF
ADD_INT_LVAR_TO_INT_VAR 005E GI LI
ADD_FLOAT_LVAR_TO_FLOAT_VAR 005F GF LF
-= SUB_INT_VAR_FROM_INT_VAR 2 GI GI
SUB_FLOAT_VAR_FROM_FLOAT_VAR 0061 GF GF
SUB_INT_LVAR_FROM_INT_LVAR 0062 LI LI
SUB_FLOAT_LVAR_FROM_FLOAT_LVAR 0063 LF LF
SUB_INT_VAR_FROM_INT_LVAR 0064 LI GI
SUB_FLOAT_VAR_FROM_FLOAT_LVAR 0065 LF GF
SUB_INT_LVAR_FROM_INT_VAR 0066 GI LI
SUB_FLOAT_LVAR_FROM_FLOAT_VAR 0067 GF LF
*= MULT_INT_VAR_BY_INT_VAR 0068 2 GI GI
MULT_FLOAT_VAR_BY_FLOAT_VAR 0069 GF GF
MULT_INT_LVAR_BY_INT_LVAR 006A LI LI
MULT_FLOAT_LVAR_BY_FLOAT_LVAR 006B LF LF
MULT_INT_VAR_BY_INT_LVAR 006C GI LI
MULT_FLOAT_VAR_BY_FLOAT_LVAR 006D GF LF
MULT_INT_LVAR_BY_INT_VAR 006E LI GI
MULT_FLOAT_LVAR_BY_FLOAT_VAR 006F LF GF
/= DIV_INT_VAR_BY_INT_VAR 0070 2 GI GI
DIV_FLOAT_VAR_BY_FLOAT_VAR 0071 GF GF
DIV_INT_LVAR_BY_INT_LVAR 0072 LI LI
DIV_FLOAT_LVAR_BY_FLOAT_LVAR 0073 LF LF
DIV_INT_VAR_BY_INT_LVAR 0074 GI LI
DIV_FLOAT_VAR_BY_FLOAT_LVAR 0075 GF LF
DIV_INT_LVAR_BY_INT_VAR 0076 LI GI
DIV_FLOAT_LVAR_BY_FLOAT_VAR 0077 LF GF
+=@ ADD_TIMED_VAL_TO_FLOAT_VAR 0078 2 GF FV
ADD_TIMED_VAL_TO_FLOAT_LVAR 0079 LF FV
ADD_TIMED_FLOAT_VAR_TO_FLOAT_VAR 007A GF GF
ADD_TIMED_FLOAT_LVAR_TO_FLOAT_LVAR 007B LF LF
ADD_TIMED_FLOAT_LVAR_TO_FLOAT_VAR 007C LF GF
ADD_TIMED_FLOAT_VAR_TO_FLOAT_LVAR 007D GF LF
-=@ SUB_TIMED_VAL_FROM_FLOAT_VAR 007E 2 GF FV
SUB_TIMED_VAL_FROM_FLOAT_LVAR 007F LF FV
SUB_TIMED_FLOAT_VAR_FROM_FLOAT_VAR 0080 GF GF
SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_LVAR 0081 LF LF
SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_VAR 0082 LF GF
SUB_TIMED_FLOAT_VAR_FROM_FLOAT_LVAR 0083 GF LF
= SET_VAR_INT_TO_VAR_INT 2 GI GI
SET_LVAR_INT_TO_LVAR_INT 0085 LI LI
SET_VAR_FLOAT_TO_VAR_FLOAT 0086 GF GF
SET_LVAR_FLOAT_TO_LVAR_FLOAT 0087 LF LF
SET_VAR_FLOAT_TO_LVAR_FLOAT 0088 GF LF
SET_LVAR_FLOAT_TO_VAR_FLOAT 0089 LF GF
SET_VAR_INT_TO_LVAR_INT 008A GI LI
SET_LVAR_INT_TO_VAR_INT 008B LI GI
=# CSET_VAR_INT_TO_VAR_FLOAT 2 GI GF
CSET_VAR_FLOAT_TO_VAR_INT 008D GF GI
CSET_LVAR_INT_TO_VAR_FLOAT 008E LI GF
CSET_LVAR_FLOAT_TO_VAR_INT 008F LF GI
CSET_VAR_INT_TO_LVAR_FLOAT 0090 GI LF
CSET_VAR_FLOAT_TO_LVAR_INT 0091 GF LI
CSET_LVAR_INT_TO_LVAR_FLOAT 0092 LI LF
CSET_LVAR_FLOAT_TO_LVAR_INT 0093 LF LI
ABS ABS_VAR_INT 0094 1 GI
ABS_LVAR_INT 0095 LI
ABS_VAR_FLOAT 0096 GF
ABS_LVAR_FLOAT 0097 LF
ANDOR[*] 00D6 1 VI
LAUNCH_MISSION 00D7 1 VO
GTA III Vice City San Andreas
LOAD_AND_LAUNCH_MISSION 0417 1 VO
GTA III Vice City
GOSUB_FILE 02CD 2 VO VO
Vice City San Andreas
= IS_INT_VAR_EQUAL_TO_CONSTANT 04A3 2 GC VC
IS_INT_LVAR_EQUAL_TO_CONSTANT 04A4 LC VC
SET_VAR_INT_TO_CONSTANT 04AE GC VC
SET_LVAR_INT_TO_CONSTANT 04AF LC VC
> IS_INT_VAR_GREATER_THAN_CONSTANT 04B0 2 GC VC
IS_INT_LVAR_GREATER_THAN_CONSTANT 04B1 LC VC
IS_CONSTANT_GREATER_THAN_INT_VAR 04B2 VC GC
IS_CONSTANT_GREATER_THAN_INT_LVAR 04B3 VC LC
>= IS_INT_VAR_GREATER_OR_EQUAL_TO_CONSTANT 04B4 2 GC VC
IS_INT_LVAR_GREATER_OR_EQUAL_TO_CONSTANT 04B5 LC VC
IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR 04B6 VC GV
IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_LVAR 04B7 VC LC
San Andreas
= SET_ANY_TEXT_LABEL_TO_VAR_TEXT_LABEL[*] 05A9 2 GT VT
GT GT
GT LT
SET_ANY_TEXT_LABEL_TO_LVAR_TEXT_LABEL[*] 05AA LT VT
LT GT
LT LT
IS_TEXT_LABEL_VAR_EQUAL_TO_TEXT_LABEL_ANY[*] 05AD GT VT
GT GT
GT LT
IS_TEXT_LABEL_LVAR_EQUAL_TO_TEXT_LABEL_ANY[*] 05AE LT VT
LT GT
LT LT
SET_ANY_STRING_TO_VAR_STRING[*] 06D1 GS VS
GS GS
GS LS
SET_ANY_STRING_TO_LVAR_STRING[*] 06D2 LS VS
LS GS
LS LS
IS_INT_LVAR_EQUAL_TO_INT_VAR 07D6 LI GI
IS_FLOAT_LVAR_EQUAL_TO_FLOAT_VAR 07D7 LF GF
IS_TEXT_LABEL_NULL IS_TEXT_LABEL_NULL_VAR_TEXT_LABEL[*] 0844 1 GT
IS_TEXT_LABEL_NULL_LVAR_TEXT_LABEL[*] 0845 LT
IS_STRING_NULL IS_STRING_NULL_VAR_STRING[*] 0846 1 GS
IS_STRING_NULL_LVAR_STRING[*] 0847 LS
INIT_TABLE_OF_GOTO[*][*] 0871 18 GI VI VI VO VI VO VI VO VI V0 VI VO VI VO VI VO VI VO
LI VI VI VO VI VO VI VO VI VO VI VO VI VO VI VO VI VO
APPEND_GOTO_TO_TABLE[*][*] 0872 18 VI VO VI VO VI VO VI VO VI VO VI VO VI VO VI VO VI VO
IS_BIT_SET IS_BIT_SET_VAR_INT_NUMBER[*] 08B4 2 GI VN
IS_BIT_SET_VAR_INT_VAR_INT[*] 08B5 GI GI
IS_BIT_SET_VAR_INT_LVAR_INT[*] 08B6 GI LI
IS_BIT_SET_LVAR_INT_NUMBER[*] 08B7 LI VN
IS_BIT_SET_LVAR_INT_VAR_INT[*] 08B8 LI GI
IS_BIT_SET_LVAR_INT_LVAR_INT[*] 08B9 LI LI
SET_BIT_SET SET_BIT_VAR_INT_NUMBER[*] 08BA 2 GI VN
SET_BIT_VAR_INT_VAR_INT[*] 08BB GI GI
SET_BIT_VAR_INT_LVAR_INT[*] 08BC GI LI
SET_BIT_LVAR_INT_NUMBER[*] 08BD LI VN
SET_BIT_LVAR_INT_VAR_INT[*] 08BE LI GI
SET_BIT_LVAR_INT_LVAR_INT[*] 08BF LI LI
CLEAR_BIT_SET CLEAR_BIT_VAR_INT_NUMBER[*] 08C0 2 GI VN
CLEAR_BIT_VAR_INT_VAR_INT[*] 08C1 GI GI
CLEAR_BIT_VAR_INT_LVAR_INT[*] 08C2 GI LI
CLEAR_BIT_LVAR_INT_NUMBER[*] 08C3 LI VN
CLEAR_BIT_LVAR_INT_VAR_INT[*] 08C4 LI GI
CLEAR_BIT_LVAR_INT_LVAR_INT[*] 08C5 LI LI
=
COMPARE_STRING[*]
IS_STRING_VAR_EQUAL_TO_STRING_ANY[*]
COMPARE_STRING_VAR_STRING_ANY_STRING[*]
08F9 2 GS VS
GS GS
GS LS
IS_STRING_LVAR_EQUAL_TO_STRING_ANY[*]
COMPARE_STRING_LVAR_STRING_ANY_STRING[*]
08FA LS VS
LS GS
LS LS
Liberty City Stories
GOTO_IF_TRUE[*] 004C 1 VI
RETURN_TRUE 00C5 0
RETURN_FALSE 00C6 0
ANDOR[*] 00DB 1 VI
LAUNCH_MISSION 00DC 1 VO
GOSUB_FILE 02D2 2 VO VO
LOAD_AND_LAUNCH_MISSION 041C 1 VO
= IS_INT_VAR_EQUAL_TO_CONSTANT 04A8 2 GC VC
IS_INT_LVAR_EQUAL_TO_CONSTANT 04A9 LC VC
SET_VAR_INT_TO_CONSTANT 04B3 GC VC
SET_LVAR_INT_TO_CONSTANT 04B4 LC VC
> IS_INT_VAR_GREATER_THAN_CONSTANT 04B5 2 GC VC
IS_INT_LVAR_GREATER_THAN_CONSTANT 04B6 LC VC
IS_CONSTANT_GREATER_THAN_INT_VAR 04B7 VC GC
IS_CONSTANT_GREATER_THAN_INT_LVAR 04B8 VC LC
>= IS_INT_VAR_GREATER_OR_EQUAL_TO_CONSTANT 04B9 2 GC VC
IS_INT_LVAR_GREATER_OR_EQUAL_TO_CONSTANT 04BA LC VC
IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR 04BB VC GV
IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_LVAR 04BC VC LC
CALL[*][*] CALL_05AE 05AE 1 VO _ _ _
CALL_05AF 05AF
Vice City Stories
= SET_ANY_INT 0004 2 GI VI
LI VI
SET_ANY_FLOAT 0005 GF VF
LF VF
SET_ANY_TEXT_LABEL 0006 GT VT
LT VT
+= ADD_VAL_TO_INT_ANY 0007 2 GI VI
LI VI
ADD_VAL_TO_FLOAT_ANY 0008 GF VF
LF VF
-= SUB_VAL_FROM_INT_ANY 0009 2 GI VI
LI VI
SUB_VAL_FROM_FLOAT_ANY 000A GF VF
LF VF
*= MULT_INT_ANY_BY_VAL 000B 2 GI VI
LI VI
MULT_FLOAT_ANY_BY_VAL 000C GF VF
LF VF
/= DIV_INT_ANY_BY_VAL 000D 2 GI VI
LI VI
DIV_FLOAT_ANY_BY_VAL 000E GF VF
LF VF
> IS_INT_ANY_GREATER_THAN_NUMBER 000F 2 GI VN
LI VN
IS_NUMBER_GREATER_THAN_INT_ANY 0010 VN GI
VN LI
IS_INT_ANY_GREATER_THAN_INT_ANY 0011 GI GI
GI LI
LI GI
LI LI
IS_FLOAT_ANY_GREATER_THAN_NUMBER 0012 GF VN
LF VN
IS_NUMBER_GREATER_THAN_FLOAT_ANY 0013 VN GF
VN LF
IS_FLOAT_ANY_GREATER_THAN_FLOAT_ANY 0014 GF GF
GF LF
LF GF
LF LF
>= IS_INT_ANY_GREATER_OR_EQUAL_TO_NUMBER 0015 2 GI VN
LI VN
IS_NUMBER_GREATER_OR_EQUAL_TO_INT_ANY 0016 VN GI
VN LI
IS_INT_ANY_GREATER_OR_EQUAL_TO_INT_ANY 0017 GI GI
GI LI
LI GI
LI LI
IS_FLOAT_ANY_GREATER_OR_EQUAL_TO_NUMBER 0018 GF VN
LF VN
IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_ANY 0019 VN GF
VN LF
IS_FLOAT_ANY_GREATER_OR_EQUAL_TO_FLOAT_ANY 001A GF GF
GF LF
LF GF
LF LF
= IS_INT_ANY_EQUAL_TO_NUMBER 001B 2 GI VN
LI VN
IS_INT_ANY_EQUAL_TO_INT_ANY 001C GI GI
GI LI
LI GI
LI LI
IS_FLOAT_ANY_EQUAL_TO_NUMBER 001D GF VN
LF VN
IS_FLOAT_ANY_EQUAL_TO_FLOAT_ANY 001E GF GF
GF LF
LF GF
LF LF
= IS_TEXT_LABEL_ANY_EQUAL_TO_TEXT_LABEL 001F 2 GT VT
LT VT
IS_ANY_TEXT_LABEL_EQUAL_TO_TEXT_LABEL_ANY 0020 GT GT
GT LT
LT GT
LT LT
GOTO_IF_TRUE[*] 0021 1 VO
GOTO_IF_FALSE[*] 0022 1 VO
TERMINATE_THIS_SCRIPT 0023 0
MISSION_END
START_NEW_SCRIPT[*] 0024 1 VO _ _ _
GOSUB 0025 1 VO
RETURN 0026 0
+= ADD_INT_ANY_TO_INT_ANY 0029 2 GI GI
GI LI
LI GI
LI LI
ADD_FLOAT_ANY_FLOAT_ANY 002A GF GF
GF LF
LF GF
LF LF
-= SUB_INT_ANY_FROM_INT_ANY 002B 2 GI GI
GI LI
LI GI
LI LI
SUB_FLOAT_ANY_FROM_FLOAT_ANY 002C GF GF
GF LF
LF GF
LF LF
*= MULT_INT_ANY_BY_INT_ANY 002D 2 GI GI
GI LI
LI GI
LI LI
MULT_FLOAT_ANY_BY_FLOAT_ANY 002E GF GF
GF LF
LF GF
LF LF
/= DIV_INT_ANY_BY_INT_ANY 002F 2 GI GI
GI LI
LI GI
LI LI
DIV_FLOAT_ANY_BY_FLOAT_ANY 0030 GF GF
GF LF
LF GF
LF LF
+=@ ADD_TIMED_VAL_TO_FLOAT_ANY 0031 2 GF VF
LF VF
ADD_TIMED_FLOAT_ANY_TO_FLOAT_ANY 0032 GF GF
GF LF
LF GF
LF LF
-=@ SUB_TIMED_VAL_FROM_FLOAT_ANY 0033 2 GF VF
LF VF
SUB_TIMED_FLOAT_ANY_FROM_FLOAT_ANY 0034 GF GF
GF LF
LF GF
LF LF
= SET_ANY_INT_TO_ANY_INT 0035 2 GI GI
GI LI
LI GI
LI LI
SET_ANY_FLOAT_TO_ANY_FLOAT 0036 GF GF
GF LF
LF GF
LF LF
SET_ANY_TEXT_LABEL_TO_ANY_TEXT_LABEL 0037 GT GT
GT LT
LT GT
LT LT
=# CSET_ANY_INT_TO_ANY_FLOAT 0038 2 GI GF
GI LF
LI GF
LI LF
CSET_ANY_FLOAT_TO_ANY_INT 0039 GF GI
GF LI
LF GI
LF LI
ABS ABS_ANY_INT 003A 1 GI
LI
ABS_ANY_FLOAT 003B GF
LF
RETURN_TRUE 005E 0
RETURN_FALSE 005F 0
ANDOR[*] 0078 1 VI
LAUNCH_MISSION 0079 1 VI
GOSUB_FILE 01BA 2 VO VO
LOAD_AND_LAUNCH_MISSION 0289 1 IV
= IS_INT_ANY_EQUAL_TO_CONSTANT 02DB 2 GC VC
LC VC
SET_ANY_INT_TO_CONSTANT 02E2 GC VC
LC VC
> IS_INT_ANY_GREATER_THAN_CONSTANT 02E3 2 GC VC
LC VC
IS_CONSTANT_GREATER_THAN_INT_ANY 02E4 VC GC
VC LC
>= IS_INT_ANY_GREATER_OR_EQUAL_TO_CONSTANT 02E5 2 GC VC
LC VC
IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_ANY 02E6 VC GV
VC LC
CALL[*][*] CALL_037A 037A 1 VO _ _ _
CALL_037B 037B
Notes
^ A special mission directive which is never compiled.
^ It is used also to build statements internally.
^ It has an undefined amount of arguments.
^ It is a likely definition of the standard command.
^ Arguments amount varies when compiling.

This section is incomplete. You can help by fixing and expanding it.

Uncommon

Arguments of some commands keep uncommon values which look familiar after encoding:

Command Arg ID Syntax Encoded
Value Type
GTA III Vice City San Andreas Liberty City Stories Vice City Stories
GOTO 1 Any label Offset INT
GOTO_IF_FALSE 1 Any label Offset INT
GOSUB 1 Gosub label Offset INT
GOSUB_FILE 1 Gosub label 0-based offset INT
2 Foreign gosub file
START_NEW_SCRIPT 1 Script label 0-based offset INT
LAUNCH_MISSION 1 Subscript file 0-based offset INT
LOAD_AND_LAUNCH_MISSION 1 Mission script file Mission identifier INT
Liberty City Stories Vice City Stories
GOTO_IF_TRUE 1 Any label Offset INT
CALL 1 Function label Function arguments INT
2 Returning arguments
3 Parent script locals
4 Offset

This section is incomplete. You can help by fixing and expanding it.

Comparing rule

The comparing rule can handle up to 9 checks per construct. 006D (GTA III, Vice City, San Andreas), 00DB (Liberty City Stories) and 0078 (Vice City Stories) indicate you are verifying a single check (0) or multiple checks with either AND (1 to 8) or OR (21 to 28) logical operators (see also ANDOR).

Analysis

As an overview of the compiled source, statements are literally nested meaning that the code is unoptimized. Furthermore, the jump of an embedded construct doesn't get merged with that of the construct itself, which consists of a benefit for the code parsing.

IF

As regards the IF statement, if the whole check is true the consequence is performed and the code jumps to the end of the construct, otherwise it skips to the alternative (see also Comparing rule):

Decompiled GTA III Vice City San Andreas Liberty City Stories Vice City Stories Compiled
IF [NOT] {condition0}
[AND|OR [NOT] {condition8}]
    {consequence}
[ELSE
    {alternative}]
ENDIF
{006D}
{....}
{....}
{004D}
{....}
{0002}
 ---- 
{....}
 ---- 
{00DB}
{....}
{....}
{004D}
{....}
{0002}
 ---- 
{....}
 ---- 
{0078}
{....}
{....}
{0022}
{....}
{0002}
 ---- 
{....}
 ---- 
ANDOR {value}
    [NOT] {condition0}
    [[NOT] {condition8}]
GOTO_IF_FALSE ELSE
    {consequence}
    [GOTO ENDIF]
ELSE:
    [{alternative}
ENDIF:]

IFNOT

Not that much to say more than the preceding construct, the IFNOT statement is built nearly in the same way. In fact, the ELSE clause points to the alternative, whereas the GOTO jumps to its end. The substantial difference consists in the substitution of GOTO_IF_FALSE with GOTO_IF_TRUE:

Decompiled Liberty City Stories Vice City Stories Compiled
IFNOT [NOT] {condition0}
[AND|OR [NOT] {condition8}]
    {consequence}
[ELSE
    {alternative}]
ENDIF
{00DB}
{....}
{....}
{004C}
{....}
{0002}
 ---- 
{....}
 ---- 
{0078}
{....}
{....}
{0021}
{....}
{0002}
 ---- 
{....}
 ---- 
ANDOR {value}
    [NOT] {condition0}
    [[NOT] {condition8}]
GOTO_IF_TRUE ELSE
    {consequence}
    [GOTO ENDIF]
ELSE:
    [{alternative}
ENDIF:]

WHILE

The WHILE statement is pretty much similar to the previous, even though when the consequence is read the code is moved to the beginning of the construct:

Decompiled GTA III Vice City San Andreas Liberty City Stories Vice City Stories Compiled
WHILE [NOT] {condition0}
[AND|OR [NOT] {condition8}]
    {consequence}
ENDWHILE
 ---- 
{006D}
{....}
{....}
{004D}
{....}
{0002}
 ---- 
 ---- 
{00DB}
{....}
{....}
{004D}
{....}
{0002}
 ---- 
 ---- 
{0078}
{....}
{....}
{0022}
{....}
{0002}
 ---- 
WHILE:
ANDOR {value}
    [NOT] {condition0}
    [[NOT] {condition8}]
GOTO_IF_FALSE ENDWHILE
    {consequence}
    GOTO WHILE
ENDWHILE:

WHILENOT

To say the least, WHILENOT statement follows the same constitution of both WHILE and IFNOT constructs, by exchanging GOTO_IF_FALSE with GOTO_IF_TRUE:

Decompiled Liberty City Stories Vice City Stories Compiled
WHILENOT [NOT] {condition0}
[AND|OR [NOT] {condition8}]
    {consequence}
ENDWHILE
 ---- 
{00DB}
{....}
{....}
{004C}
{....}
{0002}
 ---- 
 ---- 
{0078}
{....}
{....}
{0021}
{....}
{0002}
 ---- 
WHILENOT:
ANDOR {value}
    [NOT] {condition0}
    [[NOT] {condition8}]
GOTO_IF_TRUE ENDWHILE
    {consequence}
    GOTO WHILENOT
ENDWHILE:

REPEAT

Seemingly, the REPEAT statement is the first construct ever optimized as a result of a possible R* compiler fault. Moreover, it sounds ambiguous as it loops at least once. This was probably the intention of R* programmers, that is iterating at least once else the construct is useless. However, there are few chance they decide to use such structure to avoid some conflict with some other constructs:

Decompiled G/L Vice City San Andreas Liberty City Stories G/L Vice City Stories Compiled
REPEAT {times} {varname}
    {consequence}
ENDREPEAT
{0004}
 ---- 
{....}
{0008}
{0028}
{004D}
{0005}
 ---- 
{....}
{0009}
{0029}
{004D}
{0004}
 ---- 
{....}
{0007}
{0015}
{0022}
{varname} = {value0}
LOOP:
{consequence}
++ {varname}
    {varname} >= {valueN}
GOTO_IF_FALSE LOOP

CASE

In San Andreas, the CASE statement is more complex and efficient because the game uses internally a binary search algorithm to jump at the label that matches with the value of a particular case. This method requires a known amount of cases which is up to 75. When a case is true, a consequence is executed and the code jumps to the end of the construct, otherwise the alternative may be performed. As the code is unoptimized, the GOTO of the last case is still compiled even though its label points to the end of the jump itself:

Decompiled San Andreas Compiled
CASE {varname}
    WHEN {value0}
        {consequence}
    [WHEN {valueN}
        {consequence}]
    [ELSE
        {alternative}]
ENDCASE
{0871}
{0872}
 ---- 
{....}
{0002}
 ---- 
{....}
{0002}
 ---- 
{....}
{0002}
 ---- 
{varname} {cases} {iselse} ELSE {value0} WHEN0 {valueN} WHENN -1 ENDCASE -1 ENDCASE -1 ENDCASE -1 ENDCASE -1 ENDCASE
[-1 ENDCASE -1 ENDCASE -1 ENDCASE -1 ENDCASE -1 ENDCASE -1 ENDCASE -1 ENDCASE -1 ENDCASE -1 ENDCASE]
WHEN0:
    {consequence}
    GOTO ENDCASE
[WHENN:
    {consequence}
    GOTO ENDCASE]
[ELSE:
    {alternative}
    GOTO ENDCASE]
ENDCASE:

In Liberty City Stories and Vice City Stories, such statement is a set of nested IF constructs which causes a very slight loss of performance by considering that 00DB (Liberty City Stories) and 0078 (Vice City Stories aren't compiled:

Decompiled G/L Liberty City Stories G/L Vice City Stories Compiled
CASE {varname}
    WHEN {value0}
        {consequence}
    [WHEN {valueN}
        {consequence}]
    [ELSE
        {alternative}]
ENDCASE
 ---- 
{0038}
{004D}
{....}
{0002}
 ---- 
{0038}
{004D}
{....}
{0002}
 ---- 
{....}
 ---- 
 ---- 
 ---- 
{0039}
{004D}
{....}
{0002}
 ---- 
{0039}
{004D}
{....}
{0002}
 ---- 
{....}
 ---- 
 ---- 
 ---- 
{001B}
{0022}
{....}
{0002}
 ---- 
{001B}
{0022}
{....}
{0002}
 ---- 
{....}
 ---- 
 ---- 
WHEN0:
    {varname} = {value0}
GOTO_IF_FALSE WHENN
    {consequence}
    [GOTO ENDCASE0]
WHENN:
        [{varname} = {valueN}
    GOTO_IF_FALSE ELSE
        {consequence}
        [GOTO ENDCASEN]
    ELSE:
        [{alternative}
    ENDCASEN:]]
ENDCASE0:

Optimization

In Liberty City Stories and Vice City Stories, whenever a single condition is checked 00DB (Liberty City Stories) and 0078 (Vice City Stories) don't get compiled cause no logical operator (AND, OR) is used and so they become really useless. Its lack increase the script efficiency a lot. However, the jump of the ELSE clause of an IF statement which points to the end of the construct is still compiled after a GOTO. Furthermore, Stories Games come with an improved data type managing which causes a considerable decrease of the compiled file size.

External links