Creating vehicles (GTA2)
Vehicles in GTA2 are 2D and consist of images (called 'sprites') that can be altered with smaller images ('deltas') to depict dents, doors, lights and other features. These images are stored in a style file (*.sty), which can be modified with a style editor like STY Tool or STYed.
Vehicles can only be replaced; it is impossible to add more vehicles to a style file. Before you create a vehicle, you should decide which original vehicle you want to replace. Open the style file you want to change (wil-, ste- and bil.sty for the Downtown, Residential and Industrial District, respectively) with STY Tool and choose a car to replace. If you select this car by clicking on it, its width and height will be shown at the right (for example, the Rumbler is 56 x 64 pixels). These are the dimensions your new car should have.
Start your favourite graphics editing program and create a vehicle with the correct dimensions, but keep in mind you have to leave enough space at both sides to be able to add the door animations later. Instead of creating your own car, you can also use an existing image. In this tutorial the Beast GTS from Grand Theft Auto will be converted to GTA2.
Most cars are available in various colours ('remaps'), but nevertheless each car only has one sprite. To create cars with different colours, the game switches the palette of the sprite: each remap has its own palette. To create a car that is available in multiple colours, you'll need to use the original palettes of GTA2. The palettes used for car remaps are numbered 31 and 168 through 202 in STY Tool, and 32 and 169 through 203 in STYed. De vehicles in the original style files use palette 31 (32), which is the default beige colour. This colour gives nice results in other rempas, but is very hard to do right. In this tutorial the blue palette 172 (173) is used, which is easier. The new car image must have the same colours as the palette. To do this, you'll need to export the palette which can only be done in STYed. Start STYed and open the style file with File > Open > Cars Only (you can use Cars + Tiles, but this takes more time). Select the palette you want to use in the bottom center panel of the editor ("pal 173" in this tutorial) and export this palette with File > Export > Export Palette. You can close STYed.
Make sure your vehicle has about the same colour as the palette by adjusting the hue and saturation of the image with a graphics program. The image of the Beast GTS is very dark, so it must be made lighter. You'll now need a graphics editing program that supports palettes (*.pal files), like Paint Shop Pro. Open the image of your car with this program and convert the image to the palette you exported with STYed (in Paint Shop Pro, this can be done with Colors > Load palette). The image is modified and will only have the colors of the palette. If the result doesn't look good the image probably wasn't close enough to the colours of the palette before it was converted. To fix this, you could try to change the hue and saturation of the original image some more and converting it again. Keep in mind that black (#000000), as well as pink (#FF00FF) and some other colours will be invisible in-game! Save the image as an 8bit bitmap (*.bmp) when you are happy with the result.
Go to STY Tool and select the vehicle you want to replace. Click on the button "import" and select your new vehicle. STY Tool will ask "Do you want to import palette for this image or just remap palindex to new palette?". Click "No", because we want to use one of the original palettes. A window with all available palettes will show up. Select palette 172 (note that the number is one less than in STYed!) and click "OK". Your new vehicle has been imported.
To create the doors, dents, lights, etc. of your vehicle you have to create deltas. Deltas are additional images that can be added to the main sprite. All deltas of a car are stored in a single delta sheet, which can be found by clicking on the button "deltas" in STY Tool. A window will show up in which you'll see twenty versions of your car with the deltas of the original car. Click on "Car images only" to make the original deltas invisible and click "Export deltas" to export this image (this may result in an unusable file; manually add ".bmp" to the file name while exporting to fix this).
Open the delta image with a graphics editing program and create the following deltas:
- Dent behind left
- Dent behind right
- Dent front right
- Dent front left
- Unused (original vehicles have a dent in the roof here)
- Tail light right
- Head light right
- Driver door (almost closed)
- Driver door (slightly opened)
- Driver door (almost open)
- Driver door (open)
- Five posibilities:
- Five posibilities:
- Five posibilities:
- Five posibilities:
- Three posibilities:
- Two posibilities:
- Emergency lights
- NUMBER_GRAPHIC 5 (GT-A1)
- NUMBER_GRAPHIC 6 (GT-A1)
- NUMBER_GRAPHIC 7 (GT-A1)
- NUMBER_GRAPHIC 8 (GT-A1)
Make sure you only change what's needed to create the delta. If you make parts of the main sprite invisible (like a dent) you have to colour them black. All deltas are optional: if a delta is unneeded (like emergency lights for a normal car) you can leave the delta as it is.
Open the image in Paint Shop Pro or a similar program, load the palette and save the image as a 8bit bmp just like you did with the sprite. Select the vehicle in STY Tool, go to "deltas" and click on "Import deltas" to import your own deltas. Your vehicle now has proper dents, doors, etc. If the vehicle appears scrambled while showing the delta's the delta images aren't completely identical to the car (apart from the actual dents, etc.). Cut a plain vehicle image from the delta sheet to use as the main sprite for the car and import the images again to fix this.
When you're done, press "Save as" to save the changes to the style file.
|Mapping||Map Editor · Buildings · Roads · Water & animations · Slopes · Flat tiles · Collision info · Level edge · Zones · Putting a level ingame|
|Scripting||Declarering:||Main script · Script Compiler · Code lists · Commands · Vehicles · Objects · Sounds · Characters|
|Programming:||IF · WHILE · COUNTERs · Subroutines · THREAD TRIGGERs · Kill Frenzies|
|Both||Manual · Lighting · Car shops · Cranes & crushers · Gangs · Subway · Multiplayer levels|
|File types||.gci · .gmp · .gxt · .mis · .mmp · .scr · .seq · .tmp · .sty|
|Other||Texting · Physics · Creating vehicles · Terminology · Installing levels|