Object, weapon and power-up placement (GTA2)
Main Page > GTA2 > Modding Tutorial > Creating objects, pick-ups and weapons
This chapter is about creating objects, such as weapons, power-ups or generic objects. This is done with the same command.
Contents
OBJ_DATA
OBJ_DATA name = ( X.x , Y.y , Z.z ) rotation object ammo
Name | An unique name |
---|---|
( X.x , Y.y , Z.z ) | The coordinates |
Rotation | The rotation of the object. This is normally '0' when placing weapons or power-ups. |
object | Which object, weapon or power-up you want to create. See the code lists below. |
ammo | The amount of ammo you want when placing a weapon. Leave this out if you're placing an object or a power-up. |
This command goes before LEVELSTART
Examples
If you want to create an instant vehicle bomb at the coordinates 119, 54, 2, the command will look like this:
OBJ_DATA instantbomb = ( 119.5 , 54.5 , 2.0 ) 0 COLLECT_23 1
And if you want to create a suitcase at 107, 67, 3, rotated 45 degrees, the command will look like this:
OBJ_DATA suitcase = ( 107.5 , 67.5 , 3.0 ) 45 BRIEFCASE
GENERATORs
You'll often want to create a respawning pick-up. This is done with GENERATORs. Generators are slightly more complicated than normal OBJ_DATA commands and consist of two parts. The first part looks like this:
GENERATOR name = ( X.x , Y.y , Z.z ) rotation pickup_type timer_min timer_max ammo
Name | An unique name. You'll need this name later, so choose recognisable names. |
---|---|
( X.x , Y.y , Z.z ) | The coordinates |
Rotation | The rotation of the weapon. |
pickup_type | The weapon or power-up type you want to spawn. |
timer_min | The minimum amount of cycles before the weapon can respawn. 1800 cycles is about one minute. |
timer_max | The maximum amount of cycles before the weapon can respawn. |
ammo | The amount of ammo. Leave out if you're creating a power-up. |
This part of the generator command only declares where the generator should be and what it should create. Therefore, it goes before LEVELSTART. Generators are turned of by default and have to be turned on with a command after LEVELSTART.
SWITCH_GENERATOR ( generator_name , ON/OFF/value )
generator_name | The name of the generator you've used earlier. |
---|---|
ON/OFF/value | With "ON" and "OFF" you can activate or deactivate the generator. You can also give the GENERATOR a value to make it create a set amount of weapons before it shuts itself down. |
Note that GTA2 cannot handle more than 120 GENERATORs.
Example
If you want to create a shotgun with 15 ammo at the coordinates 131, 98, 2, which respawns at least every two minutes, the command will look like this:
GENERATOR respawningshotgun = ( 131.5 , 98.5 , 2.0 ) 0 COLLECT_06 3000 3600 15 LEVELSTART SWITCH_GENERATOR ( respawningshotgun , ON ) LEVELEND
Code lists
This list contains all objects which can be used in GTA2. A lot of objects are remnants of unused features and may be glitchy. GTA Scripting.doc also mentions the objects CROSS
, GRAVE
and FBI BLOCK
, but these objects aren't recognised by the compiler.
Weapons
|
Power-ups
|
Objects
Object | Code |
---|---|
BENCH | Bench, only movable with a car. |
BIN | Garbage bin, almost unmovable. |
BIN_LID | lid of a garbage bin, only movable on foot. |
BLASTER | Ghetto blaster with sound |
BLOOD | Blood stain of GTA1. |
BONUS_TOKEN | GTA2 Bonus badge |
BOMB | Bomb HUD image |
BOXES | Two cardboard boxes. Fall apart when you drive or walk over them. |
BRIEFCASE | Briefcase in blue circle. |
CAR_SHOP | Max Paynt, see Scripten car shops |
CONE | traffic cone, movable. |
CRATE | Crate. Falls apart when you drive or walk over it. |
FOOTY | Soccer ball, movable. |
HARDBOX | Box, movable |
HYDRANT | Pipe, unmovable. |
HYDRANT_LID | Lid of a pipe, movable. |
HYDRANT_UNLID | Pipe without lid, unmovable. |
INVISIBLE_TARGET | Invisible target for Tanks |
INVISIBLE_DESTRUCTIBLE | Invisible roadblock |
INVISIBLE_DEAD | Wrecked invisible roadblock |
MINE | Vehicle mine |
NEWSDIS | News stand, movable |
OIL | Vehicle oil slick |
ANIMATING_OIL | Animation of a vehicle oil slick |
OILDRUM | Oil barrel, movable. |
PACKAGE | Package, movable. |
PHONE | Standard (blue) telephone |
GREEN_PHONE | Green telephone |
YELLOW_PHONE | Yellow telephone |
RED_PHONE | Red telephone |
POWERGEN | Generator |
POWERGEN_DEAD | Wrecked generator |
RED_FOOTPRINTS | Two red footprints |
REMOTE | RC Badge |
ROADBLOCK | Roadblock, only movable by car. |
RUBBISH | Rubbish. Falls apart when you drive or walk over it. |
TRAFFIC_LIGHT | Stoplicht, blijft op rood staan. |
TYRE | Autoband, verplaatsbaar met een auto of te voet. |
TUNNEL_BLOCKER | Train tunnel block: only trains can pass through it. |
KILL_FRENZY | Kill Frenzy bagde |
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 |