Bikes and convertibles in GTA2
Posted: 22 Jan 2010, 13:10
By using deltas and a script which changes the NUMBER_GRAPHIC of a car, it's possible to create reasonably convincing bikes and convertibles in GTA2.
I used to following script to add two bikes to a 2p level:
When a player gets on a bike, the bike is stored and a delta showing a driver appears. When he gets off again, the delta is swapped with an empty delta. To make this work correctly, the bike must be imported in the sty file without a driver, who is only shown on deltas 12 through 19. Delta 20 must be left blank. To create a parked bike without a driver on it, you need to use the SET_CAR_NUMBER_GRAPHIC to set the bike to use the last delta.
Convertibles work exactly the same way. This script can be expanded to support as much bikes and convertibles as you like.
There are a few downsides:
The two bikes from GTA1 in GTA2: the Superbike without a driver and the normal Bike with a driver.
I used to following script to add two bikes to a 2p level:
Code: Select all
WHILE_EXEC ( loop = 1 )
IF ( ( ( IS_CHARACTER_IN_MODEL ( player1 , ISETTA ) ) OR ( IS_CHARACTER_IN_MODEL ( player1 , SPRITE ) ) ) AND ( p1_on_bike = 0 ) )
SET p1_on_bike = 1
STORE_CAR_CHARACTER_IS_IN ( player1 , bike1 )
SET_CAR_NUMBER_GRAPHIC ( bike1 , 0 )
ENDIF
IF ( ( ( IS_CHARACTER_IN_MODEL ( player2 , ISETTA ) ) OR ( IS_CHARACTER_IN_MODEL ( player2 , SPRITE ) ) ) AND ( p2_on_bike = 0 ) )
SET p2_on_bike = 1
STORE_CAR_CHARACTER_IS_IN ( player2 , bike2 )
SET_CAR_NUMBER_GRAPHIC ( bike2, 0 )
ENDIF
IF ( p1_on_bike = 1 )
IF ( NOT ( CHECK_CAR_HAS_DRIVER ( bike1 ) ) )
SET p1_on_bike = 0
SET_CAR_NUMBER_GRAPHIC ( bike1 , 8 )
ENDIF
ENDIF
IF ( p2_on_bike = 1 )
IF ( NOT ( CHECK_CAR_HAS_DRIVER ( bike2 ) ) )
SET p2_on_bike = 0
SET_CAR_NUMBER_GRAPHIC ( bike2 , 8 )
ENDIF
ENDIF
ENDWHILE
Convertibles work exactly the same way. This script can be expanded to support as much bikes and convertibles as you like.
There are a few downsides:
- Only players can leave a bike/convertible without leaving a driver on the vehicle. This means that if you shoot at a random bike/convertible with an unsuspecting driver, he'll get out, but leaves a 'ghost' driver behind.
- Technically it's possible to create deltas for passengers and expand the script so more people would show up if a passenger enters your convertible, but due to a bug in GTA2 instant gang members won't get into a declared vehicle, and thus they won't enter your bike or convertible.
- To prevent all players from looking the same while on a bike or in a convertible, you could make a different delta for each player, but most colors will change with the remap of the vehicle. You could create a special palette, but then the vehicle would have only one remap.
- You can't fall off your bike when crashing into another car at top speed. However, I'd say that's a good thing.

The two bikes from GTA1 in GTA2: the Superbike without a driver and the normal Bike with a driver.