GTAGames.nl advertentie

Creating a subway (GTA2)

From WikiGTA - The Complete Grand Theft Auto Walkthrough
Jump to: navigation, search

Main Page > GTA2 > Modding Tutorial > Creating a subway


The subway in GTA2 is created with the track, several different types of zones and a few commands in the script. Plan your level carefully from the start when you want to add a subway, to prevent problems when you want to add the track and stations later.

Track

First of all, we need a track. Each style file has a set of rail tiles which are "electrocuted", which means peds will die if they walk on them. You don't necessarily have to use these tiles to create the track, but it is the most logical. In wil.sty, the tiles are 226 and 332. The last one can be made flat.

Paste a stretch of track tiles to create the track. Mark them as "field" and add green arrows in the direction the trains should travel. In block type mode, the track should look like this:

A double track in block type mode.

Corners

Tracks have to be a complete circle, so we need to make corners. Corners are made in the same way as roads, but they have to be covered. GTA2 cannot depict rotating train cars. Also, make sure the train has enough room to rotate: there should be an empty ring of at least one block around each corner. S-turns, like the one shown below, are not possible.

A corner. The selection shows how much room the train needs to rotate.
This S-turn is not possible.

Slopes

Maybe you want to use elevated tracks, which means you need slopes in the track. Like with corners, GTA2 cannot depict descending and ascending trains, so sloping tracks should be covered. To make the slope as small as possible, it is best to use the steepest slope. If you want to raise the track more than one block, you should leave one level block between the two slopes. See the example below.

A descending track. The selection shows how much room is needed. Note the level block between the slopes.

Stations

Each track needs at least one station (because trains start at a station). Make sure each train has enough room to stop at the station. The platform has to be long enough to support each passenger car at the very least. Passenger cars are two blocks long.

Zones

The tricky part of creating a subway is the placement of zones. Each station needs four different zones: A Railway Station(Platform), Railway Stop Point, Railway Station Entry Point en een Railway Exit Point. It is very important to position these zones correctly. One faulty zone can cause the whole subway to malfunction.

Railway Station(Platform)

The Railway Station(Platform) creates the platform: the area where travvelers will wait for the train. The zone should be positioned directly next to the track (not on it!). It may not be more than 1 block wide, the length depends on the length of the station. The zone doesn't have to cover the whole platform: only the part you want pedestrians to wait.

Railway Stop Point

The Railway Stop Point is a zone of 1 x 1 block and is placed on the exact location the train cab should stop. This zone should be placed so the passenger cars come to a halt next to the Railway Station(Platform) zone.

Railway Station Entry Point

The Railway Station Entry Point is a zone of 1 x 1 block and is placed on the exact location the train should slow down before entering the station.

Railway Station Exit Point

The Railway Station Exit Point is a zone of 1 x 1 block and is placed on the exact location the train should go to full speed after leaving the station.

Naming the zones

Each zone needs an unique name. Use the next code:

  • Each subway zone ha a name starting with "trak".
  • Each track has its own number. The first track is '0', the next '1', etc.
  • Likewise, each station has its own number. The first station is '0', the next '1', etc.
  • Most zones have a suffix according to the zone type:
    • The platform zone has no suffix
    • Railway Stop Point uses 'st'
    • Railway Station Entry Point uses 'en'
    • Railway Station Exit Point uses 'ex'

Examples

The placement of the zones of the first station of the first track.

The four zones of the first station of the first track have the following names:

trak00
trak00st
trak00en
trak00ex 


The four zones of the fourth station of the second track have the following names:


trak13
trak13st
trak13en
trak13ex 

Scripting the trains

Trains are created in the script with the next command:

SET_STATION_INFO ( platform , passenger_cars , trailer_cars , box_cars ) 
platform The name of the Railway Station(Platform) zone of the station where the train should be created at the start of the game. It is possible to create more trains on one track, but leave an empty station between the two trains.
passenger_cars The number of passenger cars. Each train needs at least one passenger car.
trailer_cars The number of trailer cars. Set this to 0 if you don't want the train to have trailers.
box_cars The number of box cars. Set this to 0 if you don't want the train to have box cars.

Every station where no trains start will need the next command:

SET_STATION_INFO ( platform , NO_TRAIN ) 

Furthermore, it's important to block all tunnels with a TUNNEL_BLOCKER, to prevent anything but trains from getting into the tunnel.

OBJ_DATA naam = ( X.x , Y.y , Z.z ) 0 TUNNEL_BLOCKER

These commands go before LEVELSTART

Notes

  • You can't create more than 3 tracks.
  • Each track may not have more than five stations
  • You can't create more than twelve stations.
  • According to GTA2 Scripting.doc, trains cabs may not have more than four cars, although it seems perfectly possible to script up to nine cars. However, this is very long. An average train consisting of one cab and four cars is about ten blocks long.
  • Train cars always appear in the same order: passenger car-trailer-box car.

Frequently encountered problems

  • My level crashes when I come to close to a certain station, even if I'm not inside a train.
    If the train does not cause the problem, then probably one of the station zones is the problem. Chances are the platform zone is placed or named incorrectly
  • When a train reaches a certain point on the track, it stops, explodes or the game crashes.
    Check the track for problems. Perhaps a (invisible) wall is blocking the train. If the problem occurs at a corner you should make sure the train ha enough room to turn.
  • The game crashes directly after starting the game.
    It is hard to figure out what is causing the crash if it happens instantly. Check for double zones and incorrectly named or numbered zones. Also, make sure you don't have too much trains, tracks or stations.
  • The train doesn't stop at stations (anymore).
    There's something wrong with an entry zone. If a train doesn't encounter or recognise the entry zone, it will keep driving until it finds one.
  • The train doesn't accelerate after leaving a station (anymore).
    There's someting wrong with an exit zone. If a train doesn't encounter or recognise the exit zone, it will keep driving slowly until it finds one.
  • All zones are correct, but the train doesn't appear at the station.
    This is a very frustrating problem and the cause is currently unknown. Try to script the train at a different station.
Modding tutorials of Grand Theft Auto 2
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