Difference between revisions of "SCM language"
m (→Specials: huge article collapsed) |
(Update expected, article reviewed.) |
||
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 Multifile''. Other doubts come with source files, whose ''SC'' extension appears to be very close to ''Mission SCript''. Although we have enough information to suppose the currently unknown mysteries of the used language, we still have no safe clue about which was its original denomination. Furthermore, it is a matter of fact that R* developers have been left untouched the ''miss2'' executable name of the ''GTA 3 series'' compiler since the chapter 2. In this connection, we could imagine the new language is a variant or an evolution of the ''' | + | {{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''. Although we have enough information to suppose the currently unknown mysteries of the used language, we still have no safe clue about which was its original denomination. Furthermore, it is a matter of fact that R* developers have been left untouched the ''miss2'' executable name of the ''GTA 3 series'' compiler since the chapter 2. In this connection, we could imagine the new language is a variant or an evolution of the '''GTA2script'''. In the ancient documentation by ''DMA'' (at present ''Rockstar North''), ''GBH'' sound like the initials of the codename or the primordial name of ''GTA2'', as the former is expressly stricken and overwritten by the latter (''<del>GBH</del><ins>GTA2</ins>'' occurs twice, whereas ''<del>GBHscript</del><ins>GTA2script</ins>'' only once), while ''GBHscript'' and ''GTA2script'' are quite recurring. Therefore, we are almost sure to say the language name is most likely '''GTA3script'''. However, it is definitely based on [[Wikipedia:BASIC|BASIC]]. |
Line 8: | Line 8: | ||
This article makes use of formatted codes to improve the reading comprehension. Note that: | This article makes use of formatted codes to improve the reading comprehension. Note that: | ||
− | * ''Square brackets'' mean everything inside may be omitted | + | * ''Square brackets'' mean everything inside may be omitted; |
− | * ''Curly brackets'' denote the presence of useful codes but not necessarily needed | + | * ''Curly brackets'' denote the presence of useful codes but not necessarily needed; |
* ''Vertical bars'' divide what can be chosen alternatively.<br/><br/> | * ''Vertical bars'' divide what can be chosen alternatively.<br/><br/> | ||
=Fundamentals= | =Fundamentals= | ||
Line 39: | Line 39: | ||
==Highlighters== | ==Highlighters== | ||
− | ''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 | + | ''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. 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 | SETUP_ZONE_PED_INFO FISHFAC DAY (0) 0 0 0 (0 0 0 0) 0 | ||
PRINT_BIG (T4X4_1) 5000 2 | PRINT_BIG (T4X4_1) 5000 2 | ||
+ | |||
+ | ;Limit | ||
+ | :Opening and closing round brakets are treated as blank spaces; | ||
+ | :An optional ''comma'' can be used aswell to distinguish each argument, processed as a space. | ||
==Scopes== | ==Scopes== | ||
Line 53: | Line 57: | ||
;Limit | ;Limit | ||
− | :Scopes cannot be nested. | + | :Scopes cannot be nested; |
+ | :Opening and closing curly brakets are real commands. | ||
==Labels== | ==Labels== | ||
Line 92: | Line 97: | ||
===Data types=== | ===Data types=== | ||
---- | ---- | ||
− | Among the available types, some are equivalent to the most known programming | + | Among the available data types, some are equivalent to those of the most known programming languages. Their length is up to 4, 8 and 16 bytes. Each type is appended as a suffix in the ''variable declaration''. |
+ | |||
+ | ====LABEL==== | ||
+ | |||
+ | The '''LABEL''' type handles ''variable-length strings''. It can refer to either a ''[[#Labels|label]] name'' or a ''file name''. | ||
+ | |||
+ | ;Notes | ||
+ | :While inside a script file, R* compiler treats it unambiguously as a label; | ||
+ | :R* compiler allocates 32 bytes per label. | ||
+ | |||
+ | ;Limit | ||
+ | :'''LABEL''' variables aren't available. | ||
====INT==== | ====INT==== | ||
Line 100: | Line 116: | ||
====FLOAT==== | ====FLOAT==== | ||
− | 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. | + | 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-7 digits beyond which it may get lost. |
====TEXT_LABEL==== | ====TEXT_LABEL==== | ||
− | 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. | + | 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. Literal only '''TEXT_LABEL*''' strings are probably marked by ''single quotation marks'' to distinguish them from variable and constant identifiers: |
+ | |||
+ | PRINT_BIG 'GXT_KEY' | ||
;Limit | ;Limit | ||
:'''TEXT_LABEL''' variables are supported in {{icon|sa}} and {{icon|vcs}}. | :'''TEXT_LABEL''' variables are supported in {{icon|sa}} and {{icon|vcs}}. | ||
− | ==== | + | ====TEXT_LABEL16==== |
− | The ''' | + | The '''TEXT_LABEL16''' 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. |
;Limit | ;Limit | ||
− | :''' | + | :'''TEXT_LABEL16''' variables and values are supported only in {{icon|sa}}. |
− | ==== | + | ====TEXT_BUFFER==== |
− | The ''' | + | The '''TEXT_BUFFER''' type handles ''32-byte strings'' or larger, depending on how many continuous parameters of the same type there are, each of which occupies 32 bytes. It can hold up to ''127 characters plus the null-terminator'', after which another '''TEXT_BUFFER''' argument may begin. Strings of such type must be put within ''double quotation marks'': |
− | + | SAVE_STRING_TO_DEBUG_FILE "32B-128B TEXT" | |
− | |||
− | + | ;Limits | |
+ | :'''TEXT_BUFFER''' values are supported since {{icon|vc}}; | ||
+ | :'''TEXT_BUFFER''' variables aren't available. | ||
− | + | ====TEXT_VARLEN==== | |
− | + | The '''TEXT_VARLEN''' type handles ''N-byte strings''. It holds ''N characters plus the null-terminator''. Strings of this type mustn't exceed 255 characters (including the null-byte). | |
− | + | ;Limits | |
+ | :'''TEXT_VARLEN''' values are supported since {{icon|sa}}; | ||
+ | :'''TEXT_VARLEN''' variables aren't available. | ||
− | + | ====T (pseudo)==== | |
− | |||
− | + | The '''T''' type handles a group of few datatypes acceptable per argument. It is used only for commands featuring optional arguments, those whose type is unpredictable before the compilation. It can be a pseudo type of '''INT''', '''FLOAT''' and '''TEXT_LABEL'''. | |
− | + | ;Notes | |
+ | :'''INT''' and '''FLOAT''' can be used interchangeably in {{icon|3}}, {{icon|vc}}, {{icon|sa}}, {{icon|lcs}} and {{icon|vcs}}; | ||
+ | :{{icon|vcs}} also admits '''TEXT_LABEL''' arguments. | ||
− | + | ====CONST (pseudo)==== | |
− | + | The '''CONST''' 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 or audio events'' and such. It is a pseudo type of '''INT'''. | |
− | |||
− | |||
− | + | ;Limit | |
− | + | :The [[#Arithmetic|assignment]] and [[#Comparison|comparison]] of '''CONST''' values are supported since {{icon|vc}}. | |
− | The | ||
− | |||
− | |||
− | |||
− | |||
===Declaration=== | ===Declaration=== | ||
Line 156: | Line 171: | ||
''Defining a variable'' means ''assigning a token string to a memory cell'' at the compiling time. Variables must be declared in the following manner: | ''Defining a variable'' means ''assigning a token string to a memory cell'' at the compiling time. Variables must be declared in the following manner: | ||
− | { | + | VAR_* {varname0}[,] [... {varnameN}] |
+ | LVAR_* {varname0}[,] [... {varnameN}] | ||
As mentioned in the sections above, local variables have to be put within curly brackets: | As mentioned in the sections above, local variables have to be put within curly brackets: | ||
{ | { | ||
− | { | + | VAR_* {varname0}[,] [... {varnameN}] |
+ | LVAR_* {varname0}[,] [... {varnameN}] | ||
[...] | [...] | ||
Line 168: | Line 185: | ||
''Inline variable declaration'' is allowed, you just have to separate them by ''spaces'' or ''tabulations''. Adding a preceding ''comma'' before these characters is optional. | ''Inline variable declaration'' is allowed, you just have to separate them by ''spaces'' or ''tabulations''. Adding a preceding ''comma'' before these characters is optional. | ||
− | ; | + | ;Limits |
− | :Whereas the ''variable buffer'' is limited, you can declare a certain amount of globals and locals. [[#INT|INT]] and [[#FLOAT|FLOAT]] | + | :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 [[#TEXT_LABEL16|TEXT_LABEL16]] types occupy respectively 2 and 4 variables to store their data (have a look [[#Variables_2|here]] for further details); |
+ | :Global and local variable names must not collide. | ||
+ | :{{icon|vcs}} isn't affected by what said above. | ||
====Arrays==== | ====Arrays==== | ||
Line 176: | Line 195: | ||
{ | { | ||
− | { | + | VAR_* {varname0}{[arrsize0]}[,] [... {varnameN}{[arrsizeN]}] |
+ | LVAR_* {varname0}{[arrsize0]}[,] [... {varnameN}{[arrsizeN]}] | ||
[...] | [...] | ||
Line 182: | Line 202: | ||
;Limits | ;Limits | ||
− | :The usage of arrays is allowed since {{icon|vc}} | + | :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}}. | + | :Variable indices are quite buggy in {{icon|vc}} and therefore unrecommended, but they are fully supported since {{icon|sa}}; |
+ | :Multidimensional arrays are not supported. | ||
====Handles==== | ====Handles==== | ||
A ''handle'' is an univocal identifier assigned to a game entity. It is given by the following statement: | 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> | <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]]. | + | |
+ | ;Note | ||
+ | :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 197: | Line 221: | ||
===Arithmetic=== | ===Arithmetic=== | ||
− | ''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, [[# | + | ''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, [[#CONST (pseudo)|CONST]], [[#TEXT_LABEL|TEXT_LABEL]] and [[#TEXT_LABEL16|TEXT_LABEL16]] types are free from these operators, except for the ''basic assignment'' (see also [[#Operators composition|Operators composition]]): |
{|class=wikitable | {|class=wikitable | ||
Line 205: | Line 229: | ||
!width=500px|Description | !width=500px|Description | ||
|- | |- | ||
− | ! | + | != |
|align=center colspan=2|Assignment | |align=center colspan=2|Assignment | ||
|align=center|<code>expr0 '''=''' expr1</code> | |align=center|<code>expr0 '''=''' expr1</code> | ||
|Store ''expr1'' to ''expr0'' | |Store ''expr1'' to ''expr0'' | ||
|- | |- | ||
− | ! | + | !+ |
|align=center colspan=2|Addition | |align=center colspan=2|Addition | ||
|align=center|<code>expr0 '''+''' expr1</code> | |align=center|<code>expr0 '''+''' expr1</code> | ||
|Add ''expr1'' to ''expr0'' | |Add ''expr1'' to ''expr0'' | ||
|- | |- | ||
− | ! | + | !- |
|align=center colspan=2|Subtraction | |align=center colspan=2|Subtraction | ||
|align=center|<code>expr0 '''-''' expr1</code> | |align=center|<code>expr0 '''-''' expr1</code> | ||
|Subtract ''expr1'' from ''expr0'' | |Subtract ''expr1'' from ''expr0'' | ||
|- | |- | ||
− | ! | + | !* |
|align=center colspan=2|Multiplication | |align=center colspan=2|Multiplication | ||
|align=center|<code>expr0 '''*''' expr1</code> | |align=center|<code>expr0 '''*''' expr1</code> | ||
|Multiply ''expr0'' by ''expr1'' | |Multiply ''expr0'' by ''expr1'' | ||
|- | |- | ||
− | ! | + | !/ |
|align=center colspan=2|Division | |align=center colspan=2|Division | ||
|align=center|<code>expr0 '''/''' expr1</code> | |align=center|<code>expr0 '''/''' expr1</code> | ||
|Divide ''expr0'' by ''expr1'' | |Divide ''expr0'' by ''expr1'' | ||
|- | |- | ||
− | ! | + | !+@ |
|align=center colspan=2|Timed addition | |align=center colspan=2|Timed addition | ||
|align=center|<code>expr0 '''+@''' expr1</code> | |align=center|<code>expr0 '''+@''' expr1</code> | ||
|Multiply ''expr2'' by delta time and add the result to ''expr1'' | |Multiply ''expr2'' by delta time and add the result to ''expr1'' | ||
|- | |- | ||
− | ! | + | !-@ |
|align=center colspan=2|Timed subtraction | |align=center colspan=2|Timed subtraction | ||
|align=center|<code>expr0 '''-@''' expr1</code> | |align=center|<code>expr0 '''-@''' expr1</code> | ||
|Multiply ''expr2'' by delta time and subtract the result from ''expr1'' | |Multiply ''expr2'' by delta time and subtract the result from ''expr1'' | ||
|- | |- | ||
− | !rowspan=2| | + | !rowspan=2|++ |
|align=center rowspan=2|Increment | |align=center rowspan=2|Increment | ||
|align=center|Pre{{ref|preinc|[*]}} | |align=center|Pre{{ref|preinc|[*]}} | ||
Line 249: | Line 273: | ||
|align=center|<code>expr0 '''++'''</code> | |align=center|<code>expr0 '''++'''</code> | ||
|- | |- | ||
− | !rowspan=2| | + | !rowspan=2|-- |
|align=center rowspan=2|Decrement | |align=center rowspan=2|Decrement | ||
|align=center|Pre{{ref|preinc|[*]}} | |align=center|Pre{{ref|preinc|[*]}} | ||
Line 270: | Line 294: | ||
!width=500px|Description | !width=500px|Description | ||
|- | |- | ||
− | ! | + | != + |
|align=center|Addition and assignment | |align=center|Addition and assignment | ||
|align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''+''' expr2</code> | |align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''+''' expr2</code> | ||
|Add ''expr2'' to ''expr1'' and store the result to ''expr0'' | |Add ''expr2'' to ''expr1'' and store the result to ''expr0'' | ||
|- | |- | ||
− | ! | + | != - |
|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'' from ''expr1'' and store the result to ''expr0'' | |Subtract ''expr2'' from ''expr1'' and store the result to ''expr0'' | ||
|- | |- | ||
− | ! | + | != * |
|align=center|Multiplication and assignment | |align=center|Multiplication and assignment | ||
|align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''*''' expr2</code> | |align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''*''' expr2</code> | ||
|Multiply ''expr1'' by ''expr2'' and store the result to ''expr0'' | |Multiply ''expr1'' by ''expr2'' and store the result to ''expr0'' | ||
|- | |- | ||
− | ! | + | != / |
|align=center|Division and assignment | |align=center|Division and assignment | ||
|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'' | ||
|- | |- | ||
− | ! | + | != +@ |
|align=center|Timed addition and assignment | |align=center|Timed addition and assignment | ||
|align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''+@''' expr2</code> | |align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''+@''' expr2</code> | ||
|Multiply ''expr2'' by delta time, add the result to ''expr1'' and store everything to ''expr0'' | |Multiply ''expr2'' by delta time, add the result to ''expr1'' and store everything to ''expr0'' | ||
|- | |- | ||
− | ! | + | != -@ |
|align=center|Timed subtraction and assignment | |align=center|Timed subtraction and assignment | ||
|align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''-@''' expr2</code> | |align=center|<code>expr0 '''=''' expr1{{ref|expr01|[*]}} '''-@''' expr2</code> | ||
Line 317: | Line 341: | ||
!width=500px|Description | !width=500px|Description | ||
|- | |- | ||
− | ! | + | !+= |
|align=center|Addition assignment | |align=center|Addition assignment | ||
|align=center|<code>expr0 '''+=''' expr1</code> | |align=center|<code>expr0 '''+=''' expr1</code> | ||
|Add ''expr1'' to ''expr0'' and store the result to ''expr0'' | |Add ''expr1'' to ''expr0'' and store the result to ''expr0'' | ||
|- | |- | ||
− | ! | + | !-= |
|align=center|Subtraction assignment | |align=center|Subtraction assignment | ||
|align=center|<code>expr0 '''-=''' expr1</code> | |align=center|<code>expr0 '''-=''' expr1</code> | ||
|Subtract ''expr1'' from ''expr0'' and store the result to ''expr0'' | |Subtract ''expr1'' from ''expr0'' and store the result to ''expr0'' | ||
|- | |- | ||
− | ! | + | !*= |
|align=center|Multiplication assignment | |align=center|Multiplication assignment | ||
|align=center|<code>expr0 '''*=''' expr1</code> | |align=center|<code>expr0 '''*=''' expr1</code> | ||
|Multiply ''expr0'' by ''expr1'' and store the result to ''expr0'' | |Multiply ''expr0'' by ''expr1'' and store the result to ''expr0'' | ||
|- | |- | ||
− | ! | + | !/= |
|align=center|Division assignment | |align=center|Division assignment | ||
|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'' | ||
|- | |- | ||
− | ! | + | !+=@ |
|align=center|Timed addition assignment | |align=center|Timed addition assignment | ||
|align=center|<code>expr0 '''+=@''' expr1</code> | |align=center|<code>expr0 '''+=@''' expr1</code> | ||
|Multiply ''expr1'' by delta time, add the result to ''expr0'' and store everything to ''expr0'' | |Multiply ''expr1'' by delta time, add the result to ''expr0'' and store everything to ''expr0'' | ||
|- | |- | ||
− | ! | + | !-=@ |
|align=center|Timed subtraction assignment | |align=center|Timed subtraction assignment | ||
|align=center|<code>expr0 '''-=@''' expr1</code> | |align=center|<code>expr0 '''-=@''' expr1</code> | ||
Line 358: | Line 382: | ||
!width=500px|Description | !width=500px|Description | ||
|- | |- | ||
− | ! | + | !=# |
|align=center|Cast assignment | |align=center|Cast assignment | ||
|align=center|<code>expr0 '''=#''' expr1</code> | |align=center|<code>expr0 '''=#''' expr1</code> | ||
Line 377: | Line 401: | ||
!width=500px|Description | !width=500px|Description | ||
|- | |- | ||
− | ! | + | !NOT |
|align=center|Logical negation | |align=center|Logical negation | ||
|align=center|<code>IF '''NOT''' condition0</code> | |align=center|<code>IF '''NOT''' condition0</code> | ||
|Test if ''condition0'' is false | |Test if ''condition0'' is false | ||
|- | |- | ||
− | ! | + | !AND |
|align=center|Logical conjunction | |align=center|Logical conjunction | ||
|align=center|<code>IF condition0<br/>'''AND''' condition8</code> | |align=center|<code>IF condition0<br/>'''AND''' condition8</code> | ||
|Test if both ''condition0'' and ''conditionN'' are true | |Test if both ''condition0'' and ''conditionN'' are true | ||
|- | |- | ||
− | ! | + | !OR |
|align=center|Logical disjunction | |align=center|Logical disjunction | ||
|align=center|<code>IF condition0<br/>'''OR''' condition8</code> | |align=center|<code>IF condition0<br/>'''OR''' condition8</code> | ||
Line 403: | Line 427: | ||
!width=500px|Description | !width=500px|Description | ||
|- | |- | ||
− | ! | + | != |
|align=center|Equal to | |align=center|Equal to | ||
|align=center|<code>IF expr0 '''=''' expr1</code> | |align=center|<code>IF expr0 '''=''' expr1</code> | ||
|Test if ''expr0'' and ''expr1'' are equal | |Test if ''expr0'' and ''expr1'' are equal | ||
|- | |- | ||
− | ! | + | !> |
|align=center|Greater than | |align=center|Greater than | ||
|align=center|<code>IF expr0 '''>''' expr1</code> | |align=center|<code>IF expr0 '''>''' expr1</code> | ||
|Test if ''expr0'' is greater than ''expr1'' | |Test if ''expr0'' is greater than ''expr1'' | ||
|- | |- | ||
− | !< | + | !< |
|align=center|Lesser than | |align=center|Lesser than | ||
|align=center|<code>IF expr0 '''<''' expr1</code> | |align=center|<code>IF expr0 '''<''' expr1</code> | ||
|Test if ''expr0'' is lesser than ''expr1'' | |Test if ''expr0'' is lesser than ''expr1'' | ||
|- | |- | ||
− | ! | + | !>= |
|align=center|Greater than or equal to | |align=center|Greater than or equal to | ||
|align=center|<code>IF expr0 '''>=''' expr1</code> | |align=center|<code>IF expr0 '''>=''' expr1</code> | ||
|Test if ''expr0'' is greater than or equal to ''expr1'' | |Test if ''expr0'' is greater than or equal to ''expr1'' | ||
|- | |- | ||
− | ! | + | !<= |
|align=center|Lesser than or equal to | |align=center|Lesser than or equal to | ||
|align=center|<code>IF expr0 '''<=''' expr1</code> | |align=center|<code>IF expr0 '''<=''' expr1</code> | ||
|Test if ''expr0'' is lesser than or equal to ''expr1'' | |Test if ''expr0'' is lesser than or equal to ''expr1'' | ||
|} | |} | ||
− | |||
− | |||
==Commands== | ==Commands== | ||
− | 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]]''. | + | 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]]''. It does not return [[#Value|values]] that can be assigned to a [[#Variables|variable]], even though the boolean flag is kept whenever it is used as a ''condition''. It follows the common programming syntax adopted for ''procedure or function calls'': |
{commandname} [{anyvalue0|varname0} ... {anyvalueN|varnameN}] | {commandname} [{anyvalue0|varname0} ... {anyvalueN|varnameN}] | ||
Line 456: | Line 478: | ||
** '''ABS''' | ** '''ABS''' | ||
* {{icon|sa}}: | * {{icon|sa}}: | ||
− | ** ''' | + | ** '''IS_EMPTY''' |
− | |||
** '''IS_BIT_SET''' | ** '''IS_BIT_SET''' | ||
** '''SET_BIT''' | ** '''SET_BIT''' | ||
** '''CLEAR_BIT''' | ** '''CLEAR_BIT''' | ||
− | ** ''' | + | ** '''STRING_CAT''' |
{{incomplete}} | {{incomplete}} | ||
Line 467: | Line 488: | ||
===Internals=== | ===Internals=== | ||
− | ''Internal commands'' are those which have special characteristics and are handled internally | + | ''Internal commands'' are those which have special characteristics and are handled internally: |
* {{icon|3}} {{icon|vc}} {{icon|sa}} {{icon|lcs}} {{icon|vcs}}: | * {{icon|3}} {{icon|vc}} {{icon|sa}} {{icon|lcs}} {{icon|vcs}}: | ||
Line 474: | Line 495: | ||
** '''MISSION_END''' | ** '''MISSION_END''' | ||
** '''START_NEW_SCRIPT''' | ** '''START_NEW_SCRIPT''' | ||
+ | ** '''VAR_INT''' | ||
+ | ** '''VAR_FLOAT''' | ||
+ | ** '''LVAR_INT''' | ||
+ | ** '''LVAR_FLOAT''' | ||
+ | ** '''{''' | ||
+ | ** '''}''' | ||
+ | ** '''REPEAT''' | ||
+ | ** '''ENDREPEAT''' | ||
+ | ** '''IF''' | ||
+ | ** '''IFNOT''' | ||
+ | ** '''ELSE''' | ||
+ | ** '''ENDIF''' | ||
+ | ** '''WHILE''' | ||
+ | ** '''WHILENOT''' | ||
+ | ** '''ENDWHILE''' | ||
** '''ANDOR''' | ** '''ANDOR''' | ||
** '''LAUNCH_MISSION''' | ** '''LAUNCH_MISSION''' | ||
Line 484: | Line 520: | ||
** '''LOAD_AND_LAUNCH_MISSION_INTERNAL''' | ** '''LOAD_AND_LAUNCH_MISSION_INTERNAL''' | ||
** '''SET_TOTAL_NUMBER_OF_MISSIONS'''{{ref|thgtot|[*]}} | ** '''SET_TOTAL_NUMBER_OF_MISSIONS'''{{ref|thgtot|[*]}} | ||
+ | ** '''VAR_TEXT_LABEL''' | ||
+ | ** '''LVAR_TEXT_LABEL''' | ||
* {{icon|vc}} {{icon|sa}} {{icon|lcs}} {{icon|vcs}}: | * {{icon|vc}} {{icon|sa}} {{icon|lcs}} {{icon|vcs}}: | ||
** '''REGISTER_ODDJOB_MISSION_PASSED''' | ** '''REGISTER_ODDJOB_MISSION_PASSED''' | ||
Line 496: | Line 534: | ||
* {{icon|lcs}} {{icon|vcs}}: | * {{icon|lcs}} {{icon|vcs}}: | ||
** '''CALL''' | ** '''CALL''' | ||
− | ** ''' | + | ** '''CALLNOT''' |
− | * {{icon|sa}} | + | * {{icon|sa}}: |
− | ** ''' | + | ** '''VAR_TEXT_LABEL16''' |
− | ** ''' | + | ** '''LVAR_TEXT_LABEL16''' |
+ | ** '''SWITCH''' | ||
+ | ** '''ENDSWITCH''' | ||
+ | ** '''CASE''' | ||
+ | ** '''DEFAULT''' | ||
+ | ** '''BREAK''' | ||
+ | ** '''SWITCH_START''' | ||
+ | ** '''SWITCH_CONTINUED''' | ||
* {{icon|vcs}}: | * {{icon|vcs}}: | ||
** '''SET_COLLECTABLE2_TOTAL''' | ** '''SET_COLLECTABLE2_TOTAL''' | ||
− | ; | + | ;Notes |
:{{note|thgtot}} The [[#Arguments|argument]] of these commands must be set respectively according to: | :{{note|thgtot}} The [[#Arguments|argument]] of these commands must be set respectively according to: | ||
:* The sum of '''PLAYER_MADE_PROGRESS''' values; | :* The sum of '''PLAYER_MADE_PROGRESS''' values; | ||
− | :* The amount of '''REGISTER_MISSION_PASSED''' (those that | + | :* The amount of '''REGISTER_MISSION_PASSED''' (those that don't have an immediate value are excluded) and '''REGISTER_ODDJOB_MISSION_PASSED'''; |
:* The amount of '''CREATE_COLLECTABLE1'''. | :* The amount of '''CREATE_COLLECTABLE1'''. | ||
− | If the argument of the listed commands differs from | + | :If the argument of the listed commands differs from what expected, a 0-value must be passed. |
{{incomplete}} | {{incomplete}} | ||
Line 514: | Line 559: | ||
===WAIT=== | ===WAIT=== | ||
− | '''WAIT''' | + | '''WAIT''' stops 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 should 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=== | ||
Line 532: | Line 577: | ||
===ANDOR=== | ===ANDOR=== | ||
− | '''ANDOR''' | + | '''ANDOR''' sets out the way the comparison among more conditions have to occur (see also [[#Compare flag|Compare flag]]). |
===GOTO_IF_TRUE=== | ===GOTO_IF_TRUE=== | ||
Line 540: | Line 585: | ||
===GOTO_IF_FALSE=== | ===GOTO_IF_FALSE=== | ||
− | Unlike [[#GOTO_IF_TRUE|GOTO_IF_TRUE]], '''GOTO_IF_FALSE''' jumps to the | + | Unlike [[#GOTO_IF_TRUE|GOTO_IF_TRUE]], '''GOTO_IF_FALSE''' jumps to the desired [[#Labels|label]] only if the comparison returns false. |
===SCRIPT_NAME=== | ===SCRIPT_NAME=== | ||
− | '''SCRIPT_NAME''' simply associates an unique name to the | + | '''SCRIPT_NAME''' simply associates an unique name to the current working [[#Structure|script]]. |
;Note | ;Note | ||
− | :R* compiler doesn't enable you to associate a name previously used. | + | :R* compiler doesn't enable you to associate a name previously used for another script. |
===SAVE_STRING_TO_DEBUG_FILE=== | ===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. | + | '''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. Since {{icon|vc}}, these are the seemingly predetermined bytes of a random empty string block which are actually the result of uninitialized data: |
− | 00 00 41 00 09 2E 00 00 00 00 00 00 | + | 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 | + | 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 | + | 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 | + | 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 | |
− | + | The split of such bytes into 4 blocks of 32-bytes each is quite noticeable. | |
==Constants== | ==Constants== | ||
− | A ''constant'' is a ''symbolic name'' associated to a specific [[#Value|value]]. When compiling, their caption is converted | + | A ''constant'' is a ''symbolic name'' associated to a specific [[#Value|value]]. When compiling, their caption is converted to the assigned value. 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} | {constname0} {constvalue0} | ||
Line 572: | Line 617: | ||
{constnameN} {constvalueN} | {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 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 [[#CONST (pseudo)|CONST]] type accept only ''constant values'' of a single ''namespace''. |
+ | |||
+ | ;Notes | ||
+ | :Constants don't collide even though they belong to different namespaces; | ||
+ | :In {{icon|3}} and {{icon|vc}}, they are hardcoded as everything inside R* compiler; | ||
+ | :In {{icon|sa}}, the subdivision of constant namespaces in files might be just a listing of hardcoded constants useful for developers. The same would apply to {{icon|lcs}} and {{icon|vcs}}. | ||
==Formatting== | ==Formatting== | ||
− | Everything is ''case-insensitive'', that means the uppercase and lowercase letters | + | Everything is ''case-insensitive'', that means the uppercase and lowercase letters have no dissimilarities when taken. Usually, the source code is conform to the same formatting according to: |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | * [[#Labels|Labels]] and [[#Variables|variables]] are entirely in lowercase; | ||
+ | * [[#Declaration|Declarations]], [[#Commands|commands]] and [[#Statements|statements]] are in uppercase; | ||
+ | * [[#Constants|Constants]] are mostly in uppercase but the lowercase variant can be seen aswell.<br/><br/> | ||
=Compiling= | =Compiling= | ||
==Structure== | ==Structure== | ||
− | The source code is split up into several ''SC'' files which comprehend ''main file'', ''foreign gosubs'', ''subscripts'', ''mission scripts'', and '' | + | The source code is split up into several ''SC'' files which comprehend ''main file'', ''foreign gosubs'', ''subscripts'', ''mission scripts'', and ''streamed scripts''. These files can be included more times because they are actually processed once. |
===Main file=== | ===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|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 | + | 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: |
<directory> | <directory> | ||
Line 621: | Line 656: | ||
| \- mission.sc | | \- mission.sc | ||
\- main.sc | \- main.sc | ||
+ | |||
+ | ;Note | ||
+ | :R* compiler will scan subfolders too. | ||
===Foreign gosubs=== | ===Foreign gosubs=== | ||
Line 672: | Line 710: | ||
MISSION_START | MISSION_START | ||
− | [VAR_ | + | [VAR_* {varname0}[,] [... {varnameN}]] |
SCRIPT_NAME main | SCRIPT_NAME main | ||
Line 678: | Line 716: | ||
subscript_loop: | subscript_loop: | ||
{ | { | ||
− | [LVAR_ | + | [LVAR_* {varname0}[,] [... {varnameN}]] |
[...] | [...] | ||
Line 685: | Line 723: | ||
MISSION_END | MISSION_END | ||
− | ; | + | ;Notes |
− | :'''MISSION_START''' is a special and fake directive that isn't assigned to any [[#Commands|command]]. R* compiler will notify an error if it isn't placed at the first line of a subscript or a [[#Mission scripts|mission script]]. | + | :'''MISSION_START''' is a special and fake directive that isn't assigned to any [[#Commands|command]]. R* compiler will notify an error if it isn't placed at the first line of a subscript or a [[#Mission scripts|mission script]]; |
+ | :'''MISSION_END''' is an alias of '''TERMINATE_THIS_SCRIPT'''. | ||
====Scripts==== | ====Scripts==== | ||
Line 704: | Line 743: | ||
script_loop: | script_loop: | ||
− | [LVAR_ | + | [LVAR_* {varname0}[,] [... {varnameN}]] |
[...] | [...] | ||
Line 713: | Line 752: | ||
;Notes | ;Notes | ||
− | :Scripts must have a local [[#Scope|scope]] | + | :Scripts must have a local [[#Scope|scope]]; |
− | :Script commands must be inserted within or after the local scope | + | :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. | :Since {{icon|vc}}, the ''opening curly bracket'' must be put before the script [[#Labels|label]] when more arguments are passed. | ||
Line 743: | Line 782: | ||
MISSION_END | MISSION_END | ||
− | [VAR_ | + | [VAR_* {varname0}[,] [... {varnameN}]] |
mission_start: | mission_start: | ||
Line 753: | Line 792: | ||
{ | { | ||
− | [LVAR_ | + | [LVAR_* {varname0}[,] [... {varnameN}]] |
[...] | [...] | ||
Line 782: | Line 821: | ||
;Note | ;Note | ||
− | : | + | :Exclusive missions are never launched in the source code. It's likely, it was an idea not came to the end successfully or rather they were useful for debugging purposes. |
+ | |||
;Limits | ;Limits | ||
− | :'''LOAD_AND_LAUNCH_MISSION_EXCLUSIVE''' is available only in {{icon|vc}} and {{icon|sa}} | + | :'''LOAD_AND_LAUNCH_MISSION_EXCLUSIVE''' is available only in {{icon|vc}} and {{icon|sa}}; |
:R* compiler won't let you using more than 2 '''LOAD_AND_LAUNCH_MISSION_EXCLUSIVE'''. | :R* compiler won't let you using more than 2 '''LOAD_AND_LAUNCH_MISSION_EXCLUSIVE'''. | ||
− | === | + | ===Streamed scripts=== |
---- | ---- | ||
{{incomplete}} | {{incomplete}} | ||
Line 866: | Line 906: | ||
;Limits | ;Limits | ||
− | :It is supported since {{icon|vc}} | + | :It is supported since {{icon|vc}}; |
− | :The times must be positive | + | :The times must be positive; |
:The code will be read at least once in any case. | :The code will be read at least once in any case. | ||
− | === | + | ===SWITCH=== |
− | Basically, ''' | + | Basically, '''SWITCH''' is a ''group of concatenated '''IF''' statements''. When a condition is false the next '''CASE''' gets performed, otherwise the ''consequence'' is executed till '''BREAK''' occurs and so the code jumps to the end of the construct. If none of the cases is true, a '''DEFAULT''' clause may be carried out: |
− | + | SWITCH {varname} | |
− | + | CASE {value0} | |
{consequence} | {consequence} | ||
− | [ | + | BREAK |
− | {consequence}] | + | [CASE {valueN} |
− | [ | + | {consequence} |
− | {alternative}] | + | BREAK] |
− | + | [DEFAULT | |
+ | {alternative} | ||
+ | BREAK] | ||
+ | ENDSWITCH | ||
;Limits | ;Limits | ||
− | :It is supported since {{icon|sa}} | + | :It is supported since {{icon|sa}}; |
− | : | + | :'''CASE''' allows the use of [[#INT|INT]] and [[#CONST (pseudo)|CONST]] values only; |
− | :In {{icon|sa}}, values must be sorted | + | :In {{icon|sa}}, values must be sorted (R* compiler should do it implicitely); |
− | : | + | :Every '''CASE''' including '''DEFAULT''' must end with a '''BREAK'''.<br/><br/> |
− | |||
=Decompiling= | =Decompiling= | ||
==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 file|main file]] | + | 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. [[#Streamed scripts|Streamed scripts]] are compiled individually into the ''script.img'' file. On the other hand, [[#Functions|functions]] are compiled like [[#Gosubs|gosubs]]. |
==Identifiers== | ==Identifiers== | ||
− | ''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 [[# | + | ''Undefined [[#Constants|constants]]'' of model identifiers, whose name refers to a [[DFF]] which is presumably archived into any of the [[IMG]]<nowiki>s</nowiki>, 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 [[#Streamed scripts|streamed scripts]] respect the same rule except the fact they are turned into a 0-based growing identifier, while exclusive mission scripts are launched by a negative identifier. |
==Offsets== | ==Offsets== | ||
− | 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 [[# | + | 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 [[#Streamed scripts|streamed scripts]] 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 ''0xFFFC'', each one is aligned to the nearest 4 bytes. |
==Variables== | ==Variables== | ||
Line 908: | Line 950: | ||
{|class=wikitable style=text-align:center | {|class=wikitable style=text-align:center | ||
− | ! | + | !Context |
!width=50px|{{icon|3}} | !width=50px|{{icon|3}} | ||
!width=50px|{{icon|vc}} | !width=50px|{{icon|vc}} | ||
Line 921: | Line 963: | ||
|align=left|[[#Mission scripts|Mission script]]||0-15||0-15||0-1023||0-95||0-95 | |align=left|[[#Mission scripts|Mission script]]||0-15||0-15||0-1023||0-95||0-95 | ||
|- | |- | ||
− | |align=left|[[# | + | |align=left|[[#Streamed scripts|Streamed script]]||n/a||n/a||0-31||n/a||n/a |
|- | |- | ||
|align=left|[[#Functions|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 | ||
Line 927: | Line 969: | ||
!colspan=6| | !colspan=6| | ||
|- | |- | ||
− | |align=left|[[#Timers|Timer]]||16-17||16-17||32-33|| | + | |align=left|[[#Timers|Timer]]||16-17||16-17||32-33||t0-t1||t0-t1 |
|} | |} | ||
Line 940: | Line 982: | ||
!width=180px|Composition | !width=180px|Composition | ||
|- | |- | ||
− | !rowspan=2| | + | !rowspan=2|++ |
|align=center rowspan=2|Increment | |align=center rowspan=2|Increment | ||
|align=center|Pre | |align=center|Pre | ||
Line 949: | Line 991: | ||
|align=center|<code>expr0 '''++'''</code> | |align=center|<code>expr0 '''++'''</code> | ||
|- | |- | ||
− | !rowspan=2| | + | !rowspan=2|-- |
|align=center rowspan=2|Decrement | |align=center rowspan=2|Decrement | ||
|align=center|Pre | |align=center|Pre | ||
Line 958: | Line 1,000: | ||
|align=center|<code>expr0 '''--'''</code> | |align=center|<code>expr0 '''--'''</code> | ||
|- | |- | ||
− | ! | + | != + |
|align=center colspan=2|Addition and assignment | |align=center colspan=2|Addition and assignment | ||
|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> | ||
|- | |- | ||
− | ! | + | != - |
|align=center colspan=2|Subtraction and assignment | |align=center colspan=2|Subtraction and assignment | ||
|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> | ||
|- | |- | ||
− | ! | + | != * |
|align=center colspan=2|Multiplication and assignment | |align=center colspan=2|Multiplication and assignment | ||
|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> | ||
|- | |- | ||
− | ! | + | != / |
|align=center colspan=2|Division and assignment | |align=center colspan=2|Division and assignment | ||
|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> | ||
|- | |- | ||
− | ! | + | != +@ |
|align=center colspan=2|Timed addition and assignment | |align=center colspan=2|Timed addition and assignment | ||
|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> | ||
|- | |- | ||
− | ! | + | != -@ |
|align=center colspan=2|Timed subtraction and assignment | |align=center colspan=2|Timed subtraction and assignment | ||
|align=center|<code>expr0 '''=''' expr1 '''-@''' expr2</code> | |align=center|<code>expr0 '''=''' expr1 '''-@''' expr2</code> | ||
Line 991: | Line 1,033: | ||
==Opcodes== | ==Opcodes== | ||
− | An ''opcode'' is a '' | + | An ''opcode'' is a ''set of instructions to be performed'' the game executes by passing an undefined or absent amount of ''arguments''. It is assigned to a ''16-bit unsigned integer'' special ID. 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]], just to make things clear). |
===Arguments=== | ===Arguments=== | ||
− | An ''argument'' is some data given as input to | + | An ''argument'' is some data given as input to a command. Normally, commands have a defined amount of arguments and 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: ''16'' for {{icon|3}} and {{icon|vc}}, ''32'' for {{icon|sa}}, ''96'' for {{icon|lcs}} and {{icon|vcs}}. |
===Specials=== | ===Specials=== | ||
Line 1,002: | Line 1,044: | ||
'''Legend:''' | '''Legend:''' | ||
− | * ''' | + | * '''Declaration:''' |
− | ** | + | ** @, [[#Declaration|DECL]] |
− | ** | + | * '''Scope:''' |
− | ** L, [[#Local| | + | ** (none), [[#Value|VAL]] |
− | + | ** V, [[#Global|VAR]] | |
− | * ''' | + | ** L, [[#Local|LVAR]] |
+ | ** H, [[#Scope|HOLD]] (VAR, LVAR) | ||
+ | ** *, ANY (VAL, VAR, LVAR) | ||
+ | * '''Datatype:''' | ||
+ | ** O, [[#LABEL|LABEL]] | ||
** I, [[#INT|INT]] | ** I, [[#INT|INT]] | ||
** F, [[#FLOAT|FLOAT]] | ** F, [[#FLOAT|FLOAT]] | ||
− | ** | + | ** S, (TEXT): |
− | ** | + | *** 8, [[#TEXT_LABEL|TEXT_LABEL]] |
− | ** | + | *** 16, [[#TEXT_LABEL16|TEXT_LABEL16]] |
− | ** | + | *** 32, [[#TEXT_BUFFER|TEXT_BUFFER]] |
− | ** | + | *** N, [[#TEXT_VARLEN|TEXT_VARLEN]] |
− | ** | + | ** T, [[#T (pseudo)|T (pseudo)]] |
− | ** | + | ** C, [[#CONST (pseudo)|CONST (pseudo)]] |
− | |||
'''List:''' | '''List:''' | ||
{|class="mw-collapsible mw-collapsed wikitable" style=text-align:center | {|class="mw-collapsible mw-collapsed wikitable" style=text-align:center | ||
− | !rowspan= | + | !rowspan=3 colspan=2|Command |
− | !rowspan= | + | !rowspan=3|ID |
− | !rowspan= | + | !rowspan=3|Arg.<br/># |
− | !colspan= | + | !colspan=8|Arguments |
+ | |- | ||
+ | !width=45px rowspan=2|1 | ||
+ | !width=45px rowspan=2|2 | ||
+ | !width=45px rowspan=2|3 | ||
+ | !width=45px rowspan=2|4 | ||
+ | !width=45px rowspan=2|... | ||
+ | !width=45px rowspan=2|18 | ||
+ | !width=45px rowspan=2|... | ||
+ | !width=45px|n+l | ||
|- | |- | ||
− | ! | + | !n+i+o |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | |colspan= | + | |colspan=12|{{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= | + | |colspan=8| |
|- | |- | ||
!colspan=2|GOTO{{ref|statem|[*]}} | !colspan=2|GOTO{{ref|statem|[*]}} | ||
|0002 | |0002 | ||
!1 | !1 | ||
− | | | + | |O||colspan=7| |
|- | |- | ||
− | |colspan= | + | |colspan=12|{{icon|3}} {{icon|vc}} {{icon|sa}} {{icon|lcs}} |
|- | |- | ||
− | !rowspan= | + | !rowspan=12|=<br/>SET!!SET_VAR_INT |
|0004 | |0004 | ||
− | !rowspan= | + | !rowspan=12|2 |
− | | | + | |VI||I||colspan=6| |
|- | |- | ||
!SET_VAR_FLOAT | !SET_VAR_FLOAT | ||
− | |0005|| | + | |0005||VF||F||colspan=6| |
|- | |- | ||
!SET_LVAR_INT | !SET_LVAR_INT | ||
− | |0006||LI|| | + | |0006||LI||I||colspan=6| |
|- | |- | ||
!SET_LVAR_FLOAT | !SET_LVAR_FLOAT | ||
− | |0007||LF|| | + | |0007||LF||F||colspan=6| |
|- | |- | ||
− | ! | + | !SET_VAR_INT_TO_VAR_INT |
− | | | + | |0084||VI||VI||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !SET_LVAR_INT_TO_LVAR_INT |
− | | | + | |0085||LI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !SET_VAR_FLOAT_TO_VAR_FLOAT |
− | | | + | |0086||VF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !SET_LVAR_FLOAT_TO_LVAR_FLOAT |
− | | | + | |0087||LF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !SET_VAR_FLOAT_TO_LVAR_FLOAT |
− | | | + | |0088||VF||LF||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !SET_LVAR_FLOAT_TO_VAR_FLOAT |
− | | | + | |0089||LF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !SET_VAR_INT_TO_LVAR_INT |
− | | | + | |008A||VI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !SET_LVAR_INT_TO_VAR_INT |
− | | | + | |008B||LI||VI||colspan=6| |
|- | |- | ||
− | !rowspan= | + | !rowspan=12|+=<br/>+<br/>ADD_THING_TO_THING!!ADD_VAL_TO_INT_VAR |
− | | | + | |0008 |
− | !rowspan= | + | !rowspan=12|2 |
− | | | + | |VI||I||colspan=6| |
|- | |- | ||
− | ! | + | !ADD_VAL_TO_FLOAT_VAR |
− | | | + | |0009||VF||F||colspan=6| |
|- | |- | ||
− | ! | + | !ADD_VAL_TO_INT_LVAR |
− | | | + | |000A||LI||I||colspan=6| |
|- | |- | ||
− | ! | + | !ADD_VAL_TO_FLOAT_LVAR |
− | | | + | |000B||LF||F||colspan=6| |
|- | |- | ||
− | ! | + | !ADD_INT_VAR_TO_INT_VAR |
− | | | + | |0058||VI||VI||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !ADD_FLOAT_VAR_TO_FLOAT_VAR |
− | | | + | |0059||VF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !ADD_INT_LVAR_TO_INT_LVAR |
− | | | + | |005A||LI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !ADD_FLOAT_LVAR_TO_FLOAT_LVAR |
− | | | + | |005B||LF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !ADD_INT_VAR_TO_INT_LVAR |
− | | | + | |005C||LI||VI||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !ADD_FLOAT_VAR_TO_FLOAT_LVAR |
− | | | + | |005D||LF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !ADD_INT_LVAR_TO_INT_VAR |
− | | | + | |005E||VI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !ADD_FLOAT_LVAR_TO_FLOAT_VAR |
− | | | + | |005F||VF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !rowspan=12|-=<br/>-<br/>SUB_THING_FROM_THING!!SUB_VAL_FROM_INT_VAR |
− | | | + | |000C |
+ | !rowspan=12|2 | ||
+ | |VI||I||colspan=6| | ||
|- | |- | ||
− | ! | + | !SUB_VAL_FROM_FLOAT_VAR |
− | | | + | |000D||VF||F||colspan=6| |
|- | |- | ||
− | ! | + | !SUB_VAL_FROM_INT_LVAR |
− | | | + | |000E||LI||I||colspan=6| |
|- | |- | ||
− | ! | + | !SUB_VAL_FROM_FLOAT_LVAR |
− | | | + | |000F||LF||F||colspan=6| |
|- | |- | ||
− | ! | + | !SUB_INT_VAR_FROM_INT_VAR |
− | | | + | |0060||VI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !SUB_FLOAT_VAR_FROM_FLOAT_VAR |
− | | | + | |0061||VF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !SUB_INT_LVAR_FROM_INT_LVAR |
− | | | + | |0062||LI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !SUB_FLOAT_LVAR_FROM_FLOAT_LVAR |
− | | | + | |0063||LF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !SUB_INT_VAR_FROM_INT_LVAR |
− | | | + | |0064||LI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !SUB_FLOAT_VAR_FROM_FLOAT_LVAR |
− | | | + | |0065||LF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !SUB_INT_LVAR_FROM_INT_VAR |
− | | | + | |0066||VI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !SUB_FLOAT_LVAR_FROM_FLOAT_VAR |
− | | | + | |0067||VF||LF||colspan=6| |
|- | |- | ||
− | !rowspan= | + | !rowspan=12|*=<br/>*<br/>MULT_THING_BY_THING!!MULT_INT_VAR_BY_VAL |
− | | | + | |0010 |
− | !rowspan= | + | !rowspan=12|2 |
− | | | + | |VI||I||colspan=6| |
|- | |- | ||
− | ! | + | !MULT_FLOAT_VAR_BY_VAL |
− | | | + | |0011||VF||F||colspan=6| |
|- | |- | ||
− | ! | + | !MULT_INT_LVAR_BY_VAL |
− | | | + | |0012||LI||I||colspan=6| |
|- | |- | ||
− | ! | + | !MULT_FLOAT_LVAR_BY_VAL |
− | | | + | |0013||LF||F||colspan=6| |
|- | |- | ||
− | ! | + | !MULT_INT_VAR_BY_INT_VAR |
− | | | + | |0068||VI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !MULT_FLOAT_VAR_BY_FLOAT_VAR |
− | | | + | |0069||VF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !MULT_INT_LVAR_BY_INT_LVAR |
− | | | + | |006A||LI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !MULT_FLOAT_LVAR_BY_FLOAT_LVAR |
− | | | + | |006B||LF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !MULT_INT_VAR_BY_INT_LVAR |
− | | | + | |006C||VI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !MULT_FLOAT_VAR_BY_FLOAT_LVAR |
− | | | + | |006D||VF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !MULT_INT_LVAR_BY_INT_VAR |
− | | | + | |006E||LI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !MULT_FLOAT_LVAR_BY_FLOAT_VAR |
− | | | + | |006F||LF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !rowspan=12|/=<br/>/<br/>DIV_THING_BY_THING!!DIV_INT_BY_VAL |
− | | | + | |0014 |
+ | !rowspan=12|2 | ||
+ | |VI||I||colspan=6| | ||
|- | |- | ||
− | ! | + | !DIV_FLOAT_VAR_BY_VAL |
− | | | + | |0015||VF||F||colspan=6| |
|- | |- | ||
− | ! | + | !DIV_INT_LVAR_BY_VAL |
− | | | + | |0016||LI||I||colspan=6| |
|- | |- | ||
− | ! | + | !DIV_FLOAT_LVAR_BY_VAL |
− | | | + | |0017||LF||F||colspan=6| |
|- | |- | ||
− | ! | + | !DIV_INT_VAR_BY_INT_VAR |
− | | | + | |0070||VI||VI||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !DIV_FLOAT_VAR_BY_FLOAT_VAR |
− | | | + | |0071||VF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !DIV_INT_LVAR_BY_INT_LVAR |
− | | | + | |0072||LI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !DIV_FLOAT_LVAR_BY_FLOAT_LVAR |
− | | | + | |0073||LF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !DIV_INT_VAR_BY_INT_LVAR |
− | | | + | |0074||VI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !DIV_FLOAT_VAR_BY_FLOAT_LVAR |
− | | | + | |0075||VF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !DIV_INT_LVAR_BY_INT_VAR |
− | | | + | |0076||LI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !DIV_FLOAT_LVAR_BY_FLOAT_VAR |
− | | | + | |0077||LF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !rowspan=16|><br/>IS_THING_GREATER_THAN_THING!!IS_INT_VAR_GREATER_THAN_NUMBER |
− | | | + | |0018 |
+ | !rowspan=16|2 | ||
+ | |VI||I||colspan=6| | ||
|- | |- | ||
− | ! | + | !IS_INT_LVAR_GREATER_THAN_NUMBER |
− | | | + | |0019||LI||I||colspan=6| |
|- | |- | ||
− | ! | + | !IS_NUMBER_GREATER_THAN_INT_VAR |
− | | | + | |001A||I||VI||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !IS_NUMBER_GREATER_THAN_INT_LVAR |
− | | | + | |001B||I||LI||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | !colspan= | + | !IS_INT_VAR_GREATER_THAN_INT_VAR |
+ | |001C||VI||VI||colspan=6| | ||
|- | |- | ||
− | ! | + | !IS_INT_LVAR_GREATER_THAN_INT_LVAR |
− | | | + | |001D||LI||LI||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !IS_INT_VAR_GREATER_THAN_INT_LVAR |
− | | | + | |001E||VI||LI||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !IS_INT_LVAR_GREATER_THAN_INT_VAR |
− | | | + | |001F||LI||VI||colspan=6| |
− | |||
− | |colspan= | ||
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_GREATER_THAN_NUMBER |
− | | | + | |0020||VF||F||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !IS_FLOAT_LVAR_GREATER_THAN_NUMBER |
− | | | + | |0021||LF||F||colspan=6| |
|- | |- | ||
− | ! | + | !IS_NUMBER_GREATER_THAN_FLOAT_VAR |
− | | | + | |0022||F||VF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_NUMBER_GREATER_THAN_FLOAT_LVAR |
− | | | + | |0023||F||LF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_GREATER_THAN_FLOAT_VAR |
− | | | + | |0024||VF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_LVAR_GREATER_THAN_FLOAT_LVAR |
− | | | + | |0025||LF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_GREATER_THAN_FLOAT_LVAR |
− | | | + | |0026||VF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_LVAR_GREATER_THAN_FLOAT_VAR |
− | | | + | |0027||LF||VF||colspan=6| |
|- | |- | ||
− | !rowspan= | + | !rowspan=16|>=<br/>IS_THING_GREATER_OR_EQUAL_TO_THING!!IS_INT_VAR_GREATER_OR_EQUAL_TO_NUMBER |
− | | | + | |0028 |
− | !rowspan= | + | !rowspan=16|2 |
− | | | + | |VI||I||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_LVAR_GREATER_OR_EQUAL_TO_NUMBER |
− | | | + | |0029||LI||I||colspan=6| |
|- | |- | ||
− | ! | + | !IS_NUMBER_GREATER_OR_EQUAL_TO_INT_VAR |
− | | | + | |002A||I||VI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_NUMBER_GREATER_OR_EQUAL_TO_INT_LVAR |
− | | | + | |002B||I||LI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_VAR |
− | | | + | |002C||VI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_LVAR |
− | | | + | |002D||LI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_LVAR |
− | | | + | |002E||VI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_VAR |
− | | | + | |002F||LI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_NUMBER |
− | | | + | |0030||VF||F||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_NUMBER |
− | | | + | |0031||LF||F||colspan=6| |
|- | |- | ||
− | ! | + | !IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_VAR |
− | | | + | |0032||F||VF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_LVAR |
− | | | + | |0033||F||LF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_VAR |
− | | | + | |0034||VF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR |
− | | | + | |0035||LF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR |
− | | | + | |0036||VF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_VAR |
− | | | + | |0037||LF||VF||colspan=6| |
|- | |- | ||
− | !rowspan= | + | !rowspan=10|=<br/>IS_THING_EQUAL_TO_THING!!IS_INT_VAR_EQUAL_TO_NUMBER |
− | | | + | |0038 |
− | !rowspan= | + | !rowspan=10|2 |
− | | | + | |VI||I||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_LVAR_EQUAL_TO_NUMBER |
− | | | + | |0039||LI||I||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_VAR_EQUAL_TO_INT_VAR |
− | | | + | |003A||VI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_LVAR_EQUAL_TO_INT_LVAR |
− | | | + | |003B||LI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_VAR_EQUAL_TO_INT_LVAR |
− | | | + | |003C||VI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_EQUAL_TO_NUMBER |
− | | | + | |0042||VF||F||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_LVAR_EQUAL_TO_NUMBER |
− | | | + | |0043||LF||F||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_EQUAL_TO_FLOAT_VAR |
− | | | + | |0044||VF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_LVAR_EQUAL_TO_FLOAT_LVAR |
− | | | + | |0045||LF||LF||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_EQUAL_TO_FLOAT_LVAR |
− | | | + | |0046||VF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !rowspan=10|NOT =<br/>IS_THING_NOT_EQUAL_TO_THING!!IS_INT_VAR_NOT_EQUAL_TO_NUMBER |
− | | | + | |003D |
+ | !rowspan=10|2 | ||
+ | |VI||I||colspan=6| | ||
|- | |- | ||
− | ! | + | !IS_INT_LVAR_NOT_EQUAL_TO_NUMBER |
− | | | + | |003E||LI||I||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_VAR_NOT_EQUAL_TO_INT_VAR |
− | | | + | |003F||VI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_LVAR_NOT_EQUAL_TO_INT_LVAR |
− | | | + | |0040||LI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_INT_VAR_NOT_EQUAL_TO_INT_LVAR |
− | | | + | |0041||VI||LI||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_NOT_EQUAL_TO_NUMBER |
− | | | + | |0047||VF||F||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_LVAR_NOT_EQUAL_TO_NUMBER |
− | | | + | |0048||LF||F||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_NOT_EQUAL_TO_FLOAT_VAR |
− | | | + | |0049||VF||VF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_LVAR_NOT_EQUAL_TO_FLOAT_LVAR |
− | | | + | |004A||LF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !IS_FLOAT_VAR_NOT_EQUAL_TO_FLOAT_LVAR |
− | | | + | |004B||VF||LF||colspan=6| |
|- | |- | ||
− | ! | + | !colspan=2|GOTO_IF_FALSE{{ref|statem|[*]}} |
− | | | + | |004D |
− | ! | + | !1 |
− | | | + | |O||colspan=7| |
|- | |- | ||
− | ! | + | !colspan=2|TERMINATE_THIS_SCRIPT |
− | | | + | |rowspan=2|004E |
+ | !rowspan=2|0 | ||
+ | |rowspan=2 colspan=8| | ||
|- | |- | ||
− | ! | + | !colspan=2|MISSION_END |
− | |||
|- | |- | ||
− | ! | + | !colspan=2|START_NEW_SCRIPT{{ref|undarg|[*]}} |
− | | | + | |004F |
+ | !1+l | ||
+ | |O||colspan=7|*T | ||
|- | |- | ||
− | ! | + | !colspan=2|GOSUB |
− | | | + | |0050 |
+ | !1 | ||
+ | |O||colspan=7| | ||
|- | |- | ||
− | ! | + | !colspan=2|RETURN |
− | | | + | |0051 |
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | ! | + | !rowspan=6|+=@<br/>+@<br/>ADD_THING_TO_THING_TIMED!!ADD_TIMED_VAL_TO_FLOAT_VAR |
− | | | + | |0078 |
+ | !rowspan=6|2 | ||
+ | |VF||F||colspan=6| | ||
|- | |- | ||
− | ! | + | !ADD_TIMED_VAL_TO_FLOAT_LVAR |
− | | | + | |0079||LF||F||colspan=6| |
|- | |- | ||
− | !rowspan=8|=#!!CSET_VAR_INT_TO_VAR_FLOAT | + | !ADD_TIMED_FLOAT_VAR_TO_FLOAT_VAR |
− | |008C | + | |007A||VF||VF||colspan=6| |
− | !rowspan=8|2 | + | |- |
− | | | + | !ADD_TIMED_FLOAT_LVAR_TO_FLOAT_LVAR |
+ | |007B||LF||LF||colspan=6| | ||
+ | |- | ||
+ | !ADD_TIMED_FLOAT_LVAR_TO_FLOAT_VAR | ||
+ | |007C||LF||VF||colspan=6| | ||
+ | |- | ||
+ | !ADD_TIMED_FLOAT_VAR_TO_FLOAT_LVAR | ||
+ | |007D||VF||LF||colspan=6| | ||
+ | |- | ||
+ | !rowspan=6|-=@<br/>-@<br/>SUB_THING_FROM_THING_TIMED!!SUB_TIMED_VAL_FROM_FLOAT_VAR | ||
+ | |007E | ||
+ | !rowspan=6|2 | ||
+ | |VF||F||colspan=6| | ||
+ | |- | ||
+ | !SUB_TIMED_VAL_FROM_FLOAT_LVAR | ||
+ | |007F||LF||F||colspan=6| | ||
+ | |- | ||
+ | !SUB_TIMED_FLOAT_VAR_FROM_FLOAT_VAR | ||
+ | |0080||VF||VF||colspan=6| | ||
+ | |- | ||
+ | !SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_LVAR | ||
+ | |0081||LF||LF||colspan=6| | ||
+ | |- | ||
+ | !SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_VAR | ||
+ | |0082||LF||VF||colspan=6| | ||
+ | |- | ||
+ | !SUB_TIMED_FLOAT_VAR_FROM_FLOAT_LVAR | ||
+ | |0083||VF||LF||colspan=6| | ||
+ | |- | ||
+ | !rowspan=8|=#<br/>CSET<br/>!!CSET_VAR_INT_TO_VAR_FLOAT | ||
+ | |008C | ||
+ | !rowspan=8|2 | ||
+ | |VI||VF||colspan=6| | ||
|- | |- | ||
!CSET_VAR_FLOAT_TO_VAR_INT | !CSET_VAR_FLOAT_TO_VAR_INT | ||
− | |008D|| | + | |008D||VF||VI||colspan=6| |
|- | |- | ||
!CSET_LVAR_INT_TO_VAR_FLOAT | !CSET_LVAR_INT_TO_VAR_FLOAT | ||
− | |008E||LI|| | + | |008E||LI||VF||colspan=6| |
|- | |- | ||
!CSET_LVAR_FLOAT_TO_VAR_INT | !CSET_LVAR_FLOAT_TO_VAR_INT | ||
− | |008F||LF|| | + | |008F||LF||VI||colspan=6| |
|- | |- | ||
!CSET_VAR_INT_TO_LVAR_FLOAT | !CSET_VAR_INT_TO_LVAR_FLOAT | ||
− | |0090|| | + | |0090||VI||LF||colspan=6| |
|- | |- | ||
!CSET_VAR_FLOAT_TO_LVAR_INT | !CSET_VAR_FLOAT_TO_LVAR_INT | ||
− | |0091|| | + | |0091||VF||LI||colspan=6| |
|- | |- | ||
!CSET_LVAR_INT_TO_LVAR_FLOAT | !CSET_LVAR_INT_TO_LVAR_FLOAT | ||
− | |0092||LI||LF||colspan= | + | |0092||LI||LF||colspan=6| |
|- | |- | ||
!CSET_LVAR_FLOAT_TO_LVAR_INT | !CSET_LVAR_FLOAT_TO_LVAR_INT | ||
− | |0093||LF||LI||colspan= | + | |0093||LF||LI||colspan=6| |
|- | |- | ||
!rowspan=4|ABS!!ABS_VAR_INT | !rowspan=4|ABS!!ABS_VAR_INT | ||
|0094 | |0094 | ||
!rowspan=4|1 | !rowspan=4|1 | ||
− | | | + | |VI||colspan=7| |
|- | |- | ||
!ABS_LVAR_INT | !ABS_LVAR_INT | ||
− | |0095||LI||colspan= | + | |0095||LI||colspan=7| |
|- | |- | ||
!ABS_VAR_FLOAT | !ABS_VAR_FLOAT | ||
− | |0096|| | + | |0096||VF||colspan=7| |
|- | |- | ||
!ABS_LVAR_FLOAT | !ABS_LVAR_FLOAT | ||
− | |0097||LF||colspan= | + | |0097||LF||colspan=7| |
|- | |- | ||
− | !colspan=2| | + | !colspan=2|VAR_INT{{ref|defvar|[*]}} |
− | | | + | |00C7 |
− | ! | + | !n |
− | + | |colspan=8|@VI | |
|- | |- | ||
− | !colspan=2| | + | !colspan=2|VAR_FLOAT{{ref|defvar|[*]}} |
− | | | + | |00C8 |
− | ! | + | !n |
− | + | |colspan=8|@VF | |
|- | |- | ||
− | + | !colspan=2|LVAR_INT{{ref|defvar|[*]}} | |
+ | |00C9 | ||
+ | !n | ||
+ | |colspan=8|@LI | ||
|- | |- | ||
− | !colspan=2|PLAYER_MADE_PROGRESS | + | !colspan=2|LVAR_FLOAT{{ref|defvar|[*]}} |
− | |030C | + | |00CA |
− | !1 | + | !n |
− | | | + | |colspan=8|@LF |
+ | |- | ||
+ | !colspan=2|{{{ref|embdsc|[*]}} | ||
+ | |00CB | ||
+ | !0 | ||
+ | |colspan=8| | ||
+ | |- | ||
+ | !colspan=2|}{{ref|embdsc|[*]}} | ||
+ | |00CC | ||
+ | !0 | ||
+ | |colspan=8| | ||
+ | |- | ||
+ | !colspan=2|IF{{ref|statem|[*]}} | ||
+ | |00CF | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
+ | |- | ||
+ | !colspan=2|ELSE{{ref|statem|[*]}} | ||
+ | |00D1 | ||
+ | !0 | ||
+ | |colspan=8| | ||
+ | |- | ||
+ | !colspan=2|ENDIF{{ref|statem|[*]}} | ||
+ | |00D2 | ||
+ | !0 | ||
+ | |colspan=8| | ||
+ | |- | ||
+ | !colspan=2|WHILE{{ref|statem|[*]}} | ||
+ | |00D3 | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
+ | |- | ||
+ | !colspan=2|ENDWHILE{{ref|statem|[*]}} | ||
+ | |00D5 | ||
+ | !0 | ||
+ | |colspan=8| | ||
+ | |- | ||
+ | |colspan=12|{{icon|3}} {{icon|vc}} {{icon|sa}} | ||
+ | |- | ||
+ | !colspan=2|ANDOR{{ref|statem|[*]}} | ||
+ | |00D6 | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
+ | |- | ||
+ | !colspan=2|LAUNCH_MISSION | ||
+ | |00D7 | ||
+ | !1 | ||
+ | |O||colspan=7| | ||
+ | |- | ||
+ | !colspan=2|PLAYER_MADE_PROGRESS | ||
+ | |030C | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
|- | |- | ||
!colspan=2|SET_PROGRESS_TOTAL | !colspan=2|SET_PROGRESS_TOTAL | ||
|030D | |030D | ||
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
!colspan=2|REGISTER_MISSION_GIVEN | !colspan=2|REGISTER_MISSION_GIVEN | ||
|0317 | |0317 | ||
!0 | !0 | ||
− | |colspan= | + | |colspan=8| |
|- | |- | ||
!colspan=2|REGISTER_MISSION_PASSED | !colspan=2|REGISTER_MISSION_PASSED | ||
|0318 | |0318 | ||
!1 | !1 | ||
− | | | + | |S8||colspan=7| |
|- | |- | ||
!colspan=2|SCRIPT_NAME | !colspan=2|SCRIPT_NAME | ||
|03A4 | |03A4 | ||
!1 | !1 | ||
− | | | + | |S8||colspan=7| |
|- | |- | ||
!colspan=2|LOAD_AND_LAUNCH_MISSION | !colspan=2|LOAD_AND_LAUNCH_MISSION | ||
|0416 | |0416 | ||
!1 | !1 | ||
− | | | + | |O||colspan=7| |
|- | |- | ||
!colspan=2|LOAD_AND_LAUNCH_MISSION_INTERNAL | !colspan=2|LOAD_AND_LAUNCH_MISSION_INTERNAL | ||
|0417 | |0417 | ||
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
!colspan=2|SET_TOTAL_NUMBER_OF_MISSIONS | !colspan=2|SET_TOTAL_NUMBER_OF_MISSIONS | ||
|042C | |042C | ||
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
!colspan=2|REGISTER_ODDJOB_MISSION_PASSED | !colspan=2|REGISTER_ODDJOB_MISSION_PASSED | ||
|0595 | |0595 | ||
!0 | !0 | ||
− | |colspan= | + | |colspan=8| |
+ | |- | ||
+ | |colspan=12|{{icon|vc}} {{icon|sa}} {{icon|lcs}} | ||
|- | |- | ||
− | |colspan= | + | !colspan=2|REPEAT{{ref|statem|[*]}} |
+ | |00CD | ||
+ | !2 | ||
+ | |I||HI||colspan=6| | ||
+ | |- | ||
+ | !colspan=2|ENDREPEAT{{ref|statem|[*]}} | ||
+ | |00CE | ||
+ | !0 | ||
+ | |colspan=8| | ||
+ | |- | ||
+ | |colspan=12|{{icon|3}} {{icon|vc}} | ||
|- | |- | ||
!colspan=2|CREATE_COLLECTABLE1 | !colspan=2|CREATE_COLLECTABLE1 | ||
|02EC | |02EC | ||
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
!colspan=2|SET_COLLECTABLE1_TOTAL | !colspan=2|SET_COLLECTABLE1_TOTAL | ||
|02ED | |02ED | ||
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
− | |colspan= | + | |colspan=12|{{icon|3}} {{icon|lcs}} |
|- | |- | ||
!colspan=2|GOTO_IF_TRUE{{ref|statem|[*]}} | !colspan=2|GOTO_IF_TRUE{{ref|statem|[*]}} | ||
|004C | |004C | ||
!1 | !1 | ||
− | | | + | |O||colspan=7| |
|- | |- | ||
− | |colspan= | + | |colspan=12|{{icon|vc}} {{icon|sa}} |
|- | |- | ||
− | !rowspan= | + | !rowspan=2|=<br/>IS_THING_EQUAL_TO_THING!!IS_INT_VAR_EQUAL_TO_CONSTANT |
|04A3 | |04A3 | ||
− | !rowspan= | + | !rowspan=2|2 |
− | | | + | |VI||C||colspan=6| |
|- | |- | ||
!IS_INT_LVAR_EQUAL_TO_CONSTANT | !IS_INT_LVAR_EQUAL_TO_CONSTANT | ||
− | |04A4|| | + | |04A4||LI||C||colspan=6| |
|- | |- | ||
− | !SET_VAR_INT_TO_CONSTANT | + | !rowspan=2|=<br/>SET!!SET_VAR_INT_TO_CONSTANT |
− | |04AE|| | + | |04AE |
+ | !rowspan=2|2 | ||
+ | |VI||C||colspan=6| | ||
|- | |- | ||
!SET_LVAR_INT_TO_CONSTANT | !SET_LVAR_INT_TO_CONSTANT | ||
− | |04AF|| | + | |04AF||LI||C||colspan=6| |
|- | |- | ||
− | !rowspan=4|>!!IS_INT_VAR_GREATER_THAN_CONSTANT | + | !rowspan=4|><br/>IS_THING_GREATER_THAN_THING!!IS_INT_VAR_GREATER_THAN_CONSTANT |
|04B0 | |04B0 | ||
!rowspan=4|2 | !rowspan=4|2 | ||
− | | | + | |VI||C||colspan=6| |
|- | |- | ||
!IS_INT_LVAR_GREATER_THAN_CONSTANT | !IS_INT_LVAR_GREATER_THAN_CONSTANT | ||
− | |04B1|| | + | |04B1||LI||C||colspan=6| |
|- | |- | ||
!IS_CONSTANT_GREATER_THAN_INT_VAR | !IS_CONSTANT_GREATER_THAN_INT_VAR | ||
− | |04B2 | + | |04B2||C||VI||colspan=6| |
− | | | ||
|- | |- | ||
!IS_CONSTANT_GREATER_THAN_INT_LVAR | !IS_CONSTANT_GREATER_THAN_INT_LVAR | ||
− | |04B3|| | + | |04B3||C||LI||colspan=6| |
|- | |- | ||
− | !rowspan=4|>=!!IS_INT_VAR_GREATER_OR_EQUAL_TO_CONSTANT | + | !rowspan=4|>=<br/>IS_THING_GREATER_OR_EQUAL_TO_THING!!IS_INT_VAR_GREATER_OR_EQUAL_TO_CONSTANT |
|04B4 | |04B4 | ||
!rowspan=4|2 | !rowspan=4|2 | ||
− | | | + | |VI||C||colspan=6| |
|- | |- | ||
!IS_INT_LVAR_GREATER_OR_EQUAL_TO_CONSTANT | !IS_INT_LVAR_GREATER_OR_EQUAL_TO_CONSTANT | ||
− | |04B5|| | + | |04B5||LI||C||colspan=6| |
|- | |- | ||
!IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR | !IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR | ||
− | |04B6 | + | |04B6||C||VI||colspan=6| |
− | | | ||
|- | |- | ||
!IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_LVAR | !IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_LVAR | ||
− | |04B7|| | + | |04B7||C||LI||colspan=6| |
|- | |- | ||
!colspan=2|LOAD_AND_LAUNCH_MISSION_EXCLUSIVE | !colspan=2|LOAD_AND_LAUNCH_MISSION_EXCLUSIVE | ||
|0515 | |0515 | ||
!1 | !1 | ||
− | | | + | |O||colspan=7| |
+ | |- | ||
+ | |colspan=12|{{icon|3}} | ||
+ | |- | ||
+ | !colspan=2|IFNOT{{ref|statem|[*]}} | ||
+ | |00D0 | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
|- | |- | ||
− | + | !colspan=2|WHILENOT{{ref|statem|[*]}} | |
+ | |00D4 | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
|- | |- | ||
!colspan=2|GOSUB_FILE | !colspan=2|GOSUB_FILE | ||
|02CD | |02CD | ||
!2 | !2 | ||
− | | | + | |O||O||colspan=6| |
+ | |- | ||
+ | |colspan=12|{{icon|sa}} | ||
|- | |- | ||
− | |colspan= | + | !rowspan=2|=<br/>SET!!SET_VAR_TEXT_LABEL |
+ | |05A9 | ||
+ | !rowspan=2|2 | ||
+ | |VS8||*S8||colspan=6| | ||
|- | |- | ||
− | ! | + | !SET_LVAR_TEXT_LABEL |
− | | | + | |05AA||LS8||*S8||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | | | + | !colspan=2|VAR_TEXT_LABEL{{ref|defvar|[*]}} |
+ | |05AB | ||
+ | !n | ||
+ | |colspan=8|@VS8 | ||
|- | |- | ||
− | | | + | !colspan=2|LVAR_TEXT_LABEL{{ref|defvar|[*]}} |
+ | |05AC | ||
+ | !n | ||
+ | |colspan=8|@LS8 | ||
|- | |- | ||
− | !rowspan= | + | !rowspan=2|=<br/>IS_THING_EQUAL_TO_THING!!IS_VAR_TEXT_LABEL_EQUAL_TO_TEXT_LABEL |
− | + | |05AD | |
− | | | + | !rowspan=2|2 |
+ | |VS8||*S8||colspan=6| | ||
|- | |- | ||
− | | | + | !IS_LVAR_TEXT_LABEL_EQUAL_TO_TEXT_LABEL |
+ | |05AE||LS8||*S8||colspan=6| | ||
|- | |- | ||
− | | | + | !rowspan=2|=<br/>SET!!SET_VAR_TEXT_LABEL16 |
+ | |06D1 | ||
+ | !rowspan=2|2 | ||
+ | |VS16||*S16||colspan=6| | ||
|- | |- | ||
− | ! | + | !SET_LVAR_TEXT_LABEL16 |
− | | | + | |06D2||LS16||*S16||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !colspan=2|VAR_TEXT_LABEL16{{ref|defvar|[*]}} |
+ | |06D3 | ||
+ | !n | ||
+ | |colspan=8|@VS16 | ||
|- | |- | ||
− | | | + | !colspan=2|LVAR_TEXT_LABEL16{{ref|defvar|[*]}} |
+ | |06D4 | ||
+ | !n | ||
+ | |colspan=8|@LS16 | ||
|- | |- | ||
− | !rowspan= | + | !rowspan=2|=<br/>IS_THING_EQUAL_TO_THING!!IS_INT_LVAR_EQUAL_TO_INT_VAR |
− | + | |07D6 | |
− | | | + | !rowspan=2|2 |
+ | |LI||VI||colspan=6| | ||
|- | |- | ||
− | | | + | !IS_FLOAT_LVAR_EQUAL_TO_FLOAT_VAR |
+ | |07D7||LF||VF||colspan=6| | ||
|- | |- | ||
− | | | + | !rowspan=4|IS_EMPTY{{ref|likely|[*]}}!!IS_VAR_TEXT_LABEL_EMPTY |
+ | |0844 | ||
+ | !rowspan=4|1 | ||
+ | |VS8||colspan=7| | ||
|- | |- | ||
− | ! | + | !IS_LVAR_TEXT_LABEL_EMPTY |
− | + | |0845||LS8||colspan=7| | |
− | | | ||
|- | |- | ||
− | | | + | !IS_VAR_TEXT_LABEL16_EMPTY |
+ | |0846||VS16||colspan=7| | ||
|- | |- | ||
− | | | + | !IS_LVAR_TEXT_LABEL16_EMPTY |
+ | |0847||LS16||colspan=7| | ||
|- | |- | ||
− | ! | + | !colspan=2|SWITCH{{ref|statem|[*]}} |
− | | | + | |0848 |
− | | | + | !1 |
+ | |HI||colspan=7| | ||
|- | |- | ||
− | | | + | !colspan=2|ENDSWITCH{{ref|statem|[*]}} |
+ | |0849 | ||
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | | | + | !colspan=2|CASE{{ref|statem|[*]}} |
+ | |084A | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
|- | |- | ||
− | ! | + | !colspan=2|DEFAULT{{ref|statem|[*]}} |
− | | | + | |084B |
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | ! | + | !colspan=2|BREAK{{ref|statem|[*]}} |
− | | | + | |084C |
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | !rowspan=2| | + | !rowspan=4 colspan=2|SWITCH_START{{ref|statem|[*]}} |
− | | | + | |rowspan=4|0871 |
− | + | !rowspan=4|18 | |
− | | | + | |rowspan=2|VI |
+ | |rowspan=2|I | ||
+ | |rowspan=2|I | ||
+ | |rowspan=2|O | ||
+ | |colspan=2|I||colspan=2| | ||
|- | |- | ||
− | + | |colspan=2|O||colspan=2| | |
− | |||
|- | |- | ||
− | + | |rowspan=2|LI | |
− | | | + | |rowspan=2|I |
− | + | |rowspan=2|I | |
− | | | + | |rowspan=2|O |
+ | |colspan=2|I||colspan=2| | ||
|- | |- | ||
− | + | |colspan=2|O||colspan=2| | |
− | |||
|- | |- | ||
− | !rowspan=2 colspan=2| | + | !rowspan=2 colspan=2|SWITCH_CONTINUED{{ref|statem|[*]}} |
− | |rowspan=2| | + | |rowspan=2|0872 |
!rowspan=2|18 | !rowspan=2|18 | ||
− | + | |colspan=6|I | |
− | | | + | |colspan=2| |
− | |||
|- | |- | ||
− | + | |colspan=6|O | |
− | + | |colspan=2| | |
− | |||
− | |||
|- | |- | ||
− | !rowspan=6|IS_BIT_SET | + | !rowspan=6|IS_BIT_SET{{ref|likely|[*]}}!!IS_GLOBAL_VAR_BIT_SET_CONST |
|08B4 | |08B4 | ||
!rowspan=6|2 | !rowspan=6|2 | ||
− | | | + | |VI||C||colspan=6| |
|- | |- | ||
− | ! | + | !IS_GLOBAL_VAR_BIT_SET_VAR |
− | |08B5|| | + | |08B5||VI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_GLOBAL_VAR_BIT_SET_LVAR |
− | |08B6|| | + | |08B6||VI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_LOCAL_VAR_BIT_SET_CONST |
− | |08B7||LI|| | + | |08B7||LI||C||colspan=6| |
|- | |- | ||
− | ! | + | !IS_LOCAL_VAR_BIT_SET_VAR |
− | |08B8||LI|| | + | |08B8||LI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !IS_LOCAL_VAR_BIT_SET_LVAR |
− | |08B9||LI||LI||colspan= | + | |08B9||LI||LI||colspan=6| |
|- | |- | ||
− | !rowspan=6| | + | !rowspan=6|SET_BIT{{ref|likely|[*]}}!!SET_GLOBAL_VAR_BIT_CONST |
|08BA | |08BA | ||
!rowspan=6|2 | !rowspan=6|2 | ||
− | | | + | |VI||C||colspan=6| |
|- | |- | ||
− | ! | + | !SET_GLOBAL_VAR_BIT_VAR |
− | |08BB|| | + | |08BB||VI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !SET_GLOBAL_VAR_BIT_LVAR |
− | |08BC|| | + | |08BC||VI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !SET_LOCAL_VAR_BIT_CONST |
− | |08BD||LI|| | + | |08BD||LI||C||colspan=6| |
|- | |- | ||
− | ! | + | !SET_LOCAL_VAR_BIT_VAR |
− | |08BE||LI|| | + | |08BE||LI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !SET_LOCAL_VAR_BIT_LVAR |
− | |08BF||LI||LI||colspan= | + | |08BF||LI||LI||colspan=6| |
|- | |- | ||
− | !rowspan=6| | + | !rowspan=6|CLEAR_BIT{{ref|likely|[*]}}!!CLEAR_GLOBAL_VAR_BIT_CONST |
|08C0 | |08C0 | ||
!rowspan=6|2 | !rowspan=6|2 | ||
− | | | + | |VI||C||colspan=6| |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | ! | + | !CLEAR_GLOBAL_VAR_BIT_VAR |
− | | | + | |08C1||VI||VI||colspan=6| |
|- | |- | ||
− | ! | + | !CLEAR_GLOBAL_VAR_BIT_LVAR |
− | | | + | |08C2||VI||LI||colspan=6| |
|- | |- | ||
− | ! | + | !CLEAR_LOCAL_VAR_BIT_CONST |
− | | | + | |08C3||LI||C||colspan=6| |
|- | |- | ||
− | ! | + | !CLEAR_LOCAL_VAR_BIT_VAR |
− | | | + | |08C4||LI||VI||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | | | + | !CLEAR_LOCAL_VAR_BIT_LVAR |
+ | |08C5||LI||LI||colspan=6| | ||
|- | |- | ||
− | | | + | !rowspan=2|=<br/>IS_THING_EQUAL_TO_THING!!IS_VAR_TEXT_LABEL16_EQUAL_TO_TEXT_LABEL |
+ | |08F9 | ||
+ | !rowspan=2|2 | ||
+ | |VS16||*S16||colspan=6| | ||
|- | |- | ||
− | ! | + | !IS_LVAR_TEXT_LABEL16_EQUAL_TO_TEXT_LABEL |
− | + | |08FA||LS16||*S16||colspan=6| | |
− | |||
|- | |- | ||
− | | | + | !rowspan=2|STRING_CAT{{ref|likely|[*]}}!!STRING_CAT16 |
+ | |098B | ||
+ | !rowspan=2|3 | ||
+ | |VS16||VS16||VS16||colspan=5| | ||
|- | |- | ||
− | | | + | !STRING_CAT8 |
+ | |098C||VS8||VS8||VS8||colspan=5| | ||
|- | |- | ||
− | |colspan= | + | |colspan=12|{{icon|lcs}} |
|- | |- | ||
!colspan=2|RETURN_TRUE | !colspan=2|RETURN_TRUE | ||
|00C5 | |00C5 | ||
!0 | !0 | ||
− | |colspan= | + | |colspan=8| |
|- | |- | ||
!colspan=2|RETURN_FALSE | !colspan=2|RETURN_FALSE | ||
|00C6 | |00C6 | ||
!0 | !0 | ||
− | |colspan= | + | |colspan=8| |
|- | |- | ||
− | !colspan=2| | + | !colspan=2|SWITCH{{ref|statem|[*]}}{{ref|posngs|[*]}} |
− | | | + | |00D6 |
!1 | !1 | ||
− | | | + | |HI||colspan=7| |
+ | |- | ||
+ | !colspan=2|ENDSWITCH{{ref|statem|[*]}}{{ref|posngs|[*]}} | ||
+ | |00D7 | ||
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | !colspan=2| | + | !colspan=2|CASE{{ref|statem|[*]}}{{ref|posngs|[*]}} |
− | | | + | |00D8 |
!1 | !1 | ||
− | | | + | |I||colspan=7| |
+ | |- | ||
+ | !colspan=2|DEFAULT{{ref|statem|[*]}}{{ref|posngs|[*]}} | ||
+ | |00D9 | ||
+ | !0 | ||
+ | |colspan=8| | ||
+ | |- | ||
+ | !colspan=2|BREAK{{ref|statem|[*]}}{{ref|posngs|[*]}} | ||
+ | |00DA | ||
+ | !0 | ||
+ | |colspan=8| | ||
+ | |- | ||
+ | !colspan=2|ANDOR{{ref|statem|[*]}} | ||
+ | |00DB | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
+ | |- | ||
+ | !colspan=2|LAUNCH_MISSION | ||
+ | |00DC | ||
+ | !1 | ||
+ | |O||colspan=7| | ||
|- | |- | ||
!colspan=2|GOSUB_FILE | !colspan=2|GOSUB_FILE | ||
|02D2 | |02D2 | ||
!2 | !2 | ||
− | | | + | |O||O||colspan=6| |
|- | |- | ||
!colspan=2|PLAYER_MADE_PROGRESS | !colspan=2|PLAYER_MADE_PROGRESS | ||
|0311 | |0311 | ||
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
!colspan=2|SET_PROGRESS_TOTAL | !colspan=2|SET_PROGRESS_TOTAL | ||
|0312 | |0312 | ||
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
!colspan=2|REGISTER_MISSION_GIVEN | !colspan=2|REGISTER_MISSION_GIVEN | ||
|031C | |031C | ||
!0 | !0 | ||
− | |colspan= | + | |colspan=8| |
|- | |- | ||
!colspan=2|REGISTER_MISSION_PASSED | !colspan=2|REGISTER_MISSION_PASSED | ||
|031D | |031D | ||
!1 | !1 | ||
− | | | + | |S8||colspan=7| |
|- | |- | ||
!colspan=2|SCRIPT_NAME | !colspan=2|SCRIPT_NAME | ||
|03A9 | |03A9 | ||
!1 | !1 | ||
− | | | + | |S8||colspan=7| |
|- | |- | ||
!colspan=2|LOAD_AND_LAUNCH_MISSION | !colspan=2|LOAD_AND_LAUNCH_MISSION | ||
|041B | |041B | ||
!1 | !1 | ||
− | | | + | |O||colspan=7| |
|- | |- | ||
!colspan=2|LOAD_AND_LAUNCH_MISSION_INTERNAL | !colspan=2|LOAD_AND_LAUNCH_MISSION_INTERNAL | ||
|041C | |041C | ||
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
!colspan=2|SET_TOTAL_NUMBER_OF_MISSIONS | !colspan=2|SET_TOTAL_NUMBER_OF_MISSIONS | ||
|0431 | |0431 | ||
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
!colspan=2|REGISTER_ODDJOB_MISSION_PASSED | !colspan=2|REGISTER_ODDJOB_MISSION_PASSED | ||
|059A | |059A | ||
!0 | !0 | ||
− | |colspan= | + | |colspan=8| |
|- | |- | ||
− | !rowspan= | + | !rowspan=2|=<br/>IS_THING_EQUAL_TO_THING!!IS_INT_VAR_EQUAL_TO_CONSTANT |
|04A8 | |04A8 | ||
− | !rowspan= | + | !rowspan=2|2 |
− | | | + | |VI||C||colspan=6| |
|- | |- | ||
!IS_INT_LVAR_EQUAL_TO_CONSTANT | !IS_INT_LVAR_EQUAL_TO_CONSTANT | ||
− | |04A9|| | + | |04A9||LI||C||colspan=6| |
|- | |- | ||
− | !SET_VAR_INT_TO_CONSTANT | + | !rowspan=2|=<br/>SET!!SET_VAR_INT_TO_CONSTANT |
− | |04B3|| | + | |04B3 |
+ | !rowspan=2|2 | ||
+ | |VI||C||colspan=6| | ||
|- | |- | ||
!SET_LVAR_INT_TO_CONSTANT | !SET_LVAR_INT_TO_CONSTANT | ||
− | |04B4|| | + | |04B4||LI||C||colspan=6| |
|- | |- | ||
− | !rowspan=4|>!!IS_INT_VAR_GREATER_THAN_CONSTANT | + | !rowspan=4|><br/>IS_THING_GREATER_THAN_THING!!IS_INT_VAR_GREATER_THAN_CONSTANT |
|04B5 | |04B5 | ||
!rowspan=4|2 | !rowspan=4|2 | ||
− | | | + | |VI||C||colspan=6| |
|- | |- | ||
!IS_INT_LVAR_GREATER_THAN_CONSTANT | !IS_INT_LVAR_GREATER_THAN_CONSTANT | ||
− | |04B6|| | + | |04B6||LI||C||colspan=6| |
|- | |- | ||
!IS_CONSTANT_GREATER_THAN_INT_VAR | !IS_CONSTANT_GREATER_THAN_INT_VAR | ||
− | |04B7|| | + | |04B7||C||VI||colspan=6| |
|- | |- | ||
!IS_CONSTANT_GREATER_THAN_INT_LVAR | !IS_CONSTANT_GREATER_THAN_INT_LVAR | ||
− | |04B8|| | + | |04B8||C||LI||colspan=6| |
|- | |- | ||
− | !rowspan=4|>=!!IS_INT_VAR_GREATER_OR_EQUAL_TO_CONSTANT | + | !rowspan=4|>=<br/>IS_THING_GREATER_OR_EQUAL_TO_THING!!IS_INT_VAR_GREATER_OR_EQUAL_TO_CONSTANT |
|04B9 | |04B9 | ||
!rowspan=4|2 | !rowspan=4|2 | ||
− | | | + | |VI||C||colspan=6| |
|- | |- | ||
!IS_INT_LVAR_GREATER_OR_EQUAL_TO_CONSTANT | !IS_INT_LVAR_GREATER_OR_EQUAL_TO_CONSTANT | ||
− | |04BA|| | + | |04BA||LI||C||colspan=6| |
|- | |- | ||
!IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR | !IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR | ||
− | |04BB|| | + | |04BB||C||VI||colspan=6| |
|- | |- | ||
!IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_LVAR | !IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_LVAR | ||
− | |04BC|| | + | |04BC||C||LI||colspan=6| |
|- | |- | ||
− | !colspan=2|CALL{{ref| | + | !rowspan=2 colspan=2|CALL{{ref|undarg|[*]}}{{ref|argvar|[*]}}{{ref|likely|[*]}} |
− | |05AE | + | |rowspan=2|05AE |
− | !1 | + | !rowspan=2|1+i+o |
− | | | + | |rowspan=2|O |
− | |colspan= | + | |colspan=7|*T |
|- | |- | ||
− | + | |colspan=7|HT | |
− | |||
− | |||
− | |||
− | |colspan= | ||
|- | |- | ||
− | + | !rowspan=2 colspan=2|CALLNOT{{ref|undarg|[*]}}{{ref|argvar|[*]}}{{ref|likely|[*]}} | |
+ | |rowspan=2|05AF | ||
+ | !rowspan=2|1+i+o | ||
+ | |rowspan=2|O | ||
+ | |colspan=7|*T | ||
|- | |- | ||
− | + | |colspan=7|HT | |
− | |||
− | |||
− | |||
|- | |- | ||
− | + | |colspan=12|{{icon|vcs}} | |
|- | |- | ||
− | !rowspan= | + | !rowspan=7|=<br/>SET!!SET_INT{{ref|likely|[*]}} |
− | |rowspan=2 | + | |0004 |
− | | | + | !rowspan=7|2 |
+ | |HI||I||colspan=6| | ||
|- | |- | ||
− | | | + | !SET_FLOAT{{ref|likely|[*]}} |
+ | |0005||HF||F||colspan=6| | ||
|- | |- | ||
− | ! | + | !SET_TEXT_LABEL{{ref|likely|[*]}} |
− | | | + | |0006||HS8||S8||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !SET_INT_TO_INT{{ref|likely|[*]}} |
+ | |0035||HI||HI||colspan=6| | ||
|- | |- | ||
− | ! | + | !SET_FLOAT_TO_FLOAT{{ref|likely|[*]}} |
− | | | + | |0036||HF||HF||colspan=6| |
− | |||
− | | | ||
− | |||
− | | | ||
|- | |- | ||
− | ! | + | !SET_TEXT_LABEL_TO_TEXT_LABEL{{ref|likely|[*]}} |
− | | | + | |0037||HS8||HS8||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !SET_INT_TO_CONSTANT{{ref|likely|[*]}} |
+ | |02E2|HI||C||colspan=6| | ||
|- | |- | ||
− | !rowspan=4| | + | !rowspan=4|+=<br/>+<br/>ADD_THING_TO_THING!!ADD_VAL_TO_INT{{ref|likely|[*]}} |
− | | | + | |0007 |
!rowspan=4|2 | !rowspan=4|2 | ||
− | | | + | |HI||I||colspan=6| |
|- | |- | ||
− | | | + | !ADD_VAL_TO_FLOAT{{ref|likely|[*]}} |
+ | |0008||HF||F||colspan=6| | ||
|- | |- | ||
− | ! | + | !ADD_INT_TO_INT{{ref|likely|[*]}} |
− | | | + | |0029||HI||HI||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !ADD_FLOAT_TO_FLOAT{{ref|likely|[*]}} |
+ | |002A||HF||HF||colspan=6| | ||
|- | |- | ||
− | !rowspan=4| | + | !rowspan=4|-=<br/>-<br/>SUB_THING_FROM_THING!!SUB_VAL_FROM_INT{{ref|likely|[*]}} |
− | | | + | |0009 |
!rowspan=4|2 | !rowspan=4|2 | ||
− | | | + | |HI||I||colspan=6| |
|- | |- | ||
− | | | + | !SUB_VAL_FROM_FLOAT{{ref|likely|[*]}} |
+ | |000A||HF||F||colspan=6| | ||
|- | |- | ||
− | ! | + | !SUB_INT_FROM_INT{{ref|likely|[*]}} |
− | | | + | |002B||HI||HI||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !SUB_FLOAT_FROM_FLOAT{{ref|likely|[*]}} |
+ | |002C||HF||HF||colspan=6| | ||
|- | |- | ||
− | !rowspan=4|/ | + | !rowspan=4|*=<br/>*<br/>MULT_THING_BY_THING!!MULT_INT_BY_VAL{{ref|likely|[*]}} |
− | | | + | |000B |
!rowspan=4|2 | !rowspan=4|2 | ||
− | | | + | |HI||I||colspan=6| |
|- | |- | ||
− | | | + | !MULT_FLOAT_BY_VAL{{ref|likely|[*]}} |
+ | |000C||HF||F||colspan=6| | ||
|- | |- | ||
− | ! | + | !MULT_INT_BY_INT{{ref|likely|[*]}} |
− | | | + | |002D||HI||HI||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !|MULT_FLOAT_BY_FLOAT{{ref|likely|[*]}} |
+ | |002E||HF||HF||colspan=6| | ||
|- | |- | ||
− | !rowspan= | + | !rowspan=4|/=<br/>/<br/>DIV_THING_BY_THING!!DIV_INT_BY_VAL{{ref|likely|[*]}} |
− | | | + | |000D |
− | !rowspan= | + | !rowspan=4|2 |
− | | | + | |HI||I||colspan=6| |
|- | |- | ||
− | | | + | !DIV_FLOAT_BY_VAL{{ref|likely|[*]}} |
+ | |000E||HF||F||colspan=6| | ||
|- | |- | ||
− | ! | + | !DIV_INT_BY_INT{{ref|likely|[*]}} |
− | | | + | |002F||HI||HI||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !DIV_FLOAT_BY_FLOAT{{ref|likely|[*]}} |
+ | |0030||HF||HF||colspan=6| | ||
|- | |- | ||
− | !rowspan= | + | !rowspan=8|><br/>IS_THING_GREATER_THAN_THING!!IS_INT_GREATER_THAN_NUMBER{{ref|likely|[*]}} |
− | |rowspan= | + | |000F |
− | | | + | !rowspan=8|2 |
+ | |HI||I||colspan=6| | ||
|- | |- | ||
− | | | + | !IS_NUMBER_GREATER_THAN_INT{{ref|likely|[*]}} |
+ | |0010||I||HI||colspan=6| | ||
|- | |- | ||
− | | | + | !IS_INT_GREATER_THAN_INT{{ref|likely|[*]}} |
+ | |0011||HI||HI||colspan=6| | ||
|- | |- | ||
− | | | + | !IS_FLOAT_GREATER_THAN_NUMBER{{ref|likely|[*]}} |
+ | |0012||HF||F||colspan=6| | ||
|- | |- | ||
− | ! | + | !IS_NUMBER_GREATER_THAN_FLOAT{{ref|likely|[*]}} |
− | | | + | |0013||F||HF||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !IS_FLOAT_GREATER_THAN_FLOAT{{ref|likely|[*]}} |
+ | |0014||HF||HF||colspan=6| | ||
|- | |- | ||
− | ! | + | !IS_INT_GREATER_THAN_CONSTANT{{ref|likely|[*]}} |
− | | | + | |02E3||HI||C||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !IS_CONSTANT_GREATER_THAN_INT{{ref|likely|[*]}} |
+ | |02E4||C||HI||colspan=6| | ||
|- | |- | ||
− | !rowspan= | + | !rowspan=8|>=<br/>IS_THING_GREATER_OR_EQUAL_TO_THING!!IS_INT_GREATER_OR_EQUAL_TO_NUMBER{{ref|likely|[*]}} |
− | |rowspan= | + | |0015 |
− | | | + | !rowspan=8|2 |
+ | |HI||I||colspan=6| | ||
|- | |- | ||
− | | | + | !IS_NUMBER_GREATER_OR_EQUAL_TO_INT{{ref|likely|[*]}} |
+ | |0016||I||HI||colspan=6| | ||
|- | |- | ||
− | | | + | !IS_INT_GREATER_OR_EQUAL_TO_INT{{ref|likely|[*]}} |
+ | |0017||HI||HI||colspan=6| | ||
|- | |- | ||
− | | | + | !IS_FLOAT_GREATER_OR_EQUAL_TO_NUMBER{{ref|likely|[*]}} |
+ | |0018||HF||F||colspan=6| | ||
|- | |- | ||
− | ! | + | !IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT{{ref|likely|[*]}} |
− | | | + | |0019||F||HF||colspan=6| |
− | |||
− | | | ||
|- | |- | ||
− | | | + | !IS_FLOAT_GREATER_OR_EQUAL_TO_FLOAT{{ref|likely|[*]}} |
+ | |001A||HF||HF||colspan=6| | ||
|- | |- | ||
− | ! | + | !IS_INT_GREATER_OR_EQUAL_TO_CONSTANT{{ref|likely|[*]}} |
− | | | + | |02E5||HI||C||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !IS_CONSTANT_GREATER_OR_EQUAL_TO_INT{{ref|likely|[*]}} |
+ | |02E6||C||HI||colspan=6| | ||
|- | |- | ||
− | !rowspan= | + | !rowspan=7|=<br/>IS_THING_EQUAL_TO_THING!!IS_INT_EQUAL_TO_NUMBER{{ref|likely|[*]}} |
− | |rowspan= | + | |001B |
− | | | + | !rowspan=7|2 |
+ | |HI||I||colspan=6| | ||
|- | |- | ||
− | | | + | !IS_INT_EQUAL_TO_INT{{ref|likely|[*]}} |
+ | |001C||HI||HI||colspan=6| | ||
|- | |- | ||
− | | | + | !IS_FLOAT_EQUAL_TO_NUMBER{{ref|likely|[*]}} |
+ | |001D||HF||F||colspan=6| | ||
|- | |- | ||
− | | | + | !IS_FLOAT_EQUAL_TO_FLOAT{{ref|likely|[*]}} |
+ | |001E||HF||HF||colspan=6| | ||
|- | |- | ||
− | ! | + | !IS_TEXT_LABEL_EQUAL_TO_STRING{{ref|likely|[*]}} |
− | | | + | |001F||HS8||S8||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !IS_TEXT_LABEL_EQUAL_TO_TEXT_LABEL{{ref|likely|[*]}} |
+ | |0020||HS8||HS8||colspan=6| | ||
|- | |- | ||
− | ! | + | !IS_INT_EQUAL_TO_CONSTANT{{ref|likely|[*]}} |
− | | | + | |02DB||HI||C||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !colspan=2|GOTO_IF_TRUE{{ref|statem|[*]}} |
+ | |0021 | ||
+ | !1 | ||
+ | |O||colspan=7| | ||
|- | |- | ||
− | ! | + | !colspan=2|GOTO_IF_FALSE{{ref|statem|[*]}} |
− | | | + | |0022 |
− | | | + | !1 |
+ | |O||colspan=7| | ||
|- | |- | ||
− | | | + | !colspan=2|TERMINATE_THIS_SCRIPT |
− | | | + | |rowspan=2|0023 |
− | | | + | !rowspan=2|0 |
+ | |rowspan=2 colspan=8| | ||
|- | |- | ||
− | + | !colspan=2|MISSION_END | |
|- | |- | ||
− | ! | + | !colspan=2|START_NEW_SCRIPT{{ref|undarg|[*]}} |
− | | | + | |0024 |
− | ! | + | !1+l |
− | | | + | |O||colspan=7|*T |
|- | |- | ||
− | | | + | !colspan=2|GOSUB |
+ | |0025 | ||
+ | !1 | ||
+ | |O||colspan=7| | ||
|- | |- | ||
− | ! | + | !colspan=2|RETURN |
− | | | + | |0026 |
− | + | !0 | |
+ | |colspan=8| | ||
|- | |- | ||
− | | | + | !rowspan=2|+=@<br/>+@<br/>ADD_THING_TO_THING_TIMED!!ADD_TIMED_VAL_TO_FLOAT{{ref|likely|[*]}} |
+ | |0031 | ||
+ | !rowspan=2|2 | ||
+ | |HF||F||colspan=6| | ||
|- | |- | ||
− | | | + | !ADD_TIMED_FLOAT_TO_FLOAT{{ref|likely|[*]}} |
+ | |0032||HF||HF||colspan=6| | ||
|- | |- | ||
− | | | + | !rowspan=2|-=@<br/>-@<br/>SUB_THING_FROM_THING_TIMED!!SUB_TIMED_VAL_FROM_FLOAT{{ref|likely|[*]}} |
+ | |0033 | ||
+ | !rowspan=2|2 | ||
+ | |HF||F||colspan=6| | ||
|- | |- | ||
− | ! | + | !SUB_TIMED_FLOAT_FROM_FLOAT{{ref|likely|[*]}} |
− | | | + | |0034||HF||HF||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !rowspan=2|=#<br/>CSET!!CSET_INT_TO_FLOAT{{ref|likely|[*]}} |
+ | |0038 | ||
+ | !rowspan=2|2 | ||
+ | |HI||HF||colspan=6| | ||
|- | |- | ||
− | ! | + | !CSET_FLOAT_TO_INT{{ref|likely|[*]}} |
− | | | + | |0039||HF||HI||colspan=6| |
− | | | ||
|- | |- | ||
− | | | + | !rowspan=2|ABS!!ABS_INT{{ref|likely|[*]}} |
+ | |003A | ||
+ | !rowspan=2|1 | ||
+ | |HI||colspan=7| | ||
|- | |- | ||
− | | | + | !ABS_FLOAT{{ref|likely|[*]}} |
+ | |003B||HF||colspan=7| | ||
|- | |- | ||
− | | | + | !colspan=2|RETURN_TRUE |
+ | |005E | ||
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | ! | + | !colspan=2|RETURN_FALSE |
− | | | + | |005F |
− | ! | + | !0 |
− | | | + | |colspan=8| |
+ | |- | ||
+ | !colspan=2|VAR_INT{{ref|defvar|[*]}}{{ref|posngs|[*]}} | ||
+ | |0060 | ||
+ | !n | ||
+ | |colspan=8|@VI | ||
+ | |- | ||
+ | !colspan=2|VAR_FLOAT{{ref|defvar|[*]}}{{ref|posngs|[*]}} | ||
+ | |0061 | ||
+ | !n | ||
+ | |colspan=8|@VF | ||
|- | |- | ||
− | | | + | !colspan=2|LVAR_INT{{ref|defvar|[*]}}{{ref|posngs|[*]}} |
+ | |0062 | ||
+ | !n | ||
+ | |colspan=8|@LI | ||
|- | |- | ||
− | ! | + | !colspan=2|LVAR_FLOAT{{ref|defvar|[*]}}{{ref|posngs|[*]}} |
− | | | + | |0063 |
− | | | + | !n |
+ | |colspan=8|@LF | ||
|- | |- | ||
− | | | + | !colspan=2|VAR_TEXT_LABEL{{ref|defvar|[*]}}{{ref|posngs|[*]}} |
+ | |0064 | ||
+ | !n | ||
+ | |colspan=8|@VS8 | ||
|- | |- | ||
− | | | + | !colspan=2|LVAR_TEXT_LABEL{{ref|defvar|[*]}}{{ref|posngs|[*]}} |
+ | |0065 | ||
+ | !n | ||
+ | |colspan=8|@LS8 | ||
|- | |- | ||
− | | | + | !colspan=2|{{{ref|embdsc|[*]}}{{ref|posngs|[*]}} |
+ | |0066 | ||
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | !colspan=2| | + | !colspan=2|}{{ref|embdsc|[*]}}{{ref|posngs|[*]}} |
− | | | + | |0067 |
+ | !0 | ||
+ | |colspan=8| | ||
+ | |- | ||
+ | !colspan=2|IF{{ref|statem|[*]}}{{ref|posngs|[*]}} | ||
+ | |0068 | ||
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
− | !colspan=2| | + | !colspan=2|IFNOT{{ref|statem|[*]}}{{ref|posngs|[*]}} |
− | | | + | |0069 |
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
− | !colspan=2| | + | !colspan=2|ELSE{{ref|statem|[*]}}{{ref|posngs|[*]}} |
− | | | + | |006A |
− | ! | + | !0 |
− | | | + | |colspan=8| |
|- | |- | ||
− | !colspan=2| | + | !colspan=2|ENDIF{{ref|statem|[*]}}{{ref|posngs|[*]}} |
+ | |006B | ||
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | !colspan=2| | + | !colspan=2|WHILE{{ref|statem|[*]}}{{ref|posngs|[*]}} |
− | | | + | |006C |
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
− | !colspan=2| | + | !colspan=2|WHILENOT{{ref|statem|[*]}}{{ref|posngs|[*]}} |
− | | | + | |006D |
!1 | !1 | ||
− | | | + | |I||colspan=7| |
|- | |- | ||
− | !colspan=2| | + | !colspan=2|ENDWHILE{{ref|statem|[*]}}{{ref|posngs|[*]}} |
− | | | + | |006E |
!0 | !0 | ||
− | |colspan= | + | |colspan=8| |
|- | |- | ||
− | ! | + | !colspan=2|REPEAT{{ref|statem|[*]}}{{ref|posngs|[*]}} |
− | | | + | |006F |
− | ! | + | !2 |
− | | | + | |I||HI||colspan=6| |
|- | |- | ||
− | | | + | !colspan=2|ENDREPEAT{{ref|statem|[*]}}{{ref|posngs|[*]}} |
+ | |0070 | ||
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | | | + | !colspan=2|SWITCH{{ref|statem|[*]}}{{ref|posngs|[*]}} |
+ | |0071 | ||
+ | !1 | ||
+ | |HI||colspan=7| | ||
|- | |- | ||
− | | | + | !colspan=2|ENDSWITCH{{ref|statem|[*]}}{{ref|posngs|[*]}} |
+ | |0072 | ||
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | ! | + | !colspan=2|CASE{{ref|statem|[*]}}{{ref|posngs|[*]}} |
− | | | + | |0073 |
− | | | + | !1 |
+ | |I||colspan=7| | ||
|- | |- | ||
− | | | + | !colspan=2|DEFAULT{{ref|statem|[*]}}{{ref|posngs|[*]}} |
+ | |0074 | ||
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | | | + | !colspan=2|BREAK{{ref|statem|[*]}}{{ref|posngs|[*]}} |
+ | |0075 | ||
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | | | + | !colspan=2|ANDOR{{ref|statem|[*]}} |
+ | |0078 | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
|- | |- | ||
− | ! | + | !colspan=2|LAUNCH_MISSION |
− | | | + | |0079 |
− | ! | + | !1 |
− | | | + | |O||colspan=7| |
|- | |- | ||
− | | | + | !colspan=2|GOSUB_FILE |
+ | |01BA | ||
+ | !2 | ||
+ | |O||O||colspan=6| | ||
|- | |- | ||
− | | | + | !colspan=2|PLAYER_MADE_PROGRESS |
+ | |01DF | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
|- | |- | ||
− | | | + | !colspan=2|SET_PROGRESS_TOTAL |
+ | |01E0 | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
|- | |- | ||
− | ! | + | !colspan=2|REGISTER_MISSION_GIVEN |
− | | | + | |01EA |
− | + | !0 | |
+ | |colspan=8| | ||
|- | |- | ||
− | | | + | !colspan=2|REGISTER_MISSION_PASSED |
+ | |01EB | ||
+ | !1 | ||
+ | |S8||colspan=7| | ||
|- | |- | ||
− | | | + | !colspan=2|SCRIPT_NAME |
+ | |0238 | ||
+ | !1 | ||
+ | |S8||colspan=7| | ||
|- | |- | ||
− | | | + | !colspan=2|LOAD_AND_LAUNCH_MISSION |
+ | |0288 | ||
+ | !1 | ||
+ | |O||colspan=7| | ||
|- | |- | ||
− | ! | + | !colspan=2|LOAD_AND_LAUNCH_MISSION_INTERNAL |
− | | | + | |0289 |
− | ! | + | !1 |
− | | | + | |I||colspan=7| |
|- | |- | ||
− | | | + | !colspan=2|SET_TOTAL_NUMBER_OF_MISSIONS |
+ | |0296 | ||
+ | !1 | ||
+ | |I||colspan=7| | ||
|- | |- | ||
− | | | + | !colspan=2|REGISTER_ODDJOB_MISSION_PASSED |
+ | |036A | ||
+ | !0 | ||
+ | |colspan=8| | ||
|- | |- | ||
− | | | + | !rowspan=2 colspan=2|CALL{{ref|undarg|[*]}}{{ref|argvar|[*]}}{{ref|likely|[*]}} |
+ | |rowspan=2|037A | ||
+ | !rowspan=2|1+i+o | ||
+ | |rowspan=2|O | ||
+ | |colspan=7|*T | ||
|- | |- | ||
− | + | |colspan=7|HT | |
− | |||
− | |||
|- | |- | ||
− | | | + | !rowspan=2 colspan=2|CALLNOT{{ref|undarg|[*]}}{{ref|argvar|[*]}}{{ref|likely|[*]}} |
+ | |rowspan=2|037B | ||
+ | !rowspan=2|1+i+o | ||
+ | |rowspan=2|O | ||
+ | |colspan=7|*T | ||
|- | |- | ||
− | + | |colspan=7|HT | |
|- | |- | ||
− | | | + | !colspan=2|SET_COLLECTABLE2_TOTAL |
− | | | + | |04DA |
− | + | !1 | |
− | + | |I||colspan=7| | |
− | !rowspan= | + | |} |
− | + | ||
+ | ;Notes | ||
+ | :{{note|misdef}} A special [[#Mission scripts|mission]] directive which is never compiled; | ||
+ | :{{note|statem}} It is used also to build [[#Statements|statements]] internally; | ||
+ | :{{note|defvar}} It is used to declare one or more variables; | ||
+ | :{{note|embdsc}} It embeds a variable scope; | ||
+ | :{{note|undarg}} It has an undefined amount of [[#Arguments|arguments]]; | ||
+ | :{{note|likely}} It is a likely definition of the standard command; | ||
+ | :{{note|posngs}} It should exist but its position is purely guessed; | ||
+ | :{{note|argvar}} Arguments amount varies when compiling. | ||
+ | |||
+ | {{incomplete}} | ||
+ | |||
+ | ===Uncommons=== | ||
+ | |||
+ | [[#Arguments|Arguments]] of some commands keep uncommon [[#Value|values]] which look familiar after encoding: | ||
+ | |||
+ | {|class=wikitable style=text-align:center | ||
+ | !rowspan=2|Command | ||
+ | !rowspan=2|Arg.<br/>ID | ||
+ | !rowspan=2|Syntax | ||
+ | !colspan=4|Encoded | ||
|- | |- | ||
− | + | !Command!!Arg.<br/>ID!!Value!!Type | |
|- | |- | ||
− | | | + | |colspan=7|{{icon|3}} {{icon|vc}} {{icon|sa}} {{icon|lcs}} {{icon|vcs}} |
|- | |- | ||
− | | | + | !GOTO |
+ | |1||Any [[#Labels|label]] | ||
+ | !GOTO | ||
+ | |1||[[#Offsets|Offset]]||INT | ||
|- | |- | ||
− | ! | + | !GOTO_IF_FALSE |
− | | | + | |1||Any label |
− | | | + | !GOTO_IF_FALSE |
+ | |1||Offset||INT | ||
|- | |- | ||
− | | | + | !GOSUB |
+ | |1||[[#Gosubs|Gosub]] label | ||
+ | !GOSUB | ||
+ | |1||Offset||INT | ||
|- | |- | ||
− | | | + | !rowspan=4|GOSUB_FILE |
− | | | + | |1||Gosub label |
− | | | + | !rowspan=4|GOSUB_FILE |
+ | |1||rowspan=2|0-based offset||rowspan=4|INT | ||
|- | |- | ||
− | + | |2||[[#Foreign gosubs|Foreign gosub]] file||2 | |
− | | | ||
− | |||
− | |||
|- | |- | ||
− | | | + | |1||Gosub label||1||rowspan=2|Negative offset |
|- | |- | ||
− | + | |2||Foreign gosub label||2 | |
− | | | ||
− | | | ||
|- | |- | ||
− | | | + | !rowspan=2|START_NEW_SCRIPT |
+ | |1||[[#Scripts|Script]] label | ||
+ | !rowspan=2|START_NEW_SCRIPT | ||
+ | |1||Offset||INT | ||
|- | |- | ||
− | | | + | |l||Passed [[#Local|locals]]||l||Passed locals||ANY_T |
|- | |- | ||
− | | | + | !rowspan=2|LAUNCH_MISSION |
+ | |rowspan=2|1||[[#Subscripts|Subscript]] file | ||
+ | !rowspan=2|LAUNCH_MISSION | ||
+ | |rowspan=2|1||0-based offset||rowspan=2|INT | ||
|- | |- | ||
− | + | |Subscript label||Negative offset | |
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | !rowspan=2|LOAD_AND_LAUNCH_MISSION |
+ | |rowspan=2|1||[[#Mission scripts|Mission script]] file | ||
+ | !LOAD_AND_LAUNCH_MISSION_INTERNAL | ||
+ | |rowspan=2|1||Mission [[#Identifiers|identifier]]||rowspan=2|INT | ||
|- | |- | ||
− | + | |Mission script label | |
− | + | !LOAD_AND_LAUNCH_MISSION | |
− | | | + | |Negative offset |
|- | |- | ||
− | | | + | |colspan=7|{{icon|3}} {{icon|lcs}} {{icon|vcs}} |
|- | |- | ||
− | | | + | !GOTO_IF_TRUE |
+ | |1||Any label | ||
+ | !GOTO_IF_TRUE | ||
+ | |1||Offset||INT | ||
|- | |- | ||
− | | | + | |colspan=7|{{icon|vc}} {{icon|sa}} |
|- | |- | ||
− | !rowspan= | + | !rowspan=2|LOAD_AND_LAUNCH_MISSION_EXCLUSIVE |
− | | | + | |rowspan=2|1||Mission script file |
− | !rowspan= | + | !LOAD_AND_LAUNCH_MISSION_INTERNAL |
− | | | + | |rowspan=2|1||Negative mission identifier||rowspan=2|INT |
|- | |- | ||
− | | | + | |Mission script label |
+ | !LOAD_AND_LAUNCH_MISSION | ||
+ | |Negative offset | ||
|- | |- | ||
− | | | + | |colspan=7|{{icon|lcs}} {{icon|vcs}} |
|- | |- | ||
− | | | + | !rowspan=6|CALL<br/>CALLNOT |
+ | |rowspan=4|1||rowspan=4|[[#Functions|Function]] label | ||
+ | !rowspan=6|CALL<br/>CALLNOT | ||
+ | |1||# of input arguments||rowspan=4|INT | ||
|- | |- | ||
− | + | |2||# of output arguments | |
− | | | ||
− | |||
|- | |- | ||
− | | | + | |3||# of script locals |
|- | |- | ||
− | | | + | |4||Offset |
|- | |- | ||
− | | | + | |i||Input arguments||i||Input arguments||ANY_T |
|- | |- | ||
− | + | |o||Output arguments||o||Output arguments||HOLD_T | |
− | | | + | |} |
− | | | + | |
+ | {{incomplete}} | ||
+ | |||
+ | ===Compare flag=== | ||
+ | |||
+ | The ''compare flag'' can handle up to ''8 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== | ||
+ | |||
+ | As an overview of the compiled source, [[#Statements|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|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 [[#Compare flag|Compare flag]]): | ||
+ | |||
+ | {|width=100% | ||
+ | !width=50%|Decompiled | ||
+ | !width=1px|{{icon|3}} {{icon|vc}} {{icon|sa}} | ||
+ | !width=1px|{{icon|lcs}} | ||
+ | !width=1px|{{icon|vcs}} | ||
+ | !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|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|3}} |
− | | | + | !width=1px|{{icon|lcs}} |
− | ! | + | !width=1px|{{icon|vcs}} |
− | + | !Compiled | |
|- | |- | ||
− | + | | | |
− | | | + | IFNOT [NOT] {condition0} |
− | + | [AND|OR [NOT] {condition8}] | |
− | | | + | {consequence} |
− | + | [ELSE | |
− | + | {alternative}] | |
− | + | ENDIF | |
− | + | | | |
− | + | {00D6} | |
− | + | {....} | |
− | + | {....} | |
− | + | {004C} | |
− | + | {....} | |
− | + | {0002} | |
− | + | ---- | |
− | + | {....} | |
− | + | ---- | |
− | + | | | |
− | + | {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: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | + | ===WHILENOT=== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | 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=50%|Decompiled | |
− | + | !width=1px|{{icon|3}} | |
− | + | !width=1px|{{icon|lcs}} | |
− | {| | + | !width=1px|{{icon|vcs}} |
− | ! | + | !Compiled |
− | ! | ||
− | ! | ||
− | ! | ||
|- | |- | ||
− | + | | | |
− | |- | + | WHILENOT [NOT] {condition0} |
− | + | [AND|OR [NOT] {condition8}] | |
− | | | + | {consequence} |
− | + | ENDWHILE | |
− | + | | | |
− | + | ---- | |
− | + | {00D6} | |
− | + | {....} | |
− | + | {....} | |
− | + | {004C} | |
− | + | {....} | |
− | | | + | {0002} |
− | + | ---- | |
− | + | | | |
− | + | ---- | |
− | + | {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|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=50%|Decompiled | ||
+ | !colspan=2|G/L {{icon|vc}} {{icon|sa}} {{icon|lcs}} | ||
+ | !width=1px|G/L {{icon|vcs}} | ||
+ | !Compiled | ||
|- | |- | ||
− | | | + | | |
− | + | REPEAT {times} {varname} | |
− | | | + | {consequence} |
− | + | ENDREPEAT | |
− | | | + | |width=1px| |
− | + | {0004} | |
− | + | ---- | |
− | + | {....} | |
− | + | {0008} | |
− | + | {0028} | |
− | | | + | {004D} |
− | + | |width=1px| | |
− | + | {0005} | |
− | + | ---- | |
− | + | {....} | |
− | + | {0009} | |
− | | | + | {0029} |
− | + | {004D} | |
− | + | | | |
− | | | + | {0004} |
− | + | ---- | |
− | + | {....} | |
+ | {0007} | ||
+ | {0015} | ||
+ | {0022} | ||
+ | | | ||
+ | {varname} = {value0} | ||
+ | LOOP: | ||
+ | {consequence} | ||
+ | ++ {varname} | ||
+ | {varname} >= {valueN} | ||
+ | GOTO_IF_FALSE LOOP | ||
+ | |} | ||
+ | |||
+ | ===SWITCH=== | ||
+ | |||
+ | In {{icon|sa}}, the [[#SWITCH|SWITCH]] 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 right after the command mentioned earlier: | ||
+ | |||
+ | {|width=100% | ||
+ | !width=20%|Decompiled | ||
+ | !width=1px|{{icon|sa}} | ||
+ | !Compiled | ||
|- | |- | ||
− | | | + | | |
− | + | SWITCH {varname} | |
− | + | CASE {value0} | |
− | + | {consequence} | |
− | + | BREAK | |
− | + | [CASE {valueN} | |
− | + | {consequence} | |
− | | | + | BREAK] |
− | + | [DEFAULT | |
− | + | {alternative} | |
− | + | BREAK] | |
− | + | ENDSWITCH | |
− | + | | | |
− | + | {0871} | |
− | + | {0872} | |
− | + | ---- | |
− | + | {....} | |
− | + | {0002} | |
− | + | ---- | |
− | + | {....} | |
− | + | {0002} | |
− | | | + | ---- |
− | + | {....} | |
− | + | {0002} | |
− | + | ---- | |
− | + | | | |
− | + | SWITCH_START {varname} {numcases} {isdefault} DEFAULT {value0} CASE0 ... | |
− | + | [SWITCH_CONTINUED ... {valueN} CASEN [-1 ENDSWITCH]] | |
− | + | CASE0: | |
− | + | {consequence} | |
− | + | GOTO ENDSWITCH | |
− | + | [CASEN: | |
− | + | {consequence} | |
− | + | GOTO ENDSWITCH] | |
+ | [DEFAULT: | ||
+ | {alternative} | ||
+ | GOTO ENDSWITCH] | ||
+ | ENDSWITCH: | ||
|} | |} | ||
− | + | In {{icon|lcs}} and {{icon|vcs}}, such statement is a set of nested [[#IF|IF]] constructs which causes a very slight loss of performance by considering that ''00DB'' ({{icon|lcs}}) and ''0078'' ({{icon|vcs}} aren't compiled: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{|width=100% | {|width=100% | ||
!width=50%|Decompiled | !width=50%|Decompiled | ||
− | + | !colspan=2|G/L {{icon|lcs}} | |
− | + | !width=1px|G/L {{icon|vcs}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | !colspan=2|G/L | ||
− | !width=1px|G/L {{icon|vcs | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
!Compiled | !Compiled | ||
|- | |- | ||
| | | | ||
− | + | SWITCH {varname} | |
− | + | CASE {value0} | |
{consequence} | {consequence} | ||
− | + | BREAK] | |
− | + | [CASE {valueN} | |
− | [ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{consequence} | {consequence} | ||
− | + | BREAK] | |
− | + | [DEFAULT | |
− | [ | + | {alternative} |
− | {alternative}] | + | BREAK] |
− | + | ENDSWITCH | |
|width=1px| | |width=1px| | ||
---- | ---- | ||
Line 2,969: | Line 3,051: | ||
---- | ---- | ||
| | | | ||
− | + | CASE0: | |
{varname} = {value0} | {varname} = {value0} | ||
− | GOTO_IF_FALSE | + | GOTO_IF_FALSE CASEN |
{consequence} | {consequence} | ||
− | + | GOTO ENDSWITCH0 | |
− | + | CASEN: | |
[{varname} = {valueN} | [{varname} = {valueN} | ||
− | GOTO_IF_FALSE | + | GOTO_IF_FALSE DEFAULT |
{consequence} | {consequence} | ||
− | + | GOTO ENDSWITCHN | |
− | + | DEFAULT: | |
[{alternative} | [{alternative} | ||
− | + | ENDSWITCHN:]] | |
− | + | ENDSWITCH0: | |
|} | |} | ||
Line 2,995: | Line 3,077: | ||
=External links= | =External links= | ||
− | *{{icon|2}} [http://gtamp.com/GTA2/gta2script.7z DMA's official GTA2script Compiler V9.6], [http://projectcerbera.com/gta/2/tutorials/scripting DMA's official GTA2script information] | + | *{{icon|2}} [http://gtamp.com/GTA2/gta2script.7z DMA's official GTA2script Compiler V9.6], [http://projectcerbera.com/gta/2/tutorials/scripting DMA's official GTA2script information] - found into the game copy |
− | *{{icon|3}} [https://www.dropbox.com/s/ | + | *{{icon|3}} [https://www.dropbox.com/s/bwxqe33c8ownfc8/gta3ta_source.rar GTA III 10th Anniversary source] - found into the ''iOS'' game copy |
− | *{{icon|vc}} [https://www.dropbox.com/s/ | + | *{{icon|vc}} [https://www.dropbox.com/s/dlxl90ra2wpgfpq/gtavc_defines.rar GTA VC definitions] - some sort of information by {{U|Wesser}} as a result of the reverse-engineering applied to the [http://www.rockstargames.com/ Rockstar Games]' official '''GTA3 Script Compiler V413''' |
− | * | + | *{{icon|sa}} [http://pastebin.com/raw.php?i=Ra9JLLeN PC/PS2/XBOX script commands], [http://pastebin.com/raw.php?i=kCwS6rdG Mobile script commands] - taken directly from the ''Android'' application and rearranged by {{U|Wesser}} |
+ | *{{icon|3}} {{icon|vc}} [https://www.dropbox.com/s/7xgvqo8b9u1qw02/gta3sc_v413.rar Official GTA3 Script Compiler V413] - found into the ''GTA VC 10th Anniversary'' copy | ||
{{N|SA|VC|3}} | {{N|SA|VC|3}} | ||
[[Category:Mission Script]] | [[Category:Mission Script]] |
Revision as of 13:36, 23 August 2014
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. Although we have enough information to suppose the currently unknown mysteries of the used language, we still have no safe clue about which was its original denomination. Furthermore, it is a matter of fact that R* developers have been left untouched the miss2 executable name of the GTA 3 series compiler since the chapter 2. In this connection, we could imagine the new language is a variant or an evolution of the GTA2script. In the ancient documentation by DMA (at present Rockstar North), GBH sound like the initials of the codename or the primordial name of GTA2, as the former is expressly stricken and overwritten by the latter (GBHGTA2 occurs twice, whereas GBHscriptGTA2script only once), while GBHscript and GTA2script are quite recurring. Therefore, we are almost sure to say the language name is most likely GTA3script. 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. In , 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
- Limit
- Opening and closing round brakets are treated as blank spaces;
- An optional comma can be used aswell to distinguish each argument, processed as a space.
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;
- Opening and closing curly brakets are real commands.
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.
Data types
Among the available data types, some are equivalent to those of the most known programming languages. Their length is up to 4, 8 and 16 bytes. Each type is appended as a suffix in the variable declaration.
LABEL
The LABEL type handles variable-length strings. It can refer to either a label name or a file name.
- Notes
- While inside a script file, R* compiler treats it unambiguously as a label;
- R* compiler allocates 32 bytes per label.
- Limit
- LABEL variables aren't available.
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-7 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. Literal only TEXT_LABEL* strings are probably marked by single quotation marks to distinguish them from variable and constant identifiers:
PRINT_BIG 'GXT_KEY'
TEXT_LABEL16
The TEXT_LABEL16 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.
TEXT_BUFFER
The TEXT_BUFFER type handles 32-byte strings or larger, depending on how many continuous parameters of the same type there are, each of which occupies 32 bytes. It can hold up to 127 characters plus the null-terminator, after which another TEXT_BUFFER argument may begin. Strings of such type must be put within double quotation marks:
SAVE_STRING_TO_DEBUG_FILE "32B-128B TEXT"
TEXT_VARLEN
The TEXT_VARLEN type handles N-byte strings. It holds N characters plus the null-terminator. Strings of this type mustn't exceed 255 characters (including the null-byte).
T (pseudo)
The T type handles a group of few datatypes acceptable per argument. It is used only for commands featuring optional arguments, those whose type is unpredictable before the compilation. It can be a pseudo type of INT, FLOAT and TEXT_LABEL.
CONST (pseudo)
The CONST type handles 32-bit signed integers. It is used only to assign and compare constants to INT variables regarding model identifiers, task statuses, ped or audio events and such. It is a pseudo type of INT.
- Limit
- The assignment and comparison of CONST values are supported since .
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:
VAR_* {varname0}[,] [... {varnameN}] LVAR_* {varname0}[,] [... {varnameN}]
As mentioned in the sections above, local variables have to be put within curly brackets:
{ VAR_* {varname0}[,] [... {varnameN}] LVAR_* {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.
- Limits
- 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 TEXT_LABEL16 types occupy respectively 2 and 4 variables to store their data (have a look here for further details);
- Global and local variable names must not collide.
- isn't affected by what said above.
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:
{ VAR_* {varname0}{[arrsize0]}[,] [... {varnameN}{[arrsizeN]}] LVAR_* {varname0}{[arrsize0]}[,] [... {varnameN}{[arrsizeN]}] [...] }
- Limits
- The usage of arrays is allowed since ;
- Variable indices are quite buggy in and therefore unrecommended, but they are fully supported since ;
- Multidimensional arrays are not supported.
Handles
A handle is an univocal identifier assigned to a game entity. It is given by the following statement:
short nHandle = (iEntityIndexInPool << 8) | ucEntityFlag;
- Note
- 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, CONST, TEXT_LABEL and TEXT_LABEL16 types are free from these operators, except for the basic assignment (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 |
---|---|---|---|
=# | Cast assignment | expr0 =# expr1
|
Cast expr1 to any other type and store the result to expr0 |
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:
Operator | Name | Syntax | Description |
---|---|---|---|
NOT | Logical negation | IF NOT condition0
|
Test if condition0 is false |
AND | Logical conjunction | IF condition0
|
Test if both condition0 and conditionN are true |
OR | Logical disjunction | IF condition0
|
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 |
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. It does not return values that can be assigned to a variable, even though the boolean flag is kept whenever it is used as a condition. It follows the common programming syntax adopted for procedure or function calls:
{commandname} [{anyvalue0|varname0} ... {anyvalueN|varnameN}]
Alternatives
Alternative commands are those which are basically overloaded on the bases of different argument types:
- :
- SET (=)
- CSET (=#)
- ADD_THING_TO_THING (+=)
- SUB_THING_FROM_THING (-=)
- MULT_THING_BY_THING (*=)
- DIV_THING_BY_THING (/=)
- IS_THING_EQUAL_TO_THING (=)
- IS_THING_NOT_EQUAL_TO_THING (NOT =)
- IS_THING_GREATER_THAN_THING (>)
- IS_THING_GREATER_OR_EQUAL_TO_THING (>=)
- ADD_THING_TO_THING_TIMED (+=@)
- SUB_THING_FROM_THING_TIMED (-=@)
- ABS
- :
- IS_EMPTY
- IS_BIT_SET
- SET_BIT
- CLEAR_BIT
- STRING_CAT
This section is incomplete. You can help by fixing and expanding it.
Internals
Internal commands are those which have special characteristics and are handled internally:
- :
- GOTO
- GOTO_IF_FALSE
- MISSION_END
- START_NEW_SCRIPT
- VAR_INT
- VAR_FLOAT
- LVAR_INT
- LVAR_FLOAT
- {
- }
- REPEAT
- ENDREPEAT
- IF
- IFNOT
- ELSE
- ENDIF
- WHILE
- WHILENOT
- ENDWHILE
- ANDOR
- LAUNCH_MISSION
- PLAYER_MADE_PROGRESS
- SET_PROGRESS_TOTAL[*]
- REGISTER_MISSION_GIVEN
- REGISTER_MISSION_PASSED
- SCRIPT_NAME
- LOAD_AND_LAUNCH_MISSION
- LOAD_AND_LAUNCH_MISSION_INTERNAL
- SET_TOTAL_NUMBER_OF_MISSIONS[*]
- VAR_TEXT_LABEL
- LVAR_TEXT_LABEL
- :
- REGISTER_ODDJOB_MISSION_PASSED
- :
- GOTO_IF_TRUE
- GOSUB_FILE
- :
- CREATE_COLLECTABLE1
- SET_COLLECTABLE1_TOTAL[*]
- :
- LOAD_AND_LAUNCH_MISSION_EXCLUSIVE
- :
- CALL
- CALLNOT
- :
- VAR_TEXT_LABEL16
- LVAR_TEXT_LABEL16
- SWITCH
- ENDSWITCH
- CASE
- DEFAULT
- BREAK
- SWITCH_START
- SWITCH_CONTINUED
- :
- SET_COLLECTABLE2_TOTAL
- Notes
- ^ The argument of these commands must be set respectively according to:
- The sum of PLAYER_MADE_PROGRESS values;
- The amount of REGISTER_MISSION_PASSED (those that don't have an immediate value are excluded) and REGISTER_ODDJOB_MISSION_PASSED;
- The amount of CREATE_COLLECTABLE1.
- If the argument of the listed commands differs from what expected, a 0-value must be passed.
This section is incomplete. You can help by fixing and expanding it.
WAIT
WAIT stops 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 should 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 sets out the way the comparison among more conditions have to occur (see also Compare flag).
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 desired label only if the comparison returns false.
SCRIPT_NAME
SCRIPT_NAME simply associates an unique name to the current working script.
- Note
- R* compiler doesn't enable you to associate a name previously used for another script.
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. Since , these are the seemingly predetermined bytes of a random empty string block which are actually the result of uninitialized data:
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
The split of such bytes into 4 blocks of 32-bytes each is quite noticeable.
Constants
A constant is a symbolic name associated to a specific value. When compiling, their caption is converted to the assigned value. Since , 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 , 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 CONST type accept only constant values of a single namespace.
- Notes
- Constants don't collide even though they belong to different namespaces;
- In and , they are hardcoded as everything inside R* compiler;
- In , the subdivision of constant namespaces in files might be just a listing of hardcoded constants useful for developers. The same would apply to and .
Formatting
Everything is case-insensitive, that means the uppercase and lowercase letters have no dissimilarities when taken. Usually, the source code is conform to the same formatting according to:
- Labels and variables are entirely in lowercase;
- Declarations, commands and statements are in uppercase;
- Constants are mostly in uppercase but the lowercase variant can be seen aswell.
Compiling
Structure
The source code is split up into several SC files which comprehend main file, foreign gosubs, subscripts, mission scripts, and streamed scripts. These files can be included more times because they are actually processed once.
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:
<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
- Note
- R* compiler will scan subfolders too.
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 . They were unused in and got removed in , but then they were reimplemented in and .
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 and are allocated over the memory by LAUNCH_MISSION. 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_* {varname0}[,] [... {varnameN}]] SCRIPT_NAME main subscript_loop: { [LVAR_* {varname0}[,] [... {varnameN}]] [...] } //GOTO subscript_loop MISSION_END
- Notes
- MISSION_START is a special and fake directive that isn't assigned to any command. R* compiler will notify an error if it isn't placed at the first line of a subscript or a mission script;
- MISSION_END is an alias of TERMINATE_THIS_SCRIPT.
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_* {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 , 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 those subscripts which are responsible for the presence of a storyline in the game. When they are launched with LOAD_AND_LAUNCH_MISSION, the mission is loaded in the mission block, allocated over the memory and the script pointer is moved to the corresponding mission offset. Do not forget to begin a mission script 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_* {varname0}[,] [... {varnameN}]] mission_start: REGISTER_MISSION_GIVEN SCRIPT_NAME mission // Variables initialization { [LVAR_* {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
Few missions doesn't need to be executed twice or more times because they may just initialize some global variables defined in the main script or launch the intro mission. For this reason, here comes the use of LOAD_AND_LAUNCH_MISSION_EXCLUSIVE:
// File: main.sc LOAD_AND_LAUNCH_MISSION_EXCLUSIVE initial.sc LOAD_AND_LAUNCH_MISSION_EXCLUSIVE intro.sc
- Note
- Exclusive missions are never launched in the source code. It's likely, it was an idea not came to the end successfully or rather they were useful for debugging purposes.
- Limits
- LOAD_AND_LAUNCH_MISSION_EXCLUSIVE is available only in and ;
- R* compiler won't let you using more than 2 LOAD_AND_LAUNCH_MISSION_EXCLUSIVE.
Streamed scripts
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:]
- Note
- It's likely, user-made control flows weren't intended to be usable because R* compiler cannot recognize an equal to rather than an assignment operator.
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 8 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
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
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 ;
- The times must be positive;
- The code will be read at least once in any case.
SWITCH
Basically, SWITCH is a group of concatenated IF statements. When a condition is false the next CASE gets performed, otherwise the consequence is executed till BREAK occurs and so the code jumps to the end of the construct. If none of the cases is true, a DEFAULT clause may be carried out:
SWITCH {varname} CASE {value0} {consequence} BREAK [CASE {valueN} {consequence} BREAK] [DEFAULT {alternative} BREAK] ENDSWITCH
- Limits
- It is supported since ;
- CASE allows the use of INT and CONST values only;
- In , values must be sorted (R* compiler should do it implicitely);
- Every CASE including DEFAULT must end with a BREAK.
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 fileforeign gosubssubscriptsmission scripts apart from the reading order of the commands used to include them. Streamed scripts 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 streamed scripts respect the same rule except the fact they are turned into a 0-based growing identifier, while exclusive mission scripts are launched by a negative 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 streamed scripts are relative offsets starting from their beginning. The offset is related to global variables aswell, whose interval goes from 8 and ends to 0xFFFC, 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 | |||||
---|---|---|---|---|---|
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 |
Streamed script | 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 | t0-t1 | t0-t1 |
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
| |
= - | Subtraction and assignment | expr0 = expr1 - expr2
|
expr0 = expr1
| |
= * | Multiplication and assignment | expr0 = expr1 * expr2
|
expr0 = expr1
| |
= / | Division and assignment | expr0 = expr1 / expr2
|
expr0 = expr1
| |
= +@ | Timed addition and assignment | expr0 = expr1 +@ expr2
|
expr0 = expr1
| |
= -@ | Timed subtraction and assignment | expr0 = expr1 -@ expr2
|
expr0 = expr1
|
Opcodes
An opcode is a set of instructions to be performed the game executes by passing an undefined or absent amount of arguments. It is assigned to a 16-bit unsigned integer special ID. 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, just to make things clear).
Arguments
An argument is some data given as input to a command. Normally, commands have a defined amount of arguments and 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: 16 for and , 32 for , 96 for and .
Specials
Here is the list of all special commands and their relative specifications:
Legend:
- Declaration:
- @, DECL
- Scope:
- Datatype:
- O, LABEL
- I, INT
- F, FLOAT
- S, (TEXT):
- 8, TEXT_LABEL
- 16, TEXT_LABEL16
- 32, TEXT_BUFFER
- N, TEXT_VARLEN
- T, T (pseudo)
- C, CONST (pseudo)
List:
Command | ID | Arg. # |
Arguments | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | ... | 18 | ... | n+l | ||||
n+i+o | |||||||||||
MISSION_START[*] | 0 | ||||||||||
GOTO[*] | 0002 | 1 | O | ||||||||
= SET |
SET_VAR_INT | 0004 | 2 | VI | I | ||||||
SET_VAR_FLOAT | 0005 | VF | F | ||||||||
SET_LVAR_INT | 0006 | LI | I | ||||||||
SET_LVAR_FLOAT | 0007 | LF | F | ||||||||
SET_VAR_INT_TO_VAR_INT | 0084 | VI | VI | ||||||||
SET_LVAR_INT_TO_LVAR_INT | 0085 | LI | LI | ||||||||
SET_VAR_FLOAT_TO_VAR_FLOAT | 0086 | VF | VF | ||||||||
SET_LVAR_FLOAT_TO_LVAR_FLOAT | 0087 | LF | LF | ||||||||
SET_VAR_FLOAT_TO_LVAR_FLOAT | 0088 | VF | LF | ||||||||
SET_LVAR_FLOAT_TO_VAR_FLOAT | 0089 | LF | VF | ||||||||
SET_VAR_INT_TO_LVAR_INT | 008A | VI | LI | ||||||||
SET_LVAR_INT_TO_VAR_INT | 008B | LI | VI | ||||||||
+= + ADD_THING_TO_THING |
ADD_VAL_TO_INT_VAR | 0008 | 2 | VI | I | ||||||
ADD_VAL_TO_FLOAT_VAR | 0009 | VF | F | ||||||||
ADD_VAL_TO_INT_LVAR | 000A | LI | I | ||||||||
ADD_VAL_TO_FLOAT_LVAR | 000B | LF | F | ||||||||
ADD_INT_VAR_TO_INT_VAR | 0058 | VI | VI | ||||||||
ADD_FLOAT_VAR_TO_FLOAT_VAR | 0059 | VF | VF | ||||||||
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 | VI | ||||||||
ADD_FLOAT_VAR_TO_FLOAT_LVAR | 005D | LF | VF | ||||||||
ADD_INT_LVAR_TO_INT_VAR | 005E | VI | LI | ||||||||
ADD_FLOAT_LVAR_TO_FLOAT_VAR | 005F | VF | LF | ||||||||
-= - SUB_THING_FROM_THING |
SUB_VAL_FROM_INT_VAR | 000C | 2 | VI | I | ||||||
SUB_VAL_FROM_FLOAT_VAR | 000D | VF | F | ||||||||
SUB_VAL_FROM_INT_LVAR | 000E | LI | I | ||||||||
SUB_VAL_FROM_FLOAT_LVAR | 000F | LF | F | ||||||||
SUB_INT_VAR_FROM_INT_VAR | 0060 | VI | VI | ||||||||
SUB_FLOAT_VAR_FROM_FLOAT_VAR | 0061 | VF | VF | ||||||||
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 | VI | ||||||||
SUB_FLOAT_VAR_FROM_FLOAT_LVAR | 0065 | LF | VF | ||||||||
SUB_INT_LVAR_FROM_INT_VAR | 0066 | VI | LI | ||||||||
SUB_FLOAT_LVAR_FROM_FLOAT_VAR | 0067 | VF | LF | ||||||||
*= * MULT_THING_BY_THING |
MULT_INT_VAR_BY_VAL | 0010 | 2 | VI | I | ||||||
MULT_FLOAT_VAR_BY_VAL | 0011 | VF | F | ||||||||
MULT_INT_LVAR_BY_VAL | 0012 | LI | I | ||||||||
MULT_FLOAT_LVAR_BY_VAL | 0013 | LF | F | ||||||||
MULT_INT_VAR_BY_INT_VAR | 0068 | VI | VI | ||||||||
MULT_FLOAT_VAR_BY_FLOAT_VAR | 0069 | VF | VF | ||||||||
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 | VI | LI | ||||||||
MULT_FLOAT_VAR_BY_FLOAT_LVAR | 006D | VF | LF | ||||||||
MULT_INT_LVAR_BY_INT_VAR | 006E | LI | VI | ||||||||
MULT_FLOAT_LVAR_BY_FLOAT_VAR | 006F | LF | VF | ||||||||
/= / DIV_THING_BY_THING |
DIV_INT_BY_VAL | 0014 | 2 | VI | I | ||||||
DIV_FLOAT_VAR_BY_VAL | 0015 | VF | F | ||||||||
DIV_INT_LVAR_BY_VAL | 0016 | LI | I | ||||||||
DIV_FLOAT_LVAR_BY_VAL | 0017 | LF | F | ||||||||
DIV_INT_VAR_BY_INT_VAR | 0070 | VI | VI | ||||||||
DIV_FLOAT_VAR_BY_FLOAT_VAR | 0071 | VF | VF | ||||||||
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 | VI | LI | ||||||||
DIV_FLOAT_VAR_BY_FLOAT_LVAR | 0075 | VF | LF | ||||||||
DIV_INT_LVAR_BY_INT_VAR | 0076 | LI | VI | ||||||||
DIV_FLOAT_LVAR_BY_FLOAT_VAR | 0077 | LF | VF | ||||||||
> IS_THING_GREATER_THAN_THING |
IS_INT_VAR_GREATER_THAN_NUMBER | 0018 | 2 | VI | I | ||||||
IS_INT_LVAR_GREATER_THAN_NUMBER | 0019 | LI | I | ||||||||
IS_NUMBER_GREATER_THAN_INT_VAR | 001A | I | VI | ||||||||
IS_NUMBER_GREATER_THAN_INT_LVAR | 001B | I | LI | ||||||||
IS_INT_VAR_GREATER_THAN_INT_VAR | 001C | VI | VI | ||||||||
IS_INT_LVAR_GREATER_THAN_INT_LVAR | 001D | LI | LI | ||||||||
IS_INT_VAR_GREATER_THAN_INT_LVAR | 001E | VI | LI | ||||||||
IS_INT_LVAR_GREATER_THAN_INT_VAR | 001F | LI | VI | ||||||||
IS_FLOAT_VAR_GREATER_THAN_NUMBER | 0020 | VF | F | ||||||||
IS_FLOAT_LVAR_GREATER_THAN_NUMBER | 0021 | LF | F | ||||||||
IS_NUMBER_GREATER_THAN_FLOAT_VAR | 0022 | F | VF | ||||||||
IS_NUMBER_GREATER_THAN_FLOAT_LVAR | 0023 | F | LF | ||||||||
IS_FLOAT_VAR_GREATER_THAN_FLOAT_VAR | 0024 | VF | VF | ||||||||
IS_FLOAT_LVAR_GREATER_THAN_FLOAT_LVAR | 0025 | LF | LF | ||||||||
IS_FLOAT_VAR_GREATER_THAN_FLOAT_LVAR | 0026 | VF | LF | ||||||||
IS_FLOAT_LVAR_GREATER_THAN_FLOAT_VAR | 0027 | LF | VF | ||||||||
>= IS_THING_GREATER_OR_EQUAL_TO_THING |
IS_INT_VAR_GREATER_OR_EQUAL_TO_NUMBER | 0028 | 2 | VI | I | ||||||
IS_INT_LVAR_GREATER_OR_EQUAL_TO_NUMBER | 0029 | LI | I | ||||||||
IS_NUMBER_GREATER_OR_EQUAL_TO_INT_VAR | 002A | I | VI | ||||||||
IS_NUMBER_GREATER_OR_EQUAL_TO_INT_LVAR | 002B | I | LI | ||||||||
IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_VAR | 002C | VI | VI | ||||||||
IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_LVAR | 002D | LI | LI | ||||||||
IS_INT_VAR_GREATER_OR_EQUAL_TO_INT_LVAR | 002E | VI | LI | ||||||||
IS_INT_LVAR_GREATER_OR_EQUAL_TO_INT_VAR | 002F | LI | VI | ||||||||
IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_NUMBER | 0030 | VF | F | ||||||||
IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_NUMBER | 0031 | LF | F | ||||||||
IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_VAR | 0032 | F | VF | ||||||||
IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT_LVAR | 0033 | F | LF | ||||||||
IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_VAR | 0034 | VF | VF | ||||||||
IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR | 0035 | LF | LF | ||||||||
IS_FLOAT_VAR_GREATER_OR_EQUAL_TO_FLOAT_LVAR | 0036 | VF | LF | ||||||||
IS_FLOAT_LVAR_GREATER_OR_EQUAL_TO_FLOAT_VAR | 0037 | LF | VF | ||||||||
= IS_THING_EQUAL_TO_THING |
IS_INT_VAR_EQUAL_TO_NUMBER | 0038 | 2 | VI | I | ||||||
IS_INT_LVAR_EQUAL_TO_NUMBER | 0039 | LI | I | ||||||||
IS_INT_VAR_EQUAL_TO_INT_VAR | 003A | VI | VI | ||||||||
IS_INT_LVAR_EQUAL_TO_INT_LVAR | 003B | LI | LI | ||||||||
IS_INT_VAR_EQUAL_TO_INT_LVAR | 003C | VI | LI | ||||||||
IS_FLOAT_VAR_EQUAL_TO_NUMBER | 0042 | VF | F | ||||||||
IS_FLOAT_LVAR_EQUAL_TO_NUMBER | 0043 | LF | F | ||||||||
IS_FLOAT_VAR_EQUAL_TO_FLOAT_VAR | 0044 | VF | VF | ||||||||
IS_FLOAT_LVAR_EQUAL_TO_FLOAT_LVAR | 0045 | LF | LF | ||||||||
IS_FLOAT_VAR_EQUAL_TO_FLOAT_LVAR | 0046 | VF | LF | ||||||||
NOT = IS_THING_NOT_EQUAL_TO_THING |
IS_INT_VAR_NOT_EQUAL_TO_NUMBER | 003D | 2 | VI | I | ||||||
IS_INT_LVAR_NOT_EQUAL_TO_NUMBER | 003E | LI | I | ||||||||
IS_INT_VAR_NOT_EQUAL_TO_INT_VAR | 003F | VI | VI | ||||||||
IS_INT_LVAR_NOT_EQUAL_TO_INT_LVAR | 0040 | LI | LI | ||||||||
IS_INT_VAR_NOT_EQUAL_TO_INT_LVAR | 0041 | VI | LI | ||||||||
IS_FLOAT_VAR_NOT_EQUAL_TO_NUMBER | 0047 | VF | F | ||||||||
IS_FLOAT_LVAR_NOT_EQUAL_TO_NUMBER | 0048 | LF | F | ||||||||
IS_FLOAT_VAR_NOT_EQUAL_TO_FLOAT_VAR | 0049 | VF | VF | ||||||||
IS_FLOAT_LVAR_NOT_EQUAL_TO_FLOAT_LVAR | 004A | LF | LF | ||||||||
IS_FLOAT_VAR_NOT_EQUAL_TO_FLOAT_LVAR | 004B | VF | LF | ||||||||
GOTO_IF_FALSE[*] | 004D | 1 | O | ||||||||
TERMINATE_THIS_SCRIPT | 004E | 0 | |||||||||
MISSION_END | |||||||||||
START_NEW_SCRIPT[*] | 004F | 1+l | O | *T | |||||||
GOSUB | 0050 | 1 | O | ||||||||
RETURN | 0051 | 0 | |||||||||
+=@ +@ ADD_THING_TO_THING_TIMED |
ADD_TIMED_VAL_TO_FLOAT_VAR | 0078 | 2 | VF | F | ||||||
ADD_TIMED_VAL_TO_FLOAT_LVAR | 0079 | LF | F | ||||||||
ADD_TIMED_FLOAT_VAR_TO_FLOAT_VAR | 007A | VF | VF | ||||||||
ADD_TIMED_FLOAT_LVAR_TO_FLOAT_LVAR | 007B | LF | LF | ||||||||
ADD_TIMED_FLOAT_LVAR_TO_FLOAT_VAR | 007C | LF | VF | ||||||||
ADD_TIMED_FLOAT_VAR_TO_FLOAT_LVAR | 007D | VF | LF | ||||||||
-=@ -@ SUB_THING_FROM_THING_TIMED |
SUB_TIMED_VAL_FROM_FLOAT_VAR | 007E | 2 | VF | F | ||||||
SUB_TIMED_VAL_FROM_FLOAT_LVAR | 007F | LF | F | ||||||||
SUB_TIMED_FLOAT_VAR_FROM_FLOAT_VAR | 0080 | VF | VF | ||||||||
SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_LVAR | 0081 | LF | LF | ||||||||
SUB_TIMED_FLOAT_LVAR_FROM_FLOAT_VAR | 0082 | LF | VF | ||||||||
SUB_TIMED_FLOAT_VAR_FROM_FLOAT_LVAR | 0083 | VF | LF | ||||||||
=# CSET |
CSET_VAR_INT_TO_VAR_FLOAT | 008C | 2 | VI | VF | ||||||
CSET_VAR_FLOAT_TO_VAR_INT | 008D | VF | VI | ||||||||
CSET_LVAR_INT_TO_VAR_FLOAT | 008E | LI | VF | ||||||||
CSET_LVAR_FLOAT_TO_VAR_INT | 008F | LF | VI | ||||||||
CSET_VAR_INT_TO_LVAR_FLOAT | 0090 | VI | LF | ||||||||
CSET_VAR_FLOAT_TO_LVAR_INT | 0091 | VF | 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 | VI | |||||||
ABS_LVAR_INT | 0095 | LI | |||||||||
ABS_VAR_FLOAT | 0096 | VF | |||||||||
ABS_LVAR_FLOAT | 0097 | LF | |||||||||
VAR_INT[*] | 00C7 | n | @VI | ||||||||
VAR_FLOAT[*] | 00C8 | n | @VF | ||||||||
LVAR_INT[*] | 00C9 | n | @LI | ||||||||
LVAR_FLOAT[*] | 00CA | n | @LF | ||||||||
{[*] | 00CB | 0 | |||||||||
}[*] | 00CC | 0 | |||||||||
IF[*] | 00CF | 1 | I | ||||||||
ELSE[*] | 00D1 | 0 | |||||||||
ENDIF[*] | 00D2 | 0 | |||||||||
WHILE[*] | 00D3 | 1 | I | ||||||||
ENDWHILE[*] | 00D5 | 0 | |||||||||
ANDOR[*] | 00D6 | 1 | I | ||||||||
LAUNCH_MISSION | 00D7 | 1 | O | ||||||||
PLAYER_MADE_PROGRESS | 030C | 1 | I | ||||||||
SET_PROGRESS_TOTAL | 030D | 1 | I | ||||||||
REGISTER_MISSION_GIVEN | 0317 | 0 | |||||||||
REGISTER_MISSION_PASSED | 0318 | 1 | S8 | ||||||||
SCRIPT_NAME | 03A4 | 1 | S8 | ||||||||
LOAD_AND_LAUNCH_MISSION | 0416 | 1 | O | ||||||||
LOAD_AND_LAUNCH_MISSION_INTERNAL | 0417 | 1 | I | ||||||||
SET_TOTAL_NUMBER_OF_MISSIONS | 042C | 1 | I | ||||||||
REGISTER_ODDJOB_MISSION_PASSED | 0595 | 0 | |||||||||
REPEAT[*] | 00CD | 2 | I | HI | |||||||
ENDREPEAT[*] | 00CE | 0 | |||||||||
CREATE_COLLECTABLE1 | 02EC | 1 | I | ||||||||
SET_COLLECTABLE1_TOTAL | 02ED | 1 | I | ||||||||
GOTO_IF_TRUE[*] | 004C | 1 | O | ||||||||
= IS_THING_EQUAL_TO_THING |
IS_INT_VAR_EQUAL_TO_CONSTANT | 04A3 | 2 | VI | C | ||||||
IS_INT_LVAR_EQUAL_TO_CONSTANT | 04A4 | LI | C | ||||||||
= SET |
SET_VAR_INT_TO_CONSTANT | 04AE | 2 | VI | C | ||||||
SET_LVAR_INT_TO_CONSTANT | 04AF | LI | C | ||||||||
> IS_THING_GREATER_THAN_THING |
IS_INT_VAR_GREATER_THAN_CONSTANT | 04B0 | 2 | VI | C | ||||||
IS_INT_LVAR_GREATER_THAN_CONSTANT | 04B1 | LI | C | ||||||||
IS_CONSTANT_GREATER_THAN_INT_VAR | 04B2 | C | VI | ||||||||
IS_CONSTANT_GREATER_THAN_INT_LVAR | 04B3 | C | LI | ||||||||
>= IS_THING_GREATER_OR_EQUAL_TO_THING |
IS_INT_VAR_GREATER_OR_EQUAL_TO_CONSTANT | 04B4 | 2 | VI | C | ||||||
IS_INT_LVAR_GREATER_OR_EQUAL_TO_CONSTANT | 04B5 | LI | C | ||||||||
IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR | 04B6 | C | VI | ||||||||
IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_LVAR | 04B7 | C | LI | ||||||||
LOAD_AND_LAUNCH_MISSION_EXCLUSIVE | 0515 | 1 | O | ||||||||
IFNOT[*] | 00D0 | 1 | I | ||||||||
WHILENOT[*] | 00D4 | 1 | I | ||||||||
GOSUB_FILE | 02CD | 2 | O | O | |||||||
= SET |
SET_VAR_TEXT_LABEL | 05A9 | 2 | VS8 | *S8 | ||||||
SET_LVAR_TEXT_LABEL | 05AA | LS8 | *S8 | ||||||||
VAR_TEXT_LABEL[*] | 05AB | n | @VS8 | ||||||||
LVAR_TEXT_LABEL[*] | 05AC | n | @LS8 | ||||||||
= IS_THING_EQUAL_TO_THING |
IS_VAR_TEXT_LABEL_EQUAL_TO_TEXT_LABEL | 05AD | 2 | VS8 | *S8 | ||||||
IS_LVAR_TEXT_LABEL_EQUAL_TO_TEXT_LABEL | 05AE | LS8 | *S8 | ||||||||
= SET |
SET_VAR_TEXT_LABEL16 | 06D1 | 2 | VS16 | *S16 | ||||||
SET_LVAR_TEXT_LABEL16 | 06D2 | LS16 | *S16 | ||||||||
VAR_TEXT_LABEL16[*] | 06D3 | n | @VS16 | ||||||||
LVAR_TEXT_LABEL16[*] | 06D4 | n | @LS16 | ||||||||
= IS_THING_EQUAL_TO_THING |
IS_INT_LVAR_EQUAL_TO_INT_VAR | 07D6 | 2 | LI | VI | ||||||
IS_FLOAT_LVAR_EQUAL_TO_FLOAT_VAR | 07D7 | LF | VF | ||||||||
IS_EMPTY[*] | IS_VAR_TEXT_LABEL_EMPTY | 0844 | 1 | VS8 | |||||||
IS_LVAR_TEXT_LABEL_EMPTY | 0845 | LS8 | |||||||||
IS_VAR_TEXT_LABEL16_EMPTY | 0846 | VS16 | |||||||||
IS_LVAR_TEXT_LABEL16_EMPTY | 0847 | LS16 | |||||||||
SWITCH[*] | 0848 | 1 | HI | ||||||||
ENDSWITCH[*] | 0849 | 0 | |||||||||
CASE[*] | 084A | 1 | I | ||||||||
DEFAULT[*] | 084B | 0 | |||||||||
BREAK[*] | 084C | 0 | |||||||||
SWITCH_START[*] | 0871 | 18 | VI | I | I | O | I | ||||
O | |||||||||||
LI | I | I | O | I | |||||||
O | |||||||||||
SWITCH_CONTINUED[*] | 0872 | 18 | I | ||||||||
O | |||||||||||
IS_BIT_SET[*] | IS_GLOBAL_VAR_BIT_SET_CONST | 08B4 | 2 | VI | C | ||||||
IS_GLOBAL_VAR_BIT_SET_VAR | 08B5 | VI | VI | ||||||||
IS_GLOBAL_VAR_BIT_SET_LVAR | 08B6 | VI | LI | ||||||||
IS_LOCAL_VAR_BIT_SET_CONST | 08B7 | LI | C | ||||||||
IS_LOCAL_VAR_BIT_SET_VAR | 08B8 | LI | VI | ||||||||
IS_LOCAL_VAR_BIT_SET_LVAR | 08B9 | LI | LI | ||||||||
SET_BIT[*] | SET_GLOBAL_VAR_BIT_CONST | 08BA | 2 | VI | C | ||||||
SET_GLOBAL_VAR_BIT_VAR | 08BB | VI | VI | ||||||||
SET_GLOBAL_VAR_BIT_LVAR | 08BC | VI | LI | ||||||||
SET_LOCAL_VAR_BIT_CONST | 08BD | LI | C | ||||||||
SET_LOCAL_VAR_BIT_VAR | 08BE | LI | VI | ||||||||
SET_LOCAL_VAR_BIT_LVAR | 08BF | LI | LI | ||||||||
CLEAR_BIT[*] | CLEAR_GLOBAL_VAR_BIT_CONST | 08C0 | 2 | VI | C | ||||||
CLEAR_GLOBAL_VAR_BIT_VAR | 08C1 | VI | VI | ||||||||
CLEAR_GLOBAL_VAR_BIT_LVAR | 08C2 | VI | LI | ||||||||
CLEAR_LOCAL_VAR_BIT_CONST | 08C3 | LI | C | ||||||||
CLEAR_LOCAL_VAR_BIT_VAR | 08C4 | LI | VI | ||||||||
CLEAR_LOCAL_VAR_BIT_LVAR | 08C5 | LI | LI | ||||||||
= IS_THING_EQUAL_TO_THING |
IS_VAR_TEXT_LABEL16_EQUAL_TO_TEXT_LABEL | 08F9 | 2 | VS16 | *S16 | ||||||
IS_LVAR_TEXT_LABEL16_EQUAL_TO_TEXT_LABEL | 08FA | LS16 | *S16 | ||||||||
STRING_CAT[*] | STRING_CAT16 | 098B | 3 | VS16 | VS16 | VS16 | |||||
STRING_CAT8 | 098C | VS8 | VS8 | VS8 | |||||||
RETURN_TRUE | 00C5 | 0 | |||||||||
RETURN_FALSE | 00C6 | 0 | |||||||||
SWITCH[*][*] | 00D6 | 1 | HI | ||||||||
ENDSWITCH[*][*] | 00D7 | 0 | |||||||||
CASE[*][*] | 00D8 | 1 | I | ||||||||
DEFAULT[*][*] | 00D9 | 0 | |||||||||
BREAK[*][*] | 00DA | 0 | |||||||||
ANDOR[*] | 00DB | 1 | I | ||||||||
LAUNCH_MISSION | 00DC | 1 | O | ||||||||
GOSUB_FILE | 02D2 | 2 | O | O | |||||||
PLAYER_MADE_PROGRESS | 0311 | 1 | I | ||||||||
SET_PROGRESS_TOTAL | 0312 | 1 | I | ||||||||
REGISTER_MISSION_GIVEN | 031C | 0 | |||||||||
REGISTER_MISSION_PASSED | 031D | 1 | S8 | ||||||||
SCRIPT_NAME | 03A9 | 1 | S8 | ||||||||
LOAD_AND_LAUNCH_MISSION | 041B | 1 | O | ||||||||
LOAD_AND_LAUNCH_MISSION_INTERNAL | 041C | 1 | I | ||||||||
SET_TOTAL_NUMBER_OF_MISSIONS | 0431 | 1 | I | ||||||||
REGISTER_ODDJOB_MISSION_PASSED | 059A | 0 | |||||||||
= IS_THING_EQUAL_TO_THING |
IS_INT_VAR_EQUAL_TO_CONSTANT | 04A8 | 2 | VI | C | ||||||
IS_INT_LVAR_EQUAL_TO_CONSTANT | 04A9 | LI | C | ||||||||
= SET |
SET_VAR_INT_TO_CONSTANT | 04B3 | 2 | VI | C | ||||||
SET_LVAR_INT_TO_CONSTANT | 04B4 | LI | C | ||||||||
> IS_THING_GREATER_THAN_THING |
IS_INT_VAR_GREATER_THAN_CONSTANT | 04B5 | 2 | VI | C | ||||||
IS_INT_LVAR_GREATER_THAN_CONSTANT | 04B6 | LI | C | ||||||||
IS_CONSTANT_GREATER_THAN_INT_VAR | 04B7 | C | VI | ||||||||
IS_CONSTANT_GREATER_THAN_INT_LVAR | 04B8 | C | LI | ||||||||
>= IS_THING_GREATER_OR_EQUAL_TO_THING |
IS_INT_VAR_GREATER_OR_EQUAL_TO_CONSTANT | 04B9 | 2 | VI | C | ||||||
IS_INT_LVAR_GREATER_OR_EQUAL_TO_CONSTANT | 04BA | LI | C | ||||||||
IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR | 04BB | C | VI | ||||||||
IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_LVAR | 04BC | C | LI | ||||||||
CALL[*][*][*] | 05AE | 1+i+o | O | *T | |||||||
HT | |||||||||||
CALLNOT[*][*][*] | 05AF | 1+i+o | O | *T | |||||||
HT | |||||||||||
= SET |
SET_INT[*] | 0004 | 2 | HI | I | ||||||
SET_FLOAT[*] | 0005 | HF | F | ||||||||
SET_TEXT_LABEL[*] | 0006 | HS8 | S8 | ||||||||
SET_INT_TO_INT[*] | 0035 | HI | HI | ||||||||
SET_FLOAT_TO_FLOAT[*] | 0036 | HF | HF | ||||||||
SET_TEXT_LABEL_TO_TEXT_LABEL[*] | 0037 | HS8 | HS8 | ||||||||
SET_INT_TO_CONSTANT[*] | HI | C | |||||||||
+= + ADD_THING_TO_THING |
ADD_VAL_TO_INT[*] | 0007 | 2 | HI | I | ||||||
ADD_VAL_TO_FLOAT[*] | 0008 | HF | F | ||||||||
ADD_INT_TO_INT[*] | 0029 | HI | HI | ||||||||
ADD_FLOAT_TO_FLOAT[*] | 002A | HF | HF | ||||||||
-= - SUB_THING_FROM_THING |
SUB_VAL_FROM_INT[*] | 0009 | 2 | HI | I | ||||||
SUB_VAL_FROM_FLOAT[*] | 000A | HF | F | ||||||||
SUB_INT_FROM_INT[*] | 002B | HI | HI | ||||||||
SUB_FLOAT_FROM_FLOAT[*] | 002C | HF | HF | ||||||||
*= * MULT_THING_BY_THING |
MULT_INT_BY_VAL[*] | 000B | 2 | HI | I | ||||||
MULT_FLOAT_BY_VAL[*] | 000C | HF | F | ||||||||
MULT_INT_BY_INT[*] | 002D | HI | HI | ||||||||
MULT_FLOAT_BY_FLOAT[*] | 002E | HF | HF | ||||||||
/= / DIV_THING_BY_THING |
DIV_INT_BY_VAL[*] | 000D | 2 | HI | I | ||||||
DIV_FLOAT_BY_VAL[*] | 000E | HF | F | ||||||||
DIV_INT_BY_INT[*] | 002F | HI | HI | ||||||||
DIV_FLOAT_BY_FLOAT[*] | 0030 | HF | HF | ||||||||
> IS_THING_GREATER_THAN_THING |
IS_INT_GREATER_THAN_NUMBER[*] | 000F | 2 | HI | I | ||||||
IS_NUMBER_GREATER_THAN_INT[*] | 0010 | I | HI | ||||||||
IS_INT_GREATER_THAN_INT[*] | 0011 | HI | HI | ||||||||
IS_FLOAT_GREATER_THAN_NUMBER[*] | 0012 | HF | F | ||||||||
IS_NUMBER_GREATER_THAN_FLOAT[*] | 0013 | F | HF | ||||||||
IS_FLOAT_GREATER_THAN_FLOAT[*] | 0014 | HF | HF | ||||||||
IS_INT_GREATER_THAN_CONSTANT[*] | 02E3 | HI | C | ||||||||
IS_CONSTANT_GREATER_THAN_INT[*] | 02E4 | C | HI | ||||||||
>= IS_THING_GREATER_OR_EQUAL_TO_THING |
IS_INT_GREATER_OR_EQUAL_TO_NUMBER[*] | 0015 | 2 | HI | I | ||||||
IS_NUMBER_GREATER_OR_EQUAL_TO_INT[*] | 0016 | I | HI | ||||||||
IS_INT_GREATER_OR_EQUAL_TO_INT[*] | 0017 | HI | HI | ||||||||
IS_FLOAT_GREATER_OR_EQUAL_TO_NUMBER[*] | 0018 | HF | F | ||||||||
IS_NUMBER_GREATER_OR_EQUAL_TO_FLOAT[*] | 0019 | F | HF | ||||||||
IS_FLOAT_GREATER_OR_EQUAL_TO_FLOAT[*] | 001A | HF | HF | ||||||||
IS_INT_GREATER_OR_EQUAL_TO_CONSTANT[*] | 02E5 | HI | C | ||||||||
IS_CONSTANT_GREATER_OR_EQUAL_TO_INT[*] | 02E6 | C | HI | ||||||||
= IS_THING_EQUAL_TO_THING |
IS_INT_EQUAL_TO_NUMBER[*] | 001B | 2 | HI | I | ||||||
IS_INT_EQUAL_TO_INT[*] | 001C | HI | HI | ||||||||
IS_FLOAT_EQUAL_TO_NUMBER[*] | 001D | HF | F | ||||||||
IS_FLOAT_EQUAL_TO_FLOAT[*] | 001E | HF | HF | ||||||||
IS_TEXT_LABEL_EQUAL_TO_STRING[*] | 001F | HS8 | S8 | ||||||||
IS_TEXT_LABEL_EQUAL_TO_TEXT_LABEL[*] | 0020 | HS8 | HS8 | ||||||||
IS_INT_EQUAL_TO_CONSTANT[*] | 02DB | HI | C | ||||||||
GOTO_IF_TRUE[*] | 0021 | 1 | O | ||||||||
GOTO_IF_FALSE[*] | 0022 | 1 | O | ||||||||
TERMINATE_THIS_SCRIPT | 0023 | 0 | |||||||||
MISSION_END | |||||||||||
START_NEW_SCRIPT[*] | 0024 | 1+l | O | *T | |||||||
GOSUB | 0025 | 1 | O | ||||||||
RETURN | 0026 | 0 | |||||||||
+=@ +@ ADD_THING_TO_THING_TIMED |
ADD_TIMED_VAL_TO_FLOAT[*] | 0031 | 2 | HF | F | ||||||
ADD_TIMED_FLOAT_TO_FLOAT[*] | 0032 | HF | HF | ||||||||
-=@ -@ SUB_THING_FROM_THING_TIMED |
SUB_TIMED_VAL_FROM_FLOAT[*] | 0033 | 2 | HF | F | ||||||
SUB_TIMED_FLOAT_FROM_FLOAT[*] | 0034 | HF | HF | ||||||||
=# CSET |
CSET_INT_TO_FLOAT[*] | 0038 | 2 | HI | HF | ||||||
CSET_FLOAT_TO_INT[*] | 0039 | HF | HI | ||||||||
ABS | ABS_INT[*] | 003A | 1 | HI | |||||||
ABS_FLOAT[*] | 003B | HF | |||||||||
RETURN_TRUE | 005E | 0 | |||||||||
RETURN_FALSE | 005F | 0 | |||||||||
VAR_INT[*][*] | 0060 | n | @VI | ||||||||
VAR_FLOAT[*][*] | 0061 | n | @VF | ||||||||
LVAR_INT[*][*] | 0062 | n | @LI | ||||||||
LVAR_FLOAT[*][*] | 0063 | n | @LF | ||||||||
VAR_TEXT_LABEL[*][*] | 0064 | n | @VS8 | ||||||||
LVAR_TEXT_LABEL[*][*] | 0065 | n | @LS8 | ||||||||
{[*][*] | 0066 | 0 | |||||||||
}[*][*] | 0067 | 0 | |||||||||
IF[*][*] | 0068 | 1 | I | ||||||||
IFNOT[*][*] | 0069 | 1 | I | ||||||||
ELSE[*][*] | 006A | 0 | |||||||||
ENDIF[*][*] | 006B | 0 | |||||||||
WHILE[*][*] | 006C | 1 | I | ||||||||
WHILENOT[*][*] | 006D | 1 | I | ||||||||
ENDWHILE[*][*] | 006E | 0 | |||||||||
REPEAT[*][*] | 006F | 2 | I | HI | |||||||
ENDREPEAT[*][*] | 0070 | 0 | |||||||||
SWITCH[*][*] | 0071 | 1 | HI | ||||||||
ENDSWITCH[*][*] | 0072 | 0 | |||||||||
CASE[*][*] | 0073 | 1 | I | ||||||||
DEFAULT[*][*] | 0074 | 0 | |||||||||
BREAK[*][*] | 0075 | 0 | |||||||||
ANDOR[*] | 0078 | 1 | I | ||||||||
LAUNCH_MISSION | 0079 | 1 | O | ||||||||
GOSUB_FILE | 01BA | 2 | O | O | |||||||
PLAYER_MADE_PROGRESS | 01DF | 1 | I | ||||||||
SET_PROGRESS_TOTAL | 01E0 | 1 | I | ||||||||
REGISTER_MISSION_GIVEN | 01EA | 0 | |||||||||
REGISTER_MISSION_PASSED | 01EB | 1 | S8 | ||||||||
SCRIPT_NAME | 0238 | 1 | S8 | ||||||||
LOAD_AND_LAUNCH_MISSION | 0288 | 1 | O | ||||||||
LOAD_AND_LAUNCH_MISSION_INTERNAL | 0289 | 1 | I | ||||||||
SET_TOTAL_NUMBER_OF_MISSIONS | 0296 | 1 | I | ||||||||
REGISTER_ODDJOB_MISSION_PASSED | 036A | 0 | |||||||||
CALL[*][*][*] | 037A | 1+i+o | O | *T | |||||||
HT | |||||||||||
CALLNOT[*][*][*] | 037B | 1+i+o | O | *T | |||||||
HT | |||||||||||
SET_COLLECTABLE2_TOTAL | 04DA | 1 | I |
- Notes
- ^ A special mission directive which is never compiled;
- ^ It is used also to build statements internally;
- ^ It is used to declare one or more variables;
- ^ It embeds a variable scope;
- ^ It has an undefined amount of arguments;
- ^ It is a likely definition of the standard command;
- ^ It should exist but its position is purely guessed;
- ^ Arguments amount varies when compiling.
This section is incomplete. You can help by fixing and expanding it.
Uncommons
Arguments of some commands keep uncommon values which look familiar after encoding:
Command | Arg. ID |
Syntax | Encoded | |||
---|---|---|---|---|---|---|
Command | Arg. ID |
Value | Type | |||
GOTO | 1 | Any label | GOTO | 1 | Offset | INT |
GOTO_IF_FALSE | 1 | Any label | GOTO_IF_FALSE | 1 | Offset | INT |
GOSUB | 1 | Gosub label | GOSUB | 1 | Offset | INT |
GOSUB_FILE | 1 | Gosub label | GOSUB_FILE | 1 | 0-based offset | INT |
2 | Foreign gosub file | 2 | ||||
1 | Gosub label | 1 | Negative offset | |||
2 | Foreign gosub label | 2 | ||||
START_NEW_SCRIPT | 1 | Script label | START_NEW_SCRIPT | 1 | Offset | INT |
l | Passed locals | l | Passed locals | ANY_T | ||
LAUNCH_MISSION | 1 | Subscript file | LAUNCH_MISSION | 1 | 0-based offset | INT |
Subscript label | Negative offset | |||||
LOAD_AND_LAUNCH_MISSION | 1 | Mission script file | LOAD_AND_LAUNCH_MISSION_INTERNAL | 1 | Mission identifier | INT |
Mission script label | LOAD_AND_LAUNCH_MISSION | Negative offset | ||||
GOTO_IF_TRUE | 1 | Any label | GOTO_IF_TRUE | 1 | Offset | INT |
LOAD_AND_LAUNCH_MISSION_EXCLUSIVE | 1 | Mission script file | LOAD_AND_LAUNCH_MISSION_INTERNAL | 1 | Negative mission identifier | INT |
Mission script label | LOAD_AND_LAUNCH_MISSION | Negative offset | ||||
CALL CALLNOT |
1 | Function label | CALL CALLNOT |
1 | # of input arguments | INT |
2 | # of output arguments | |||||
3 | # of script locals | |||||
4 | Offset | |||||
i | Input arguments | i | Input arguments | ANY_T | ||
o | Output arguments | o | Output arguments | HOLD_T |
This section is incomplete. You can help by fixing and expanding it.
Compare flag
The compare flag can handle up to 8 checks per construct. 006D ( ), 00DB () and 0078 () 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 Compare flag):
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:
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:
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:
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:
SWITCH
In , the SWITCH 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 right after the command mentioned earlier:
In and , such statement is a set of nested IF constructs which causes a very slight loss of performance by considering that 00DB () and 0078 ( aren't compiled:
Optimization
In and , whenever a single condition is checked 00DB () and 0078 () 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.
Tools
External links
- DMA's official GTA2script Compiler V9.6, DMA's official GTA2script information - found into the game copy
- GTA III 10th Anniversary source - found into the iOS game copy
- GTA VC definitions - some sort of information by Wesser as a result of the reverse-engineering applied to the Rockstar Games' official GTA3 Script Compiler V413
- PC/PS2/XBOX script commands, Mobile script commands - taken directly from the Android application and rearranged by Wesser
- Official GTA3 Script Compiler V413 - found into the GTA VC 10th Anniversary copy