Bikes and convertibles in GTA2

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
Post Reply
User avatar
Lantyz
Psycho
Psycho
Posts: 71
Joined: 14 Apr 2009, 08:20
GH nick: Lantyz
Location: The Netherlands
Contact:

Bikes and convertibles in GTA2

Post by Lantyz »

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:

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
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:
  • 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.
Image
The two bikes from GTA1 in GTA2: the Superbike without a driver and the normal Bike with a driver.
User avatar
Gustavob
Immortal
Posts: 407
Joined: 18 May 2009, 21:40
GH nick: Gustavob
|Gustavob|
Location: Nowhere.
Contact:

Re: Bikes and convertibles in GTA2

Post by Gustavob »

I asked Lantyz for this code before he released it here, so I could make convertibles. I made one. Screenshot:

Image
Left: Black convertible with no driver. Right: deep red convertible with player driver

The car used is the GTA1 Stinger Z29.

Nice idea you had for bikes, Lantyz ;]
You just lost the game.
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: Bikes and convertibles in GTA2

Post by Sektor »

Cool. I knew it was possible but good to see someone actually do it.
Razor
Lunatic
Lunatic
Posts: 456
Joined: 19 Jul 2008, 14:14
GH nick: Razor, R
Location: Poland / Szczecin
Contact:

Re: Bikes and convertibles in GTA2

Post by Razor »

but drivers are dressed diffrend :(
User avatar
Gustavob
Immortal
Posts: 407
Joined: 18 May 2009, 21:40
GH nick: Gustavob
|Gustavob|
Location: Nowhere.
Contact:

Re: Bikes and convertibles in GTA2

Post by Gustavob »

Yep, but theres no how to fix that.
You just lost the game.
Post Reply