Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: (SOLVED) Custom weapon doesn't play sound.  (Read 862 times)

0 Members and 1 Guest are viewing this topic.

Offline AlexThePipe

  • *
  • *
  • +1% chance to make useful post
  • AlexThePipe has no influence.
(SOLVED) Custom weapon doesn't play sound.
« on: June 11, 2015, 10:14:00 PM »
I am unable to find the case of the problem on my own.  From what I can see my coding is okay, ID sounds are all identical to the model's and code data, and I have placed all my sounds in the correct folder. When I test my weapon on Smod, I do not see error messages in the console related to my weapon. I am looking for feedback from anyone else with more experience to show me what is wrong. The first piece of coding from a little part of "game_sounds_weapons" that is related to my custom weapon, and the second one is the weapon's coding itself.

Code: [Select]

//m6D

"Weapon_M6D.single"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation" "1.0"
"pitch" "PITCH_NORM"

"wave" "weapons/m6d/pistol_fire.wav"
}

"Weapon_M6D.Ready"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation" "1.0"
"pitch" "PITCH_NORM"

"wave" "weapons/m6d/pistol_ready.wav"
}

"Weapon_M6D.Reload"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation" "1.0"
"pitch" "PITCH_NORM"

"wave" "weapons/m6d/pistol_reload.wav"
}

"Weapon_M6D.Posing"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation"
"pitch" "PITCH_NORM"

"wave" "weapons/m6d/pistol_posing.wav"
}

Code: [Select]
weapondata
{
"printname" "M6D"
"viewmodel" "models/weapons/v_m6d.mdl"
"playermodel" "models/weapons/w_pistol.mdl"
"anim_prefix" "pistol"
"bucket" "1"
"bucket_position" "6"
"clip_size" "12"
"default_clip" "24"
"primary_ammo" "pistol"
"weight" "4"
"builtrighthanded" "1"
"allowflipping" "0"
"lagscale" ".35"
"disableroaimmode" "1"
"runspeed" ".92"
ironsight {
"fov" "-25"
"adjustaccuracy" ".4"
"forward" "-2.2"
"right" "1.2"
"up" "1.75"
}
adjust
{
"fov" "5"
"up" "-.42"
"right" "-.7"
"forward" "2.5"
}
sounddata
{
"reload" "Weapon_M6D.Reload"
"reload_npc" "weapon_pistol.npc_reload"
"empty" "weapon_pistol.empty"
"single_shot" "Weapon_M6D.single"
"single_shot_npc" "Weapon_pistol.npc_single"
}
texturedata
{
"weapon"
{
"file" "sprites/hud_icons_weapons"
"x" "0"
"y" "96"
"width" "64"
"height" "32"
}
"weapon_s"
{
"file" "sprites/hud_icons_weapons"
"x" "0"
"y" "96"
"width" "64"
"height" "32"
}
"ammo"
{
"font" "weaponicons"
"character" "p"
}
"ammo2"
{
"font" "weaponicons"
"character" "t"
}
"crosshair"
{
"font" "crosshairs"
"character" "q"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}
"weaponspec"
{
"weapontype" "0"
"firerate" "0.15"
"underwater" "0"
"options" {
"firesoundvolume" "6000"
}
"recoil" {
"punchpitch" "-1.6 1.6"
"punchyaw" "1.6 -1.6"
"enablesnap" "1"
"snappitch" "-1.6 1.6"
"snapyaw" "1.6 -1.6"
"crouch" ".6"
"amp" "2.2"
"punchlimit" "1.8"
}
"spread" {
"default" ".3"
"maxspread" "1."
"crouch" ".5"
}
"bullet" {
"ammotype" "357"
"damage" "15"
"shotcount" "1"
"tracer" "0"
"force" "10"
"penetrate" "8"
}
"npc" {
"animtype" "pistol"
"burstmax" "1"
"burstmin" "1"
"firerate" ".6"
"range" "4096"
"muzzlefire" "1"
"fireragdoll"   "0"
}
}
}

Thank you.
« Last Edit: June 12, 2015, 02:05:12 AM by AlexThePipe »

Offline AlexThePipe

  • *
  • *
  • +1% chance to make useful post
  • AlexThePipe has no influence.
Re: Custom weapon doesn't play sound.
« Reply #1 on: June 11, 2015, 10:19:21 PM »
-accidental reply-

Offline Comrade

  • *
  • *
  • +11% chance to make useful post
  • Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...
Re: Custom weapon doesn't play sound.
« Reply #2 on: June 11, 2015, 11:04:22 PM »
Make sure that the audio script file is preloaded in game_sounds_manifest.txt

Offline AlexThePipe

  • *
  • *
  • +1% chance to make useful post
  • AlexThePipe has no influence.
Re: Custom weapon doesn't play sound.
« Reply #3 on: June 11, 2015, 11:33:37 PM »
I don't think that is the problem, because that upper part of the code is a small part of "game_sounds_weapons". which is already written in "game_sounds_manifest".

Offline AlexThePipe

  • *
  • *
  • +1% chance to make useful post
  • AlexThePipe has no influence.
Re: (SOLVED) Custom weapon doesn't play sound.
« Reply #4 on: June 12, 2015, 02:06:22 AM »
after reworking the coding, I fixed it somehow  ::). Thanks again for the help