Difference between revisions of "Weapon"

From GTAMods Wiki
Jump to navigation Jump to search
(Mission Script: tabulated opcodes)
Line 2: Line 2:
 
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''.
 
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 ==
+
== Mission script ==
The following [[opcode]]s is related to weapons. Some of the opcodes are specific to one game so click on the opcode to see more information about it, if it exists.<br>
+
=== Opcodes ===
* [[0114]], sets an actor's weapon ammo while in a vehicle
+
{|
* [[017B]], sets an actor's weapon ammo
+
|[[0113]] ||{{Icon|3}} ||adds ammo to the player's weapon
* [[01B2]], gives an actor a weapon
+
|-
* [[01B9]], sets an actor's currently armed weapon
+
|[[0114]] ||{{Icon|t}} ||adds ammo to the character's weapon
* [[0237]], sets a gang's weapons
+
|-
* [[02D6]], checks if a weapon is being fired in a location
+
|[[017A]] ||{{Icon|3}} {{Icon|VC}} ||sets the player's weapon ammo
* [[02D8]], checks the current weapon an actor is holding
+
|-
* [[02E2]], sets an actor's weapon accuracy
+
|[[017B]] ||{{Icon|3}} {{Icon|SA}} ||sets the character's weapon ammo
* [[031D]], checks if an actor is hit by a weapon
+
|-
* [[031E]], checks if a vehicle is hit by a weapon
+
|[[01B1]] ||{{Icon|3}} {{Icon|VC}} ||gives the weapon to the player
* [[032B]], creates a [[pickup]] with ammo info &ndash; usually used for weapons
+
|-
* [[041A]], gets the current amount of ammo for the weapon
+
|[[01B2]] ||{{Icon|t}} ||gives the weapon to the character
* [[0467]], resets 031D
+
|-
* [[0468]], resets 031E
+
|[[01B8]] ||{{Icon|3}} {{Icon|VC}} ||sets the current weapon of the player
* [[0470]], gets an actor's current weapon
+
|-
* [[048F]], removes weapons from an actor
+
|[[01B9]] ||{{Icon|t}} ||sets the current weapon of the character
* [[0491]], checks if an actor has the weapon
+
|-
* [[04B8]], gets the weapon's data from an actor
+
|[[0213]] ||{{Icon|t}} ||creates a [[pickup]] with predefined ammo
* [[0501]], sets the player's ability to drive by
+
|-
* [[0555]], removes a specific weapon from an actor
+
|[[0237]] ||{{Icon|t}} ||sets the gang's weapons
* [[0563]], sets the player's drive by ammo
+
|-
* [[06AB]], hides all weapons
+
|[[02D7]] ||{{Icon|3}} {{Icon|VC}} ||checks the current weapon of the player
* [[0713]], makes an actor do drive bys
+
|-
* [[081A]], sets an actor's weapon skill
+
|[[02D8]] ||{{Icon|t}} ||checks the current weapon of the character
* [[087E]], sets an actor to drop weapons after a death
+
|-
* [[0881]], sets an actor be able to shoot
+
|[[02E2]] ||{{Icon|t}} ||sets the character's weapon accuracy
* [[0946]], sets an actor oblivious to weapon fire
+
|-
* [[0992]], sets the player's ability to scroll through weapons
+
|[[031D]] ||{{Icon|t}} ||checks if the character is damaged by the weapon
 +
|-
 +
|[[031E]] ||{{Icon|t}} ||checks if the vehicle is damaged by the weapon
 +
|-
 +
|[[032B]] ||{{Icon|t}} ||creates a pickup with ammo
 +
|-
 +
|[[0419]] ||{{Icon|3}} {{Icon|VC}} ||gets the ammo of the player's weapon
 +
|-
 +
|[[041A]] ||{{Icon|3}} ||gets the ammo of the character's weapon
 +
|-
 +
|[[0467]] ||{{Icon|t}} ||clears the character's last weapon damage
 +
|-
 +
|[[0468]] ||{{Icon|t}} ||clears the vehicle's last weapon damage
 +
|-
 +
|[[046F]] ||{{Icon|3}} {{Icon|VC}} ||gets the player's current weapon
 +
|-
 +
|[[0470]] ||{{Icon|t}} ||gets the character's current weapon
 +
|-
 +
|[[048F]] ||{{a|r}} |{{Icon|VC}} {{Icon|SA}} ||removes all of the character's weapons
 +
|-
 +
|[[0490]] ||{{a|c}} |{{Icon|VC}} ||checks if the player has the weapon
 +
|-
 +
|[[0491]] ||{{a|r}} |{{Icon|SA}} ||checks if the character has the weapon
 +
|-
 +
|[[04B8]] ||{{a|r}} |{{Icon|VC}} {{Icon|SA}} ||gets the character's weapon data
 +
|-
 +
|[[0501]] ||{{a|r}} |{{Icon|VC}} {{Icon|SA}} ||sets player can do drive by
 +
|-
 +
|[[0555]] ||{{a|r}} |{{Icon|SA}} ||removes the weapon from the character
 +
|-
 +
|[[0563]] ||{{a|r}} |{{Icon|VC}} {{Icon|SA}} ||ensures player has a drive-by weapon
 +
|-
 +
|[[06AB]] ||{{a|r}} |{{Icon|SA}} ||hides all weapons
 +
|-
 +
|[[0713]] ||{{a|r}} |{{Icon|SA}} ||makes the character do drive bys
 +
|-
 +
|[[081A]] ||{{a|r}} |{{Icon|SA}} ||sets the character's weapon skill
 +
|-
 +
|[[087E]] ||{{a|r}} |{{Icon|SA}} ||sets the character to drop weapons after a death
 +
|-
 +
|[[0881]] ||{{a|r}} |{{Icon|SA}} ||sets the character be able to shoot
 +
|-
 +
|[[0946]] ||{{a|r}} |{{Icon|SA}} ||sets the character oblivious to weapon fire
 +
|-
 +
|[[0992]] ||{{a|r}} |{{Icon|SA}} ||sets the player's ability to scroll through weapons
 +
|}
  
 
=== [[Native function]]s ===
 
=== [[Native function]]s ===

Revision as of 22:24, 30 July 2015

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. All sound effects listed here are hardcoded and their values correspond to the SFX file.

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:

  1. ^ Array starts at 0x6B6558, for group 1 weapons only. Every swing of a melee weapon creates a sound.
  2. ^ Array starts at 0x6B657C, for group 1 weapons only. Whenever the player hits a character, it plays a sound effect.
  3. ^ Array starts at 0x6B65A0. For weapons that allow reloading, a sound is played each time the weapon is reloaded.
  4. ^ Array starts at 0x6B65F0. For weapons that fires bullets, a combination of sounds is played each time the weapon is fired.
  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 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