Weapon smg: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(-weapons script)
(-hmm)
Tag: Replaced
Line 1: Line 1:
{{stub}}
{{WeaponL4D|weapon=smg|ammo_cvar=ammo_smg_max|class=CSubMachinegun}}
{{ent not in fgd|nolink=1}}
{{CD|CSubMachinegun}}
{{entity|type=e0|weapon_smg|series=Left 4 Dead}} Held smg. For placing smg spawns in a map use [[weapon_smg_spawn]]
 
== Keyvalues ==
{{KV|Reserve ammo|intn=Ammo|int|Reserve ammo of the weapon. }}
:{{note|Reserve ammo will be double of this value for some reason and cannot exceed the value of cvar <code>ammo_smg_max</code>. }}
 
== Weapon Scipt ==
{{expand|title=scripts/weapon_smg.txt|
<source>
WeaponData
{
// Terror-specific Data --------------------
"VerticalPunch" "0.9"
"SpreadPerShot" "0.32"
"MaxSpread" "30"
"SpreadDecay" "5"
"MinDuckingSpread" "0.7"
"MinStandingSpread" "1.0"
"MinInAirSpread" "1.7"
"MaxMovementSpread" "3"
"AddonAttachment" "primary"
"Team" "Survivor"
"Tier" "1" // valid entries are 0, 1, 2
"ResponseRulesName" "SMG"
 
// particle muzzle flash effect to play when fired
"MuzzleFlashEffect_1stPerson" "weapon_muzzle_flash_smg_FP"
"MuzzleFlashEffect_3rdPerson" "weapon_muzzle_flash_smg"
 
// 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.3"
"DisplayName" "#L4D_Weapon_SMG"
"DisplayNameAllCaps" "#L4D_Weapon_SMG_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 ----------------
 
"Rumble" "3"
"MaxPlayerSpeed" "250"
"WeaponType" "smg"
"WeaponPrice" "1500"
"WeaponArmorRatio" "1.0"
"CrosshairMinDistance" "6"
"CrosshairDeltaDistance" "2"
"BuiltRightHanded" "1"
"PlayerAnimationExtension" "mp5"
"MuzzleFlashScale" "1.1"
 
"CanEquipWithShield" "0"
// Weapon characteristics:
"PenetrationNumLayers" "2"
"PenetrationPower" "30"
"PenetrationMaxDistance" "0" // none
 
"Damage" "20"
"Range" "2500"
"RangeModifier" "0.84"
"Bullets" "1"
"CycleTime" "0.0625"
 
"TimeToIdle" "2"
"IdleInterval" "20"
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "SMG"
"playermodel" "models/w_models/weapons/w_smg_uzi.mdl"
"viewmodel" "models/v_models/v_smg.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"
 
"Manager" "models/weapons/arms/v_arms_louis.mdl"
"Biker" "models/weapons/arms/v_arms_francis.mdl"
"TeenGirl" "models/weapons/arms/v_arms_zoey.mdl"
"NamVet" "models/weapons/arms/v_arms_bill.mdl"
}
 
"anim_prefix" "anim"
"bucket" "0"
"bucket_position" "0"
 
"clip_size" "50"
"primary_ammo" "AMMO_TYPE_SMG"
"secondary_ammo" "None"
 
"weight" "25"
"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" "SMG.Fire"
"shoot_incendiary" "SMG.FireIncendiary"
}
 
// Weapon Sprite data is loaded by the Client DLL.
TextureData
{
"weapon"
{
"file" "vgui/hud/icon_smg"
"x" "0"
"width" "256"
"height" "64"
}
"ammo"
{
"file" "vgui/hud/iconsheet"
"x" "384"
"y" "448"
"width" "64"
"height" "64"
}
"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 "-10 -4 -13"
Maxs "21 9 -1"
}
World
{
Mins "-10 -7 -6"
Maxs "22 8 9"
}
}
}</source>
}}
 
== See Also ==
* [[weapon_smg_spawn]]
* [[Weapon_script]]
* [[weapon_cs_base]]

Revision as of 02:56, 13 August 2023

