GTAGames.nl advertentie

Cranes and crushers (GTA2)

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

Main Page > GTA2 > Modding Tutorial > Cranes & Crushers


The basis of a car crusher system (note that the gray floors are added to show the dimensions and should be removed in the final map).
A complete car crusher with added details.

A car crusher is a combination of several scripted objects, including cranes, conveyors and the actual crusher.

List of features

Before you can create a complete car crusher system, you should understand how they work. Take a look at this break down:

  1. A car is parked beneath crane 1
  2. Crane 1 picks up the car and puts it into the crusher.
  3. The crusher crushes the car
  4. Crane 2 picks up the wreck and puts it on conveyor belt 1.
  5. The wreck passes through a scanner, rolls inside building 1 and disappears.
  6. At the other side of the building, a reward is created on conveyor belt 2 and rolls outside.
  7. If the reward isn't collected, it rolls inside building 2 and disappears.

The bold words are objects or events that have to be mapped and/or scripted.

Crusher

Lets start with the actual the crusher. The base must consist of five blocks arranged in a + sign; in the districts, the corners are filled with diagonal walls, forming an octagon. The base does not have to be elevated, but make sure it is impossible to get on the base.

To crusher itself is placed with the script with the following command:

CRUSHER name = ( X.x , Y.y )
name An unique name
( X.x , Y.y ) The coordinates of the middle of the base. Note that you don't need to add the Z coordinates; the game places the crusher on top of the topmost surface on this coordinates. That's why you can't map anything above the crusher.

Cranes

Next to the crusher, you have to create two cranes. Cranes simply exist of two blocks on top of eachother; the boom is added in the script There are several tiles to use for cranes, like tile 206. Don't put cranes to close to eachother, because it will look strange if a cranes moves through another one.

First crane

For the first crane, you need the following command:

CRANE_DATA name = ( X.x , Y.y ) crane_rotation NO_HOMECRANE FIRST ( X.x , Y.y 2) car_rotation 
name An unique name. You'll need this name later
( X.x , Y.y ) The coordinates of the crane. Again, without the Z coordinate.
crane_rotation The rotation of the boom in the start position
( X.x , Y.y 2) The coordinates where the crusher must put the car, which is the crusher in this case.
car_rotation The rotation the car should have when the crane puts it down. This should be 0 or 180 when the car is put inside a crusher.

Second crane

The second crane picks up the wreck an puts it on the conveyor belt. It is scripted with the next command:

CRANE_DATA name = ( X.x , Y.y ) crane_rotation name_first_crane SECOND ( X.x , Y.y 2) car_rotation 


name An unique name.
( X.x , Y.y ) The coordinates of the crane.
crane_rotation The rotation of the boom in the start position
name_first_crane The name of the first crane
( X.x , Y.y 2) The coordinates where the crusher must put the car, which is the conveyor belt in this case.
car_rotation The rotation the wreck should have when the crane puts it down. This should be aligned with the conveyor belt.

First & second crane

Aside from the first crane and second crane, there's also the "first and second crane", which isn't used. This crane picks up cars to drop them in a crusher, and picks up the wreck by themselves to put it onto the conveyor belt.

CRANE_DATA name = ( X.x , Y.y ) crane_rotation name_first-crane FIRST ( X.x , Y.y 2) car_rotation SECOND ( X.x , Y.y 3) wreck_rotation


name An unique name.
( X.x , Y.y ) The coordinates of the crane.
crane_rotation The rotation of the boom in the start position
name_first_crane The name of the first crane. Use "NO_HOMECRANE" if no first crane is present.
( X.x , Y.y 2) The coordinates where the crusher must drop the car.
car_rotation The rotation the car should have when the crane puts it down.
( X.x , Y.y 3) The coordinates where the crusher must drop the wreck.
wreck_rotation The rotation the wreck should have when the crane puts it down.

Basic crane

The basic crane is a normal crane which picks up cars and puts them on a Transporter or vice versa. This crane isn't used for car crushers.

CRANE_DATA name = ( X.x , Y.y ) crane_rotation NO_HOMECRANE 
name An unique name.
( X.x , Y.y ) The coordinates of the crane.
crane_rotation The rotation of the boom in the start position

Conveyor

The conveyor belts transport the wreck inside a building and the reward outside a building. They are made with animated tiles and a command. When mapping the conveyor belts, you should extend them at least two blocks inside the buildings to have enough room to make the objects appear and disappear out of sight. In wil.sty, the tiles used for conveyors are 745-748. Give the animation frame rate 2 to give them the same speed as the moving objects.

To make objects move when they are placed on the animated tiles, you have to add the following command:

CONVEYOR name = ( X.x , Y.y , Z.z ) ( X.x , Y.y 2) X Y 
name An unique name
( X.x , Y.y , Z.z ) The center of the conveyor. Make sure this is the exact center!
( X.x , Y.y 2) The length and width of the conveyor
X The movement according to the X axis: 1 is to the east, 0 is not moving and -1 is to the west.
Y The movement according to the Y axis: 1 is to the south, 0 is not moving and -1 is to the north.


Scanner

Scanners are invisible objects that scan the wreck or vehicle that passes through them to tell the GENERATOR which reward should be created. Note that scanners scan wrecks, but also unwrecked vehicles, making it possible to skip the crusher and make a system in which cars are "delivered" in exchange for a reward.

DECLARE_CRANE_POWERUP ( name_crane , name_generator , X , Y , Z ) 
name_crane The name of the crane that puts the wreck on the conveyor.
name_generator name of the generator that creates the rewards (see below)
X , Y , Z the coordinates of the scanner. The ideal location of a scanner is right in front of the DESTRUCTOR (see below), so you are sure the wreck passes through a scanner before it gets deleted.

Destructor

DESTRUCTORs are invisible objects that delete anything that passes through them. You'll need one at the end of each conveyor: one to remove the car wrecks, and one to remove unused rewards. DESTRUCTORs must be hidden in a building, to mask the fact the objects disappear in thin air.

DESTRUCTOR name = ( X.x , Y.y , Z.z ) ( X.x , Y.y 2) 
name An unique name
( X.x , Y.y , Z.z ) The exact center of the destructor
( X.x , Y.y 2) The length and width of the destructor.

GENERATOR

At the start of the second conveyor, the location where the rewards have to be created, you need to script a GENERATOR. It doesn't matter which OBJECT you set it to, and you don't have to activate it with a SWITCH_GENERATOR. The time it has to take to spawn a reward when the wreck passes through the scanner can be set with timer_min and timer_max.

Reward list

Finally, you need to set which cars should be rewarded with which pick-up. This can be done with the following command:

DECLARE_POWERUP_CARLIST ( CAR1 , CAR2 , ... , CAR18 , CAR19 ) 
( AUTO1 , AUTO2 , ... , AUTO18 , AUTO19 ) this list of cars corresponds to the list rewards below. CAR1 gives a machine gun, CAR2 a rocket launcher, CAR3 an electrogun, etc. Weapons come in sets of three: 3 x 5 ammo, while power-ups spawn only once. Cars not mentioned in this command will be rewarded with the machine gun.

Car crusher rewards

~1 S-Uzi machine gun
~2 Rocket launcher
~3 Electrogun
~4 Molotov cocktails
~5 Grenades
~6 Shotgun
~7 Electro baton (script a vehicle which is already in the list or a large vehicle here to prevent players from getting the electro baton)
~8 Flame thrower
~9 Silenced S-Uzi machine gun
~10 Health
~11 Armor
~12 Get outta jail freecard
~13 Cop bribe
~14 Invulnerability*
~15 Double damage
~16 Fast reload
~17 Electrofingers
~18 Respect!
~19 Invisibility

Ook dit commando moet voor LEVELSTART


Example

Below is an exampl of a complete and functional car crusher

CRANE_DATA crushera = ( 40.5 , 23.5 ) 0 NO_HOMECRANE FIRST ( 40.5 , 21.5 ) 180
CRANE_DATA crusherb = ( 44.5 , 21.5 ) 283 crushera SECOND ( 43.5 , 21.5 ) 0
CRUSHER crusherc = ( 40.5 , 21.5 )
CONVEYOR crusherd = ( 39.5 , 24.5 , 3.0 ) ( 6.0 , 1.0 ) -1 0
DESTRUCTOR crushere = ( 36.5 , 24.5 , 3.0 ) ( 1.0 , 1.0 )
CONVEYOR crusherg = ( 43.5 , 21.0 , 3.0 ) ( 1.0 , 6.0 ) 0 1
GENERATOR crusherf = ( 42.5 , 24.5 , 3.0 ) 0 COLLECT_06 1 2 5
DESTRUCTOR crusherh = ( 43.5 , 23.0 , 3.0 ) ( 1.0 , 1.0 )
DECLARE_CRANE_POWERUP ( crusherb , crusherf , 43 , 22 , 3 )
DECLARE_POWERUP_CARLIST ( ALFA , DART , EDSEL , FIAT , GRAHAM , JEFFREY , JEFFREY , MORGAN , MORRIS , SPIDER , STINGRAY , STYPE , STYPECAB , VESPA , WBTWIN , XK120 , MIURA , EDSELFBI , ISETTA )

Notes

  • You can script ten cranes; not more.
  • You can only use one POWERUP_CARLIST; every car crusher will give the same rewards.
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