020C

From GTAMods Wiki
Jump to navigation Jump to search

GTA III Vice City San Andreas ADD_EXPLOSION


Description

Creates an explosion at a point

Syntax

020C: create_explosion [int] at [flt1] [flt2] [flt3]

Parameter

[int]
Explosion type (see below)
[flt1]
X-coordinate
[flt2]
Y-coordinate
[flt3]
Z-coordinate

This opcode creates an explosion at a coordinates point. These are real explosions so they make sounds, cause damage, and shake the camera. Different explosion types produce different sound effects and have different ranges in which the sound of the explosion can be heard. Opcode 0565 creates the same visual explosion without sounds.

Explosion types

GTA III

Type Enum[1] SFX[2] Range Used in original SCM Notes
0 EXPLOSION_GRENADE 65 400.0
1 EXPLOSION_MOLOTOV 66 200.0
2 EXPLOSION_ROCKET 65 400.0
3 EXPLOSION_CAR 456 400.0
4 EXPLOSION_CAR_QUICK 456 400.0 Exactly the same as type 3
5 EXPLOSION_HELI 456 400.0
6 EXPLOSION_MINE 79 300.0
7 EXPLOSION_BARREL 65 400.0
8 EXPLOSION_TANK_GRENADE 65 400.0
9 EXPLOSION_HELI_BOMB 79 300.0

Vice City

Type Enum SFX[3] Range Used in original SCM Notes
0 EXPLOSION_GRENADE 48 200.0 Grenade
1 EXPLOSION_MOLOTOV 49 150.0 Molotov Cocktail, can only explode on ground and cannot explode over water
2 EXPLOSION_ROCKET 48 200.0 Rocket
3 EXPLOSION_CAR 47 200.0 Car and motorcycle
4 EXPLOSION_CAR_QUICK 47 200.0 Exactly the same as type 3
5 EXPLOSION_BOAT 47 200.0 Exactly the same as type 3; boat
6 EXPLOSION_HELI 47 200.0 Final destruction of the NPC police helicopter and the NPC Dodo
7 EXPLOSION_HELI2 47 200.0 Similar to type 6; midair explosion of the NPC police helicopter
8 EXPLOSION_MINE 59 200.0 Pickup mine
9 EXPLOSION_BARREL 48 200.0 Explosive barrel
10 EXPLOSION_TANK_GRENADE 48 200.0 Rhino cannon
11 EXPLOSION_HELI_BOMB 59 200.0
  1. ^ Enums whose values are used in the original script are from GTAModding.ru. The rest are inferred from Vice City's enums.
  2. ^ These values correspond to an SFX entry. The association between the explosion and SFX is hardcoded. The range is how far the player can be in meters before the sound diminishes. For III v1.0, the location of the array in memory starts at 0x609240.
  3. ^ For VC v1.0, the location of the array in memory starts at 0x6B2D4C.

San Andreas

Keywords

add, create, explosion