Editing weapon configs (Pistol)

This tutorial will briefly explain how to modify the pistols.

1. Open the weapon_pistol.txt in Disk:\Program Files\Steam\steamapps\common\Left 4 Dead 2\left4dead2\scripts with notepad

2. You'll see:
Original Data
----------------------------------------------------------------------------------
WeaponData
{
// Terror-specific Data --------------------
"VerticalPunch" "2.0"
"SpreadPerShot" "1"
"MaxSpread" "30"
"SpreadDecay" "5"
"MinDuckingSpread" "0.5"
"MinStandingSpread" "1.5"
"MinInAirSpread" "3.0"
"MaxMovementSpread" "3.0"
"DeployDuration" "0.5"
"DualDeployDuration" "0.65"
"AddonAttachment" "pistol"
"Team" "Survivor"

"addon_offset" "0 0 0"
"addon_angles" "0 0 0"

"Tier" "0" // valid entries are 0, 1, 2

"ResponseRulesName" "SecondPistol"

// particle muzzle flash effect to play when fired
"MuzzleFlashEffect_1stPerson" "weapon_muzzle_flash_pistol_FP"
"MuzzleFlashEffect_3rdPerson" "weapon_muzzle_flash_pistol"

// model for the shell casing to eject when we fire bullets
"EjectBrassEffect" "weapon_shell_casing_9mm"

// Used in the music system when this weapon fires
"MusicDynamicSpeed" "0.8"

"DisplayName" "#L4D_Weapon_Pistol"
"DisplayNameAllCaps" "#L4D_Weapon_Pistol_CAPS"

// 360 Terror Data
"MaxAutoAimDeflection1" "10.0"
"MaxAutoAimRange1" "0"
//This value determins how "big" a target is for auto aim. If a target is 10.0 units big then it is considered 10.0*scale.
//You can think about this value controlling a falloff value on distant targets, the smaller the value the harder it is to hit at a distance.
"WeaponAutoAimScale" "1.0"
// End Terror-specific Data ----------------

"MaxPlayerSpeed" "250"
"WeaponType" "pistol"
"WeaponPrice" "500"
"WeaponArmorRatio" "1.0"
"CrosshairMinDistance" "8"
"CrosshairDeltaDistance" "3"
"BuiltRightHanded" "1"
"PlayerAnimationExtension" "pistol"
"MuzzleFlashScale" "1"

"CanEquipWithShield" "1"

"Rumble" "1"


// Weapon characteristics:
"PenetrationNumLayers" "2"
"PenetrationPower" "30"
"PenetrationMaxDistance" "0" // none

"Damage" "36"
"Range" "2500"
"RangeModifier" "0.75"
"Bullets" "1"
//"CycleTime" "0.15"
"CycleTime" "0.175"

// Weapon data is loaded by both the Game and Client DLLs.
"printname" "Pistol"

"playermodel" "models/w_models/weapons/w_pistol_A.mdl"
"playermodel_dual" "models/w_models/weapons/w_pistol_A_dual.mdl"

"worldmodel" "models/w_models/weapons/w_pistol_B.mdl"

"viewmodel" "models/v_models/v_pistolA.mdl"
"viewmodel_dual" "models/v_models/v_dual_pistolA.mdl"

"CharacterViewmodelAddon"
{
"Coach" "models/weapons/arms/v_arms_coach_new.mdl"
"Mechanic" "models/weapons/arms/v_arms_mechanic_new.mdl"
"Producer" "models/weapons/arms/v_arms_producer_new.mdl"
"Gambler" "models/weapons/arms/v_arms_gambler_new.mdl"
}

"anim_prefix" "anim"
"bucket" "1"
"bucket_position" "0"

"clip_size" "15"

"primary_ammo" "AMMO_TYPE_PISTOL"
"secondary_ammo" "None"

"weight" "5"
"item_flags" "0"

// Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)

SoundData
{
"single_shot" "Pistol.Fire"
"double_shot" "Pistol.DualFire"
}

// Weapon Sprite data is loaded by the Client DLL.
TextureData
{
"weapon"
{
"file" "vgui/hud/iconsheet"
"x" "256"
"y" "320"
"width" "64"
"height" "64"
}
"weapon_dual"
{
"file" "vgui/hud/iconsheet"
"x" "192"
"y" "320"
"width" "64"
"height" "64"
}
"ammo"
{
"font" "DebugFixed"
"character" "A"
}
"crosshair"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}
ModelBounds
{
Viewmodel
{
Mins "-7 -4 -14"
Maxs "24 9 -2"
}
World
{
Mins "-1 -4 -3"
Maxs "17 5 6"
}
}
}

----------------------------------------------------------------------------------

Here's an explanation on what some of these values do.
"MaxSpread" -> Decrease value to reduce the spread of the bullet over a distance.
"MinDuckingSpread" -> Accuracy when in crouching position (The lower the value the better. Same goes for the rest below.)
"MinStandingSpread" -> Accuracy when standing
"MinInAirSpread" -> Accuracy when in mid-air
"MaxMovementSpread" -> Accuracy while moving
"Damage" -> Increase value to cause instant kills to SI
"Range" -> How far the bullet will go
"Clip Size" -> Amount of bullets. By using a value of 100, having dual-pistols would mean having 200 bullets in total, the maximum you can have.
"VerticalPunch" - The amount of recoil the gun has, don't make this too high or else it may (literally) take you for a loop.
"SpreadPerShot" - The spread of the bullets/pellets shot by the gun.
"DeployDuration" - How long it takes to pull out the gun before shooting.
"DualDeployDuration" - Same thing, only for dualies. (Works only for pistols)
"addonattachment" - Can be "primary" (self explanitory), "pistol" (secondary weapon/melee slot), "medkit" (health slot), "pills" (Pills slot), or "molotov" (grenade slot).
"Tier" - Has to do with what other weapons the director spawns it with, can be 0, 1, or 2.
"MuzzleFlashScale" - How much muzzle flash.
"PenetrationNumLayers" - How many layers (of what, I'm not sure) the bullet can penetration.
"CycleTime" - Time it takes to refire the weapon, useful for Sub-Machine Guns.
"Bullets" - Bullets fired from each shot.
One final thing, where you have "Clip Size", there needs to be an underscore so it should be "clip_size".

No hay comentarios: