Difference between revisions of "029C"
Jump to navigation
Jump to search
m |
|||
Line 1: | Line 1: | ||
− | {{Icon|3}} | + | {{OpCode |
− | + | | games = {{Icon|3}} | |
− | + | | command = IS_BOAT | |
− | + | | description = Checks if the vehicle is a boat | |
− | + | | syntax1 = 029C: is [''car handle''] boat | |
− | + | | p1t = [''car handle''] | |
− | + | | p1d = The handle of the vehicle | |
− | + | }} | |
− | |||
− | This opcode returns true if the vehicle is of type boat. Legacy documentations had incorrectly described this opcode as "car stopped," which had remained uncorrected for a long time. | + | This conditional opcode returns true if the vehicle is of [[CARS (IDE Section)#GTA III|type]] boat. Legacy documentations had incorrectly described this opcode as "car stopped," which had remained uncorrected for a long time. |
== For Vice City == | == For Vice City == | ||
This opcode does not exist in Vice City but the game can recognize vehicles by type. 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 the game can recognize vehicles by type. 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: | ||
− | <syntaxhighlight lang="scm">:opcode_029C | + | <syntaxhighlight lang="scm"> |
+ | :opcode_029C | ||
05E7: 0@ = car 0@ struct | 05E7: 0@ = car 0@ struct | ||
0@ += 0x29C // vehicle type offset | 0@ += 0x29C // vehicle type offset | ||
05E0: 0@ = read_memory 0@ size 1 virtual_protect 0 | 05E0: 0@ = read_memory 0@ size 1 virtual_protect 0 | ||
− | + | 0@ == 1 // is type boat | |
− | 05F6: ret 0</syntaxhighlight> | + | 05F6: ret 0 |
+ | </syntaxhighlight> | ||
+ | |||
Use this line as a substitute for opcode 029C. This can be placed anywhere within the external script as a conditional statement. | Use this line as a substitute for opcode 029C. This can be placed anywhere within the external script as a conditional statement. | ||
− | <syntaxhighlight lang="scm">// ... | + | <syntaxhighlight lang="scm"> |
+ | // ... | ||
if | if | ||
− | + | 05F5: call_scm_func @opcode_029C inputs 1 car_handle [car handle] | |
then | then | ||
− | + | // [RETURNED TRUE] | |
else | else | ||
− | + | // [RETURNED FALSE] | |
end | end | ||
− | // ...</syntaxhighlight> | + | // ... |
+ | </syntaxhighlight> | ||
== Keywords == | == Keywords == | ||
check, stopped, car, boat | check, stopped, car, boat | ||
− | |||
− |
Revision as of 09:17, 7 November 2016
- Description
- Checks if the vehicle is a boat
- Syntax
- 029C: is [car handle] boat
- Parameter
- [car handle]
- The handle of the vehicle
This conditional opcode returns true if the vehicle is of type boat. Legacy documentations had incorrectly described this opcode as "car stopped," which had remained uncorrected for a long time.
For Vice City
This opcode does not exist in Vice City but the game can recognize vehicles by type. 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_029C
05E7: 0@ = car 0@ struct
0@ += 0x29C // vehicle type offset
05E0: 0@ = read_memory 0@ size 1 virtual_protect 0
0@ == 1 // is type boat
05F6: ret 0
Use this line as a substitute for opcode 029C. This can be placed anywhere within the external script as a conditional statement.
// ...
if
05F5: call_scm_func @opcode_029C inputs 1 car_handle [car handle]
then
// [RETURNED TRUE]
else
// [RETURNED FALSE]
end
// ...
Keywords
check, stopped, car, boat