Difference between revisions of "Weapon"

From GTAMods Wiki
Jump to navigation Jump to search
(Mission Script: tabulated opcodes)
(sound effects moved to ProcessPedOneShots)
Line 4: Line 4:
 
== Mission script ==
 
== Mission script ==
 
=== Opcodes ===
 
=== Opcodes ===
{|
+
{|class="nowrap-col-2"
 
|[[0113]] ||{{Icon|3}} ||adds ammo to the player's weapon
 
|[[0113]] ||{{Icon|3}} ||adds ammo to the player's weapon
 
|-
 
|-
Line 178: Line 178:
  
 
=== Vice City ===
 
=== Vice City ===
[[Vice City]] is the first GTA that lets you replace a weapon of the same type. Most of the information on the weapons are located in the <code>[[weapon.dat]]</code> file. Information on melee combat is located in the <code>[[melee.dat]]</code> file. The textures and models of the weapons are located in the <code>[[gta3.img]]</code> file. The HUD icon of the first is located in the <code>[[hud.txd]]</code> file. All sound effects listed here are [[hardcoded]] and their values correspond to the [[SFX#Vice City|SFX]] file.
+
[[Vice City]] is the first GTA that lets you replace a weapon of the same type. Most of the information on the weapons are located in the <code>[[weapon.dat]]</code> file. Information on melee combat is located in the <code>[[melee.dat]]</code> file. The textures and models of the weapons are located in the <code>[[gta3.img]]</code> file. The HUD icon of the first is located in the <code>[[hud.txd]]</code> file.
{| class="collapsible sortable collapsed wikitable" style="width: 65em;"
+
{|class="collapsible sortable collapsed wikitable center-col-1"
!Number ||Name ||ID ||DFF/TXD name ||Icon ||Group ||Swing{{ref|1}} ||Hit{{ref|2}} ||Reload{{ref|3}} ||Fire{{ref|4}} ||Halt fire{{ref|5}}
+
!Number ||Name ||Model<br>index ||DFF/TXD name ||Icon ||Group
 
|-
 
|-
|{{a|c}} |0 ||Unarmed || || ||[[File:VC fist.png]] ||0 ||81 ||167-170 ||- ||- ||-
+
|0 ||Unarmed || || ||[[File:VC fist.png]] ||0
 
|-
 
|-
|{{a|c}} |1 ||Brass Knuckle ||259 ||brassknuckle ||[[File:VC brassknuckle.png]] ||0 ||81 ||174-175 ||- ||- ||-
+
|1 ||Brass Knuckle ||259 ||brassknuckle ||[[File:VC brassknuckle.png]] ||0
 
|-
 
|-
|{{a|c}} |2 ||Screw Driver ||260 ||screwdriver ||[[File:VC screwdriver.png]] ||1 ||171 ||172-173 ||- ||- ||-
+
|2 ||Screw Driver ||260 ||screwdriver ||[[File:VC screwdriver.png]] ||1
 
|-
 
|-
|{{a|c}} |3 ||Golf Club ||261 ||golfclub ||[[File:VC golfclub.png]] ||1 ||81 ||165-166 ||- ||- ||-
+
|3 ||Golf Club ||261 ||golfclub ||[[File:VC golfclub.png]] ||1
 
|-
 
|-
|{{a|c}} |4 ||Night Stick ||262 ||nitestick ||[[File:VC nitestick.png]] ||1 ||81 ||165-166 ||- ||- ||-
+
|4 ||Night Stick ||262 ||nitestick ||[[File:VC nitestick.png]] ||1
 
|-
 
|-
|{{a|c}} |5 ||Knife ||263 ||knifecur ||[[File:VC knifecur.png]] ||1 ||171 ||172-173 ||- ||- ||-
+
|5 ||Knife ||263 ||knifecur ||[[File:VC knifecur.png]] ||1
 
|-
 
|-
|{{a|c}} |6 ||Baseball Bat ||264 ||bat ||[[File:VC bat.png]] ||1 ||81 ||165-166 ||- ||- ||-
+
|6 ||Baseball Bat ||264 ||bat ||[[File:VC bat.png]] ||1
 
|-
 
|-
|{{a|c}} |7 ||Hammer ||265 ||hammer ||[[File:VC hammer.png]] ||1 ||81 ||174-175 ||- ||- ||-
+
|7 ||Hammer ||265 ||hammer ||[[File:VC hammer.png]] ||1
 
|-
 
|-
|{{a|c}} |8 ||Cleaver ||266 ||cleaver ||[[File:VC cleaver.png]] ||1 ||171 ||172-173 ||- ||- ||-
+
|8 ||Cleaver ||266 ||cleaver ||[[File:VC cleaver.png]] ||1
 
|-
 
|-
|{{a|c}} |9 ||Machete ||267 ||machete ||[[File:VC machete.png]] ||1 ||171 ||172-173 ||- ||- ||-
+
|9 ||Machete ||267 ||machete ||[[File:VC machete.png]] ||1
 
|-
 
|-
|{{a|c}} |10 ||Katana ||268 ||katana ||[[File:VC katana.png]] ||1 ||171 ||172-173 ||- ||- ||-
+
|10 ||Katana ||268 ||katana ||[[File:VC katana.png]] ||1
 
|-
 
|-
|{{a|c}} |11 ||Chainsaw ||269 ||chnsaw ||[[File:VC chnsaw.png]] ||1 ||- ||- ||- ||- ||-
+
|11 ||Chainsaw ||269 ||chnsaw ||[[File:VC chnsaw.png]] ||1
 
|-
 
|-
|{{a|c}} |12 ||Grenade ||270 ||grenade ||[[File:VC grenade.png]] ||2 ||- ||- ||- ||- ||-
+
|12 ||Grenade ||270 ||grenade ||[[File:VC grenade.png]] ||2
 
|-
 
|-
|{{a|c}} |13 ||Remote Detonator ||291 ||bomb ||style="height: 64px;" |[[File:VC grenade.png|32px]][[File:VC bomb.png|32px]] ||2 ||- ||- ||- ||- ||-
+
|13 ||Remote Detonator ||291 ||bomb ||style="height: 64px;" |[[File:VC grenade.png|32px]][[File:VC bomb.png|32px]] ||2
 
|-
 
|-
|{{a|c}} |14 ||Tear Gas ||271 ||teargas ||[[File:VC teargas.png]] ||2 ||- ||- ||- ||- ||-
+
|14 ||Tear Gas ||271 ||teargas ||[[File:VC teargas.png]] ||2
 
|-
 
|-
|{{a|c}} |15 ||Molotov ||272 ||molotov ||[[File:VC molotov.png]] ||2 ||- ||- ||- ||- ||-
+
|15 ||Molotov ||272 ||molotov ||[[File:VC molotov.png]] ||2
 
|-
 
|-
|{{a|c}} |16 ||Missile ||273 ||missile ||style="height: 64px;" |- ||2 ||- ||- ||79 ||59-60 ||-
+
|16 ||Missile ||273 ||missile ||style="height: 64px;" |- ||2
 
|-
 
|-
|{{a|c}} |17 ||Colt .45 (Pistol) ||274 ||colt45 ||[[File:VC colt45.png]] ||3 ||- ||- ||77 ||50-51 ||-
+
|17 ||Colt .45 (Pistol) ||274 ||colt45 ||[[File:VC colt45.png]] ||3
 
|-
 
|-
|{{a|c}} |18 ||Python (.357) ||275 ||python ||[[File:VC python.png]] ||3 ||- ||- ||77 ||88-89 ||-
+
|18 ||Python (.357) ||275 ||python ||[[File:VC python.png]] ||3
 
|-
 
|-
|{{a|c}} |19 ||Chrome Shotgun ||277 ||chromegun ||[[File:VC chromegun.png]] ||4 ||- ||- ||78 ||66-67 ||-
+
|19 ||Chrome Shotgun ||277 ||chromegun ||[[File:VC chromegun.png]] ||4
 
|-
 
|-
|{{a|c}} |20 ||Spaz Shotgun (S.P.A.S. 12) ||278 ||shotgspa ||[[File:VC shotgspa.png]] ||4 ||- ||- ||78 ||85-86 ||87
+
|20 ||Spaz Shotgun (S.P.A.S. 12) ||278 ||shotgspa ||[[File:VC shotgspa.png]] ||4
 
|-
 
|-
|{{a|c}} |21 ||Stubby Shotgun ||279 ||buddyshot ||[[File:VC buddyshot.png]] ||4 ||- ||- ||78 ||66-67 ||-
+
|21 ||Stubby Shotgun ||279 ||buddyshot ||[[File:VC buddyshot.png]] ||4
 
|-
 
|-
|{{a|c}} |22 ||Tec-9 ||281 ||tec9 ||[[File:VC tec9.png]] ||5 ||- ||- ||78 ||71-72 ||73
+
|22 ||Tec-9 ||281 ||tec9 ||[[File:VC tec9.png]] ||5
 
|-
 
|-
|{{a|c}} |23 ||Uzi 9mm (Uz-I) ||282 ||uzi ||[[File:VC uzi.png]] ||5 ||- ||- ||78 ||54-55 ||56
+
|23 ||Uzi 9mm (Uz-I) ||282 ||uzi ||[[File:VC uzi.png]] ||5
 
|-
 
|-
|{{a|c}} |24 ||Ingram Mac 10 ||283 ||ingramsl ||[[File:VC ingramsl.png]] ||5 ||- ||- ||78 ||71-72 ||73
+
|24 ||Ingram Mac 10 ||283 ||ingramsl ||[[File:VC ingramsl.png]] ||5
 
|-
 
|-
|{{a|c}} |25 ||MP5 (MP) ||284 ||mp5lng ||[[File:VC mp5lng.png]] ||5 ||- ||- ||78 ||90-91 ||56
+
|25 ||MP5 (MP) ||284 ||mp5lng ||[[File:VC mp5lng.png]] ||5
 
|-
 
|-
|{{a|c}} |26 ||M4 ||280 ||m4 ||[[File:VC m4.png]] ||6 ||- ||- ||78 ||74-75 ||76
+
|26 ||M4 ||280 ||m4 ||[[File:VC m4.png]] ||6
 
|-
 
|-
|{{a|c}} |27 ||Ruger (Kruger) ||276 ||ruger ||[[File:VC ruger.png]] ||6 ||- ||- ||78 ||74-75 ||76
+
|27 ||Ruger (Kruger) ||276 ||ruger ||[[File:VC ruger.png]] ||6
 
|-
 
|-
|{{a|c}} |28 ||Sniper Rifle ||285 ||sniper ||[[File:VC sniper.png]] ||8 ||- ||- ||80 ||57-58 ||76
+
|28 ||Sniper Rifle ||285 ||sniper ||[[File:VC sniper.png]] ||8
 
|-
 
|-
|{{a|c}} |29 ||PSG-1 (.308 Sniper) ||286 ||laser ||[[File:VC laser.png]] ||8 ||- ||- ||80 ||57-58 ||76
+
|29 ||PSG-1 (.308 Sniper) ||286 ||laser ||[[File:VC laser.png]] ||8
 
|-
 
|-
|{{a|c}} |30 ||Rocket Launcher ||287 ||rocketla ||[[File:VC rocketla.png]] ||7 ||- ||- ||79 ||59-60 ||-
+
|30 ||Rocket Launcher ||287 ||rocketla ||[[File:VC rocketla.png]] ||7
 
|-
 
|-
|{{a|c}} |31 ||Flame Thrower ||288 ||flame ||[[File:VC flame.png]] ||7 ||- ||- ||- ||- ||-
+
|31 ||Flame Thrower ||288 ||flame ||[[File:VC flame.png]] ||7
 
|-
 
|-
|{{a|c}} |32 ||M60 ||289 ||m60 ||[[File:VC m60.png]] ||7 ||- ||- ||78 ||68-69 ||70
+
|32 ||M60 ||289 ||m60 ||[[File:VC m60.png]] ||7
 
|-
 
|-
|{{a|c}} |33 ||Minigun ||290 ||minigun ||[[File:VC minigun.png]] ||7 ||- ||- ||- ||54-55 ||-
+
|33 ||Minigun ||290 ||minigun ||[[File:VC minigun.png]] ||7
 
|-
 
|-
|{{a|c}} |34 ||Detonator || || ||[[File:VC bomb.png]] ||9 ||- ||- ||- ||- ||-
+
|34 ||Detonator || || ||[[File:VC bomb.png]] ||9
 
|-
 
|-
|{{a|c}} |35 ||HeliCanon || || ||style="height: 64px;" |- ||7 ||- ||- ||78 ||68-69 ||70
+
|35 ||HeliCanon || || ||style="height: 64px;" |- ||7
 
|-
 
|-
|{{a|c}} |36 ||Camera ||292 ||camera ||[[File:VC camera.png]] ||9 ||- ||- ||- ||- ||-
+
|36 ||Camera ||292 ||camera ||[[File:VC camera.png]] ||9
 
|}
 
|}
 
The last five columns contain values that are associated with an entry in the SFX file. [[Hardcoded]] arrays are used to assign sound effects to the weapons. For VC v1.0:
 
# {{note|1}} Array starts at 0x6B6558, for group 1 weapons only. Every swing of a melee weapon creates a sound.
 
# {{note|2}} Array starts at 0x6B657C, for group 1 weapons only. Whenever the player hits a character, it plays a sound effect.
 
# {{note|3}} Array starts at 0x6B65A0. For weapons that allow reloading, a sound is played each time the weapon is reloaded.
 
# {{note|4}} Array starts at 0x6B65F0. For weapons that fires bullets, a combination of sounds is played each time the weapon is fired.
 
# {{note|5}} Array starts at 0x6B6660. Certain weapons play a short and soft sound effect when the player stops firing the weapon.
 
Note that some weapons share the same SFX but plays them differently (M4 and Ruger firing sound for example).
 
  
 
=== San Andreas ===
 
=== San Andreas ===

Revision as of 23:42, 26 December 2016

This article contains information about weapons related to mission scripting. For the definition of weapons through IDE files see WEAP and for the placement using IPL see PICK.

A weapon is anything that can damage other objects, including vehicles and pedestrians. It is one of the core gameplay features of Grand Theft Auto.

Mission script

Opcodes

0113 GTA III adds ammo to the player's weapon
0114 GTA III Vice City San Andreas adds ammo to the character's weapon
017A GTA III Vice City sets the player's weapon ammo
017B GTA III San Andreas sets the character's weapon ammo
01B1 GTA III Vice City gives the weapon to the player
01B2 GTA III Vice City San Andreas gives the weapon to the character
01B8 GTA III Vice City sets the current weapon of the player
01B9 GTA III Vice City San Andreas sets the current weapon of the character
0213 GTA III Vice City San Andreas creates a pickup with predefined ammo
0237 GTA III Vice City San Andreas sets the gang's weapons
02D7 GTA III Vice City checks the current weapon of the player
02D8 GTA III Vice City San Andreas checks the current weapon of the character
02E2 GTA III Vice City San Andreas sets the character's weapon accuracy
031D GTA III Vice City San Andreas checks if the character is damaged by the weapon
031E GTA III Vice City San Andreas checks if the vehicle is damaged by the weapon
032B GTA III Vice City San Andreas creates a pickup with ammo
0419 GTA III Vice City gets the ammo of the player's weapon
041A GTA III gets the ammo of the character's weapon
0467 GTA III Vice City San Andreas clears the character's last weapon damage
0468 GTA III Vice City San Andreas clears the vehicle's last weapon damage
046F GTA III Vice City gets the player's current weapon
0470 GTA III Vice City San Andreas gets the character's current weapon
048F Vice City San Andreas removes all of the character's weapons
0490 Vice City checks if the player has the weapon
0491 San Andreas checks if the character has the weapon
04B8 Vice City San Andreas gets the character's weapon data
0501 Vice City San Andreas sets player can do drive by
0555 San Andreas removes the weapon from the character
0563 Vice City San Andreas ensures player has a drive-by weapon
06AB San Andreas hides all weapons
0713 San Andreas makes the character do drive bys
081A San Andreas sets the character's weapon skill
087E San Andreas sets the character to drop weapons after a death
0881 San Andreas sets the character be able to shoot
0946 San Andreas sets the character oblivious to weapon fire
0992 San Andreas sets the player's ability to scroll through weapons

Native functions

This section is incomplete. You can help by fixing and expanding it.

Lists of Weapons

GTA III

Unlike in Vice City and San Andreas, where each weapon has a separate mesh and texture, GTA3's weapons are stored in a single DFF and TXD file, namely weapons.dff and generic.txd; only the selected object from the model hierarchy, e.g. pistol or Uzi is visible when the player chooses a weapon. Most of the information on the weapons are located in the weapon.dat file.

Vice City

Vice City is the first GTA that lets you replace a weapon of the same type. Most of the information on the weapons are located in the weapon.dat file. Information on melee combat is located in the melee.dat file. The textures and models of the weapons are located in the gta3.img file. The HUD icon of the first is located in the hud.txd file.

San Andreas

San Andreas is the first GTA that lets you dual wield weapons. Information on weapons, melee combat, textures, and models are located in the same files as in Vice City.

GTA IV

Main article: List of Weapons (GTA4)

External links