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

Author Topic: Trying to make a custom wep - Encountering Sound Issues  (Read 1918 times)

0 Members and 1 Guest are viewing this topic.

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Trying to make a custom wep - Encountering Sound Issues
« on: May 01, 2011, 04:43:02 AM »
There seem to be some weapons that have sounds when being "pulled out" but I can't seem to figure out how the codes connect in order to play this sound. Does anyone have a clue? Thanks. :)

EDIT: To clarify a little more and to update on some more problems, I'm currently trying to make a SCAR. I first took a skin from Gamebanana (used under the ak-47 in CSS). Modifying the skin and everything to work in SMOD is fine, but the real problems seem to be lying in the sound. It doesn't seem to be playing any firing sounds and the reload sounds are not what I put in the sound/weapons directory. The folder was originally named "ak47" but seeing as how an ak47 already exists, I changed it to "SCAR." I went to game_sounds_redux_addon and placed in the sounds that came with the SCAR file.

Code: [Select]
WeaponData
{
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "SCAR-L"
"viewmodel" "models/weapons/v_rif_scat.mdl"
"playermodel" "models/weapons/w_rif_scat.mdl"
"anim_prefix" "ar2"
"bucket" "2"
"bucket_position" "10"

"clip_size" "45"
"clip2_size" "-1"

"default_clip" "45"
"default_clip2" "-1"

"primary_ammo" "CustomAmmo1"
"secondary_ammo" "None"

"weight" "4"
"item_flags" "0"

"BuiltRightHanded" "0"
"AllowFlipping" "1"
"LagScale"    "0.4"

// SMOD Ironsight setting.
IronSight
{
"right" "4.475"
"up" "1.025"
"forward" "-5"
"fov" "-5"
"yaw" "-0.1"
"pitch" "0.1"
"AdjustAccuracy" "0.5"
}

Adjust
{
"right" "-2"
"forward" "-0.5"
"up" "0.1"
}

// Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
SoundData
{
"empty" "Weapon_Pistol.Empty"
"single_shot" "Weapon_AK47.Fire2"
}

// Weapon Sprite data is loaded by the Client DLL.
TextureData
{
"ammo"
{
"font" "WeaponIcons"
"character" "r"
}
"ammo2"
{
"font" "WeaponIcons"
"character" "t"
}
"crosshair"
{
"font" "Crosshairs"
"character" "Q"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}

"WeaponSpec"
{
// 0 : single
// 1 : automatic
// 2 : shotgun
// 3 : autoshotgun
"WeaponType" "1"
"FireRate" "0.06"
"UnderWater" "0"
"FireMode" "5"


"Recoil" {
"PunchPitch" "-0.15 -0.2"
"PunchYaw" "-0.15 0.15"
"EnableSnap" "1"
"SnapPitch" "-0.1 0.1"
"SnapYaw" "-0.1 0.1"
"Crouch" "0.7"
"Amp" "1.2"
"PunchLimit" "2.25"
}

"Spread" {
"Default" "1"
"MaxSpread" "8.0"
"Run" "9"
"RunSpeed" "100"
"Crouch" "0.7"
"Fire" "1.0"
}

"Bullet" {
"AmmoType" "ak47"
"Damage" "15"
"ShotCount" "1"
"Tracer" "3"
"Force" "2"
"Penetrate" "5"
}

"Npc" {
"AnimType" "AR2"
"BurstMax" "3"
"BurstMin" "3"
"FireRate" "0.05"
"Range" "2096"
"MuzzleFire" "1"
}
}

}

Weapon_AK47.Fire2 is where the main firing sound is, but for some reason it's not playing. It's also not playing the clip-in clip-out sounds and instead plays what sounds like the MP7 reloading sounds. This is really frustrating.

Here's the snippet from game_sounds_redux_addon:

Code: [Select]
"Weapon_AK47.Deploy"
{
"channel" "CHAN_WEAPON"
"volume" "1.0"
"CompatibilityAttenuation" "ATTN_NORM"
"pitch" "PITCH_NORM"

"wave" "weapons/ak47/ak47_deploy.wav"
}

"Weapon_AK47.Fire2"
{
"channel" "CHAN_WEAPON"
"volume" "0.9"
"soundlevel" "SNDLVL_GUNFIRE"
"pitch" "98,102"

"wave" "weapons/ak47/ak47-12.wav"
}


"Weapon_AK47.BoltPull2"
{
"channel" "CHAN_ITEM"
"volume" "0.9"
"soundlevel" "SNDLVL_NORM"
"pitch" "98,102"

"wave" "weapons/ak47/ak47_boltpull2.wav"
}

"Weapon_AK47.Clipout2"
{
"channel" "CHAN_ITEM"
"volume" "0.9"
"soundlevel" "SNDLVL_NORM"
"pitch" "98,102"

"wave" "weapons/ak47/ak47_clipout2.wav"
}

"Weapon_AK47.Clipin2"
{
"channel" "CHAN_ITEM"
"volume" "0.9"
"soundlevel" "SNDLVL_NORM"
"pitch" "98,102"

"wave" "weapons/ak47/ak47_clipin2.wav"
}
« Last Edit: May 01, 2011, 06:14:39 AM by Fidchell »

Offline Onemanshow

  • JuanMan
  • *
  • *
  • +67% chance to make useful post
  • Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!
Re: Trying to make a custom wep - Encountering Sound Issues
« Reply #1 on: May 01, 2011, 06:16:42 AM »
It looks like the sound scripts still are looking for the "weapons/ak47" folder instead of "weapons/scar".

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: Trying to make a custom wep - Encountering Sound Issues
« Reply #2 on: May 01, 2011, 08:25:26 AM »
You can change the name of the Firing sounds!

"Weapon_AK47.Fire2"
{
   "channel"      "CHAN_WEAPON"
   "volume"      "0.9"
   "soundlevel"   "SNDLVL_GUNFIRE"
   "pitch"         "98,102"

   "wave"      "weapons/ak47/ak47-12.wav"
}
----->
"Weapon_Scar.Fire"
{
   "channel"      "CHAN_WEAPON"
   "volume"      "0.9"
   "soundlevel"   "SNDLVL_GUNFIRE"
   "pitch"         "98,102"

   "wave"      "weapons/new/new.wav"
}
Edit the Wave line like "wave" "weapons/ak47/ak47-12.wav"-->"wave" "weapons/nameoffolder/nameofsoundfile.wav"

Never change the name of the reloading sound codes,because there are used for the model reloading animations!

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Re: Trying to make a custom wep - Encountering Sound Issues
« Reply #3 on: May 01, 2011, 01:00:09 PM »
Thanks for the help guys. The reason I renamed the reloading sound files as well is because I didn't want to replace the normal AK-47's sounds, but it looks like I had no choice. But what about the "deploy" sound, is there any way to make that work? (for example: the a35 grenade launcher makes an unsheathing noise when you select it)
« Last Edit: May 01, 2011, 01:05:05 PM by Fidchell »

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Re: Trying to make a custom wep - Encountering Sound Issues
« Reply #4 on: May 01, 2011, 03:57:26 PM »
Alright the SCAR is working fine, but now I'm trying to make a custom shotgun weapon. It uses the xm1014 script, and I put all its proper sounds in the right directories. I didn't replace the reloading sounds or anything since the model is hardwired to the sounds, but for some reason the Insertshell and Cock sounds don't play...I'm using the jackhammer sounds for firing, but pretty much for nothing else. There's also an XM1014.txt file in scripts/weapons but it only has the "deploy" sound. Should I throw in the XM1014 sound scripts in another script like gamesoundsweapons or what?

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: Trying to make a custom wep - Encountering Sound Issues
« Reply #5 on: May 06, 2011, 02:22:00 PM »
Prechache it in Game_sounds_manifest!