Difference between revisions of "03C9"

From GTAMods Wiki
Jump to navigation Jump to search
(highlight test)
m (highlight test)
 
(2 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
== For Vice City ==
 
== For Vice City ==
 
This opcode does not exist in Vice City but it is still possible to check if a vehicle is visibly damaged. The following example, using Sanny Builder with [[CLEO]] for Vice City in an external script (not the main one) and tested on US v1.0, should work similarly to this opcode. Place this at the end of the file:
 
This opcode does not exist in Vice City but it is still possible to check if a vehicle is visibly damaged. The following example, using Sanny Builder with [[CLEO]] for Vice City in an external script (not the main one) and tested on US v1.0, should work similarly to this opcode. Place this at the end of the file:
<p class="sb-code mw-code" style="line-height: 1.3em;"><span class="nl">:opcode_03C9</span>
+
{{Pre|class=sb-code|1=
 +
<span class="nl">:opcode_03C9</span>
 
<span class="c1">// 0@ - input param (car handle)</span>
 
<span class="c1">// 0@ - input param (car handle)</span>
 
05E7: <span class="nv">0@</span> = car <span class="nv">0@</span> struct
 
05E7: <span class="nv">0@</span> = car <span class="nv">0@</span> struct
<span class="nv">0@</span> += 0x1FB
+
<span class="nv">0@</span> += <span class="m">0x1FB</span>
 
05E0: <span class="nv">0@</span> = read_memory <span class="nv">0@</span> size <span class="m">1</span> virtual_protect <span class="m">0</span>
 
05E0: <span class="nv">0@</span> = read_memory <span class="nv">0@</span> size <span class="m">1</span> virtual_protect <span class="m">0</span>
 
05FE: <span class="nv">0@</span> = <span class="nv">0@</span> SHR <span class="m">1</span>
 
05FE: <span class="nv">0@</span> = <span class="nv">0@</span> SHR <span class="m">1</span>
 
05F9: <span class="nv">0@</span> = <span class="nv">0@</span> <span class="k">AND</span> <span class="m">1</span>
 
05F9: <span class="nv">0@</span> = <span class="nv">0@</span> <span class="k">AND</span> <span class="m">1</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="nv">0@</span> == <span class="m">1</span>  <span class="c1">// is car visibly damaged</span>
+
    <span class="nv">0@</span> == <span class="m">1</span>  <span class="c1">// is car visibly damaged</span>
 
05F6: ret <span class="m">0</span>
 
05F6: ret <span class="m">0</span>
</p>
+
}}
  
 
Use this line as a substitute for opcode 03C9. This can be placed anywhere within the external script as a conditional statement.
 
Use this line as a substitute for opcode 03C9. This can be placed anywhere within the external script as a conditional statement.
<p class="sb-code mw-code" style="line-height: 1.3em;"><span class="c1">// ...</span>
+
{{Pre|class=sb-code|1=
 +
<span class="c1">// ...</span>
 
<span class="k">if</span>
 
<span class="k">if</span>
 
     05F5: call_scm_func <span class="nl">@opcode_03C9</span> inputs <span class="m">1</span> car_handle [car handle]
 
     05F5: call_scm_func <span class="nl">@opcode_03C9</span> inputs <span class="m">1</span> car_handle [car handle]
Line 33: Line 35:
 
<span class="k">end</span>
 
<span class="k">end</span>
 
<span class="c1">// ...</span>
 
<span class="c1">// ...</span>
</p>
+
}}
  
 
== Keywords ==
 
== Keywords ==
 
check, car, vehicle, visibly, visible, damage, damaged
 
check, car, vehicle, visibly, visible, damage, damaged

Latest revision as of 09:06, 23 November 2016

GTA III IS_CAR_VISIBLY_DAMAGED


Description
Checks if the vehicle is visibly damaged
Syntax
03C9:   car [car handle] damaged
Parameter
[car handle]
The handle of the vehicle

This opcode returns true if the vehicle is visibly damaged. It does not depend on the health of the vehicle.

For Vice City

This opcode does not exist in Vice City but it is still possible to check if a vehicle is visibly damaged. The following example, using Sanny Builder with CLEO for Vice City in an external script (not the main one) and tested on US v1.0, should work similarly to this opcode. Place this at the end of the file:

:opcode_03C9
// 0@ - input param (car handle)
05E7: 0@ = car 0@ struct
0@ += 0x1FB
05E0: 0@ = read_memory 0@ size 1 virtual_protect 0
05FE: 0@ = 0@ SHR 1
05F9: 0@ = 0@ AND 1
    0@ == 1  // is car visibly damaged
05F6: ret 0

Use this line as a substitute for opcode 03C9. This can be placed anywhere within the external script as a conditional statement.

// ...
if
    05F5: call_scm_func @opcode_03C9 inputs 1 car_handle [car handle]
then
    // [RETURNED TRUE]
else
    // [RETURNED FALSE]
end
// ...

Keywords

check, car, vehicle, visibly, visible, damage, damaged