Difference between revisions of "00D6"

From GTAMods Wiki
Jump to navigation Jump to search
(added old format)
(page updates)
 
Line 1: Line 1:
 
{{OpCode
 
{{OpCode
| ini        = 00D6=1,%1d%
+
| games      = {{Icon|t}}
 +
| command    = ANDOR
 
| description = [[Wikipedia:If-then-else|IF]] statement
 
| description = [[Wikipedia:If-then-else|IF]] statement
| game        = GTA3, Vice City, San Andreas
+
| syntax1    = 00D6: if [''int'']
 +
| syntax2    = if, if and, if or
 +
| p1t        = [''int'']
 +
| p1d        = 0 to 7, 21 to 27
 
}}
 
}}
More information on how to use this opcode [[Conditional statement|here]].
 
  
==Old format==
+
This opcode is used in [[Conditional statement|conditional statements]]. Up to eight conditional opcodes are supported under one IF. [[Sanny Builder]] uses a more efficient syntax of dealing with IF statements but it can still use the old syntax of dealing with them. The [[Mission Builder]] and many older decompilers uses the old syntax, which is minimally modified from decompiled code.
[[Sanny Builder]] uses a new and more efficient way of dealing with IF statements but can still use the old way of dealing with these. The [[Mission Builder]] and most other decompilers uses the old format. The parameter of this opcode is an integer between 0 to 7 and 21 to 27.
 
  
<code>00D6: if 0</code> is equivalent to Sanny Builder format <b><code>if</code></b>
+
* <code>00D6: if 0</code>
 +
A value of ''0'' is equivalent to Sanny Builder syntax <b><code>if</code></b>. It means there is only one condition. The condition must be true for the statement to be true. This line can be omitted to save space.
  
A parameter with a value of 0 means there is only one conditional opcode.
+
* <code>00D6: if 1</code> ... <code>00D6: if 7</code>
 +
A value between ''1'' and ''7'' is equivalent to Sanny Builder syntax <b><code>if and</code></b>. A value of ''1'' means there are two conditions and a value of ''7'' means there are eight conditions. All conditions must be true for the statement to be true.
 +
* <code>00D6: if 21</code> ... <code>00D6: if 27</code>
 +
A value between ''21'' and ''27'' is equivalent to Sanny Builder syntax <b><code>if or</code></b>. A value of ''21'' means there are two conditions and a value of ''27'' means there are eight conditions. At least one condition must be true for the statement to be true.
  
<code>00D6: if 1</code> and any integer up to 7 is equivalent to Sanny Builder format <b><code>if and</code></b>
+
== Keywords ==
 
+
if, for, while, conditional, statement
A parameter with a value between 1 and 7 is an IF AND statement. A value of 1 means there are two conditional opcodes and a value of 7 means there are eight conditional opcodes.
 
 
 
<code>00D6: if 21</code> and any integer up to 27 is equivalent to Sanny Builder format <b><code>if or</code></b>
 
 
 
A parameter with a value between 21 and 27 is an IF OR statement. A value of 21 means there are two conditional opcodes and a value of 27 means there are eight conditional opcodes.
 
 
 
Using a higher value will not crash the game but the game will not read more than eight conditions at a time. Counting the correct number of conditions and using the right parameter value is crucial in getting a working code.
 
 
 
==Keywords==
 
if, conditional, statement
 

Latest revision as of 17:26, 15 June 2016

GTA III Vice City San Andreas ANDOR


Description
IF statement
Syntax
00D6: if [int]
if, if and, if or
Parameter
[int]
0 to 7, 21 to 27

This opcode is used in conditional statements. Up to eight conditional opcodes are supported under one IF. Sanny Builder uses a more efficient syntax of dealing with IF statements but it can still use the old syntax of dealing with them. The Mission Builder and many older decompilers uses the old syntax, which is minimally modified from decompiled code.

  • 00D6: if 0

A value of 0 is equivalent to Sanny Builder syntax if. It means there is only one condition. The condition must be true for the statement to be true. This line can be omitted to save space.

  • 00D6: if 1 ... 00D6: if 7

A value between 1 and 7 is equivalent to Sanny Builder syntax if and. A value of 1 means there are two conditions and a value of 7 means there are eight conditions. All conditions must be true for the statement to be true.

  • 00D6: if 21 ... 00D6: if 27

A value between 21 and 27 is equivalent to Sanny Builder syntax if or. A value of 21 means there are two conditions and a value of 27 means there are eight conditions. At least one condition must be true for the statement to be true.

Keywords

if, for, while, conditional, statement