Difference between revisions of "Weaponinfo.xml"

From GTAMods Wiki
Jump to navigation Jump to search
m (Added links to particle effects page under "Effects")
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The Weaponinfo.xml file is used only in [[:Category: GTA 4|GTA 4]] to define the [[weapon]] stats as recoil, damage, projectile type... This file can be opened with any web editor.
+
{{File-stub}}
 +
{{cleanup-rewrite}}
 +
The <code>weaponinfo.xml</code> file was first introduced with [[GTA IV]]. It is used to define the behavior of [[weapon]]s, similar to the [[weapon.dat]] used in previous games. This file can be viewed with any web browser, XML editor or simple text editor.
  
 
==Structure==
 
==Structure==
 
This file is split in three big sections, for each type of weapon: Melee, gun weapons and projectiles.  
 
This file is split in three big sections, for each type of weapon: Melee, gun weapons and projectiles.  
  
==Weapon==
+
===Weapon===
  
;weapon type="": Determines weapon name. You can create up to 25 additional weapons by using the unassigned names UNUSED0 and/or EPISODIC_1 - EPISODIC_24 (Explained in more detail here:[http://www.gtaforums.com/index.php?showtop...st&p=1058751902 Topic at Gtaforums])
+
;weapon type="": Determines weapon name. You can create up to 25 additional weapons by using the unassigned names UNUSED0 and/or EPISODIC_1 - EPISODIC_24 {{ref|1}}
 
;data slot="": Slot to carry weapon in.
 
;data slot="": Slot to carry weapon in.
 
;firetype="": Bullet characteristics to use...is also defined under "PROJECTILE TYPE="
 
;firetype="": Bullet characteristics to use...is also defined under "PROJECTILE TYPE="
Line 12: Line 14:
 
;group="": Determines what effect to create from weaponFx.dat file.
 
;group="": Determines what effect to create from weaponFx.dat file.
 
;targetrange="": Distance auto-aim can be used and target's health appears in reticule.
 
;targetrange="": Distance auto-aim can be used and target's health appears in reticule.
;weaponrange="": Defines how far the weapon shoots. Distances are also determined by the projectile's velocity, mass, etc defined under "PROJECTILE TYPE=".
+
;weaponrange="": Defines how far the weapon shoots. Distances are also determined by the projectile's velocity, mass, etc defined under "projectile type=".
 
;clipsize="": Ammo per clip.
 
;clipsize="": Ammo per clip.
 
;ammomax="": Max ammo allowed for weapon.
 
;ammomax="": Max ammo allowed for weapon.
Line 24: Line 26:
 
;crouchtime="": Time it takes to crouch in milliseconds.
 
;crouchtime="": Time it takes to crouch in milliseconds.
  
;<aiming accuracy="": Auto-aim accuracy while standing.
+
;aiming accuracy="": Auto-aim accuracy while standing.
 
;offset x="" y="" z="": Determines auto-aim drift on the x,y,z coords
 
;offset x="" y="" z="": Determines auto-aim drift on the x,y,z coords
 
;crouchedoffset x="" y="" z="": Auto-aim accuracy while crouched.
 
;crouchedoffset x="" y="" z="": Auto-aim accuracy while crouched.
Line 35: Line 37:
 
;intensity="": Controller rumble strength.
 
;intensity="": Controller rumble strength.
  
==Flags==
+
===Flags===
  
Flags go inside the <flag> stack
+
Flags go inside the <flag> stack. '''Example''': <flag>GUN</flag>
 +
{| {{Prettytable}} class="collapsible"
 +
!Flag
 +
!Description
 +
|-
 +
|GUN|| Identifies the weapon as a firearm
 +
|-
 +
|MELEE_CLUB|| Used for victims behavior when hit
 +
|-
 +
|MELEE_BLADE|| Used for victims behavior when hit
 +
|-
 +
|2HANDED|| Weapon is held with both hands
 +
|-
 +
|THROWN|| Weapon is thrown (affected by gravity)
 +
|-
 +
|TREAT_AS_2HANDED_IN_COVER|| Weapon is held in both hands while in cover
 +
|-
 +
|FIRST_PERSON|| First person aim with no crosshair
 +
|-
 +
|HEAVY|| Forces heavy weapon anims to be used
 +
|-
 +
|CREATE_VISIBLE_ORDNANCE|| Shows projectile before it is fired.
 +
|-
 +
|HIGHER_BREAK_FORCE|| Destroys objects faster
 +
|-
 +
|EXPLOSION_BASED_ON_IMPACT|| Determines when weapon explodes based on explodeimpactthreshold="" <br>explodeimpactwithvehiclethreshold="": data defined under <projectile>
 +
|-
 +
|ADD_SMOKE_ON_EXPLOSION|| Adds smoke effect to explosion.
 +
|-
 +
|SILENCED|| Silences the projectile/thrown weapon while in flight.
 +
|-
 +
|INSTANT_KILL_IN_MP|| Instant kill on impact in a MP game
 +
|-
 +
|ARMOUR_PENETRATING|| Bypasses body armor hit check.
 +
|-
 +
|KEEP_CAMERA_BEHIND||
 +
|-
 +
|CAN_AIM|| Allows weapon to be auto-aimed
 +
|-
 +
|CAN_FREE_AIM|| Allows weapon to free aim
 +
|-
 +
|ANIM_RELOAD||
 +
|-
 +
|ANIM_CROUCH_FIRE||
 +
|}
  
;<flag>GUN</flag>: Identifies the weapon as a firearm
+
===Projectile===
;<flag>MELEE_CLUB</flag>: Used for victims behavior when hit
 
;<flag>MELEE_BLADE</flag>: Used for victims behavior when hit
 
;<flag>2HANDED</flag>: Weapon is held with both hands
 
;<flag>THROWN</flag>: Weapon is thrown (affected by gravity)
 
;<flag>TREAT_AS_2HANDED_IN_COVER</flag>: Weapon is held in both hands while in cover
 
;<flag>FIRST_PERSON</flag>: First person aim with no crosshair
 
;<flag>HEAVY</flag>: Forces heavy weapon anims to be used
 
;<flag>CREATE_VISIBLE_ORDNANCE</flag>: Shows projectile before it is fired.
 
;<flag>HIGHER_BREAK_FORCE</flag>:
 
;<flag>EXPLOSION_BASED_ON_IMPACT</flag>: Determines when weapon explodes based on explodeimpactthreshold="" explodeimpactwithvehiclethreshold="": data defined under <projectile>
 
;<flag>ADD_SMOKE_ON_EXPLOSION</flag>: Adds smoke effect to explosion.
 
;<flag>SILENCED</flag>: Silences the projectile/thrown weapon while in flight.
 
;<flag>INSTANT_KILL_IN_MP</flag>: Instant kill on impact in a MP game
 
;<flag>ARMOUR_PENETRATING</flag>: Bypasses body armor hit check.
 
;<flag>KEEP_CAMERA_BEHIND</flag>:
 
;<flag>CAN_AIM</flag>: Allows weapon to be auto-aimed
 
;<flag>CAN_FREE_AIM</flag>: Allows weapon to free aim
 
;<flag>ANIM_RELOAD</flag>:
 
;<flag>ANIM_CROUCH_FIRE</flag>:
 
 
 
 
 
==Projectile==
 
  
 
Projectile data goes inside the <projectile> stack
 
Projectile data goes inside the <projectile> stack
  
;projectile type="" - Defines the projectile type. "NONE" makes a copy of the item held in your hand.
+
;projectile type="": Defines the projectile type. "NONE" makes a copy of the item held in your hand.
;typetocreate type="" - Defines projectile type. Used in special cases such as creating a rocket.
+
;typetocreate type="": Defines projectile type. Used in special cases such as creating a rocket.
;fusetime="" - Time in milliseconds it takes for projectile to explode after it is fired/thrown.
+
;fusetime="": Time in milliseconds it takes for projectile to explode after it is fired/thrown.
;explosion type="" - Defines the effect to use from explosionFx.dat
+
;explosion type="": Defines the effect to use from explosionFx.dat
;vehiclevelocity="" - Defines the projectile's speed.
+
;vehiclevelocity="": Defines the projectile's speed.
  
  
;<assets model=""> - Weapon model to use.
+
;<assets model="">: Weapon model to use.
;<anim group=""> - Weapon animation to use.
+
;<anim group="">: Weapon animation to use.
;<meleegroup1=""> - Weapon melee animation to use.
+
;<meleegroup1="">: Weapon melee animation to use.
  
 
'''Effects'''
 
'''Effects'''
  
;<muzzle fx=""> - Muzzle effect to use.
+
;<muzzle fx="">: Muzzle [[List_of_particle_effects#Weapon_usage | effect]] to use.
;<shell fx=""> - Shell effect to use.
+
;<shell fx="">: Shell [[List_of_particle_effects#Weapon_usage | effect]] to use.
;<trail fx=""> - Projectile trail effect to use.
+
;<trail fx="">: Projectile trail [[List_of_particle_effects#Weapon_usage | effect]] to use.
 +
 
 +
== Tools ==
 +
* [[IV Needle#Weapon Editor|IV Needle]] by {{U|CoMPMStR}}
  
==External Links==
+
== External Link ==
* [http://www.gtaforums.com/index.php?showtopic=383690 Weaponsinfo.xml] - GTA Forums topic used for research and test of this file.
+
* {{GTAF|383690|Weaponsinfo.xml}}
==Tools==
+
* {{note|1}} {{GTAF|post|380874|1058751902|Weapon types}}
* [http://www.gtaforums.com/index.php?showtopic=385815 Weapon editor] - Tool to edit the file, by [[User:CoMPMStR|CoMPMStR]].
 
  
[[Category:GTA 4]]
+
{{GTA4-navi}}
 +
[[Category:File Formats]]

Latest revision as of 20:10, 7 September 2011

40px-Ambox rewrite orange.svg.png This article may need to be rewritten.
Please help improve this article. The discussion page may contain suggestions.

The weaponinfo.xml file was first introduced with GTA IV. It is used to define the behavior of weapons, similar to the weapon.dat used in previous games. This file can be viewed with any web browser, XML editor or simple text editor.

Structure

This file is split in three big sections, for each type of weapon: Melee, gun weapons and projectiles.

Weapon

weapon type=""
Determines weapon name. You can create up to 25 additional weapons by using the unassigned names UNUSED0 and/or EPISODIC_1 - EPISODIC_24 [1]
data slot=""
Slot to carry weapon in.
firetype=""
Bullet characteristics to use...is also defined under "PROJECTILE TYPE="
damagetype=""
Determines type of impact damage...is also defined under "EXPLOSION TYPE=".
group=""
Determines what effect to create from weaponFx.dat file.
targetrange=""
Distance auto-aim can be used and target's health appears in reticule.
weaponrange=""
Defines how far the weapon shoots. Distances are also determined by the projectile's velocity, mass, etc defined under "projectile type=".
clipsize=""
Ammo per clip.
ammomax=""
Max ammo allowed for weapon.
timebetweenshots=""
Time in milliseconds between each shot. Is also determined by the gunfire animation speed which cannot be edited in WeaponInfo.
damage base=""
Damage dealt by bullets. Projectile and explosion damage is defined in explosionFx.dat.
networkplayermod=""
Modifier for the weapon's damage in multiplayer.
networkpedmod=""
Same as above but for peds in multiplayer.
physics force=""
Projectile's impact force. Can also be defined under "PROJECTILE TYPE=".
reload time=""
Reload time in milliseconds.
fasttime=""
Time it takes to aim in milliseconds.
crouchtime=""
Time it takes to crouch in milliseconds.
aiming accuracy=""
Auto-aim accuracy while standing.
offset x="" y="" z=""
Determines auto-aim drift on the x,y,z coords
crouchedoffset x="" y="" z=""
Auto-aim accuracy while crouched.
reticule standing="" ducked="" scale=""
Reticule size while standing and crouched and target scale (zoom).
pickup regentime=""
Time in milliseconds it takes pickups to respawn.
ammoonstreet=""
Ammo given on weapon pickup.
rumble duration=""
Controller rumble time in milliseconds.
intensity=""
Controller rumble strength.

Flags

Flags go inside the <flag> stack. Example: <flag>GUN</flag>

Flag Description
GUN Identifies the weapon as a firearm
MELEE_CLUB Used for victims behavior when hit
MELEE_BLADE Used for victims behavior when hit
2HANDED Weapon is held with both hands
THROWN Weapon is thrown (affected by gravity)
TREAT_AS_2HANDED_IN_COVER Weapon is held in both hands while in cover
FIRST_PERSON First person aim with no crosshair
HEAVY Forces heavy weapon anims to be used
CREATE_VISIBLE_ORDNANCE Shows projectile before it is fired.
HIGHER_BREAK_FORCE Destroys objects faster
EXPLOSION_BASED_ON_IMPACT Determines when weapon explodes based on explodeimpactthreshold=""
explodeimpactwithvehiclethreshold="": data defined under <projectile>
ADD_SMOKE_ON_EXPLOSION Adds smoke effect to explosion.
SILENCED Silences the projectile/thrown weapon while in flight.
INSTANT_KILL_IN_MP Instant kill on impact in a MP game
ARMOUR_PENETRATING Bypasses body armor hit check.
KEEP_CAMERA_BEHIND
CAN_AIM Allows weapon to be auto-aimed
CAN_FREE_AIM Allows weapon to free aim
ANIM_RELOAD
ANIM_CROUCH_FIRE

Projectile

Projectile data goes inside the <projectile> stack

projectile type=""
Defines the projectile type. "NONE" makes a copy of the item held in your hand.
typetocreate type=""
Defines projectile type. Used in special cases such as creating a rocket.
fusetime=""
Time in milliseconds it takes for projectile to explode after it is fired/thrown.
explosion type=""
Defines the effect to use from explosionFx.dat
vehiclevelocity=""
Defines the projectile's speed.


<assets model="">
Weapon model to use.
<anim group="">
Weapon animation to use.
<meleegroup1="">
Weapon melee animation to use.

Effects

<muzzle fx="">
Muzzle effect to use.
<shell fx="">
Shell effect to use.
<trail fx="">
Projectile trail effect to use.

Tools

External Link