Icon-NotInFGD.png
This entity is not in the FGD by default.
It should not be put directly in a map.
models/w_models/weapons/w_smg_uzi.mdl
C++ Class hierarchy
CSubMachinegun
CTerrorGun
CTerrorWeapon
CWeaponCSBase
CBaseCombatWeapon
CBaseAnimating
CBaseEntity

weapon_smg is a model entity available in Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series. Held smg. For placing smg spawns in a map use weapon_smg_spawn or weapon_spawn.

Note.pngNote:Triggers cannot detect weapon_* entities

Keyvalues

Reserve ammo (Ammo) <integer>
Reserve ammo of the weapon.
Note.pngNote:This value will be multiplied by cvar terror_ammo_multiplier(default 2) and won't exceed the value of cvar ammo_smg_max.
Skin (skin) <integer>
Selects a skin from the model's index, starting with 0.

Weapon Scipt

🖿scripts/weapon_smg.txt
WeaponData
{
	// Terror-specific Data --------------------
	"VerticalPunch"			"0.9"
	"SpreadPerShot"			"0.32"
	"MaxSpread"				"30"
	"SpreadDecay"			"5"
	"MinDuckingSpread"		"0.7"
	"MinStandingSpread"		"1.0"
	"MinInAirSpread"		"1.7"
	"MaxMovementSpread"		"3"
	"AddonAttachment"		"primary"
	"Team"					"Survivor"
	
	"Tier"					"1"		// valid entries are 0, 1, 2
	
	"ResponseRulesName"		"SMG"

	// particle muzzle flash effect to play when fired
	"MuzzleFlashEffect_1stPerson"		"weapon_muzzle_flash_smg_FP"
	"MuzzleFlashEffect_3rdPerson"		"weapon_muzzle_flash_smg"

	// 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.3"
	
	"DisplayName"			"#L4D_Weapon_SMG"
	"DisplayNameAllCaps"	"#L4D_Weapon_SMG_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 ----------------

	"Rumble"			"3"
	
	"MaxPlayerSpeed"		"250"
	"WeaponType"			"smg"
	"WeaponPrice"			"1500"
	"WeaponArmorRatio"		"1.0"
	"CrosshairMinDistance"		"6"
	"CrosshairDeltaDistance"	"2"
	"BuiltRightHanded"		"1"
	"PlayerAnimationExtension"	"mp5"
	"MuzzleFlashScale"		"1.1"

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

	"Damage"			"20"
	"Range"				"2500"
	"RangeModifier"			"0.84"
	"Bullets"			"1"
	"CycleTime"			"0.0625"

	"TimeToIdle"			"2"
	"IdleInterval"			"20"
	
	// Weapon data is loaded by both the Game and Client DLLs.
	"printname"			"SMG"
	"playermodel"			"models/w_models/weapons/w_smg_uzi.mdl"
	
	"viewmodel"			"models/v_models/v_smg.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"

		"Manager"			"models/weapons/arms/v_arms_louis.mdl"
		"Biker"				"models/weapons/arms/v_arms_francis.mdl"
	 	"TeenGirl"			"models/weapons/arms/v_arms_zoey.mdl"
		"NamVet"			"models/weapons/arms/v_arms_bill.mdl"
	}

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

	"clip_size"			"50"
	
	"primary_ammo"			"AMMO_TYPE_SMG"
	"secondary_ammo"		"None"

	"weight"			"25"
	"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"		"SMG.Fire"
		"shoot_incendiary"	"SMG.FireIncendiary"
	}

	// Weapon Sprite data is loaded by the Client DLL.
	TextureData
	{
		"weapon"
		{
				"file"		"vgui/hud/icon_smg"
				"x"		"0"
				"width"		"256"
				"height"	"64"	
		}
		"ammo"
		{
				"file"		"vgui/hud/iconsheet"
				"x"			"384"
				"y"			"448"
				"width"		"64"
				"height"	"64"
		}
		"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	"-10 -4 -13"
			Maxs	"21 9 -1"
		}
		World
		{
			Mins	"-10 -7 -6"
			Maxs	"22 8 9"
		}
	}
}

See Also