015E

From GTAMods Wiki
Revision as of 02:29, 4 December 2016 by Spaceeinstein (talk | contribs) (highlight)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

GTA III IS_CAR_IN_AIR


Description
Checks if the car is in the air
Syntax
015E:   car [car handle] in_air
Parameter
[car handle]
The handle of the vehicle

This conditional opcode returns true depending on the drive type of the car under these circumstances. If the car is front-wheel drive, the opcode returns true if both the front wheels are off the ground. If the car is rear-wheel drive, the opcode returns true if both the rear wheels are off the ground. If the car is four-wheel drive, the opcode returns true if all four wheels are off the ground. Oddly for boats, the opcode produces an inconsistent return result. It returns true for some boats and false for others. Legacy documentation incorrectly described this opcode as checking if the car's wheels are on the ground.

For Vice City

This opcode does not exist in Vice City but it is possible to recreate this opcode. 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. Like for boats, it produces an inconsistent return result for motorbikes. Place this at the end of the file:

:opcode_015E
// 0@ - input param (car handle)
05E7: 0@ = car 0@ struct
0@ += 0x5C5  // number of wheels on ground offset
05E0: 0@ = read_memory 0@ size 1 virtual_protect 0  // get value
    0@ == 0
05F6: ret 0

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

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

Keywords

check, car, vehicle, in, air, wheels, on, ground