BSNOOCH.COM

Games & Mods => SMOD & SMOD2 => Topic started by: FreeKill on August 06, 2011, 11:02:38 AM

Title: Need a bit of help
Post by: FreeKill on August 06, 2011, 11:02:38 AM
I can't seem to get my weapon sounds or the scope on my custom weapon working. Anyone help me?

Code: [Select]
//HK SL8-2

"WeaponData"
{
    // Weapon data is loaded by both the Game and Client DLLs.
    "printname"            "SL8-2 COMBAT RIFLE"
    "viewmodel"            "models/weapons/v_sl8.mdl"
    "playermodel"            "models/weapons/w_sl8.mdl"
    "anim_prefix"            "ar2"
    "bucket"            "3"
    "bucket_position"        "12"

    "clip_size"            "20"
    "clip2_size"            "-1"

    "default_clip"            "20"
    "default_clip2"            "-1"

    "primary_ammo"            "AR2"
    "secondary_ammo"        "None"

    "weight"            "3"
    "item_flags"            "0"

    "BuiltRightHanded"         "1"
    "AllowFlipping"         "1"

    "csviewmodel"            "0"

 //Sounds aliases for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
    "SoundData"
    {
        "reload"        "Weapon_SL8.Reload"
        "reload_npc"        "Weapon_SMG1.NPC_Reload"
        "empty"            "Weapon_SMG1.Empty"
        "single_shot"        "Weapon_SL8.Fire"
        "single_shot_npc"    "Weapon_SL8.Fire"
        "special1"        "Weapon_RPG.LaserOn"
        "special2"        "Weapon_RPG.LaserOff"
    }
    // Weapon Sprite data is loaded by the Client DLL.
    "TextureData"
    {
        "weapon"
        {
                "file"        "sprites/hud_weapons_sl8"
                "x"            "0"
                "y"            "0"
                "width"        "128"
                "height"    "32"
        }
        "weapon_s"
        {   
                "file"        "sprites/hud_weapons_sl8"
                "x"            "0"
                "y"            "0"
                "width"        "128"
                "height"    "32"
        }
        "ammo"
        {
                "font"        "WeaponIcons"
                "character"    "u"
        }
        "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"    "0"
        "FireRate"    "0.21"
        "UnderWater"    "0"
        "Akimbo        "0"
       
        "Options" {
            "CrossHairMove"        "0.05"
            "CrossHairMinSize"    "12.5"
            "LastDryFireActivity"    "0"
            "ReloadSound"        "1"
            "TurnOffIron"        "0"   
        }
       
        "Recoil"  {
            "PunchPitch"    "0.5 -0.5"
            "PunchYaw"    "-0.10 0.2"
            "EnableSnap"    "0"
            "SnapPitch"    "-0.0 0.0"
            "SnapYaw"    "-0.0 0.0"
            "Crouch"    "0.8"
            "Amp"        "1.3
            "PunchLimit"    "4.0
        }

        "Spread"  {
            "Default"    "1.25
            "MaxSpread"    "4.5"
            "Run"        "2.0"
            "RunSpeed"    "95"
            "Crouch"    "0.89"
            "Fire"        "1.35"
        }

        "Scope"      {
            "Type"        "4"
            "Switch"    "2"
            "ZoomFact"    "3.0"
            "CrosshairOff"    "0"
            "AccBonus"    "0.25"
            "DrawViewmodel"    "0"
            "Drift"        "0.13"
            "UseButton"    "0"
            "IronsightIsScope"    "1"
        }

        "Bullet"    {
            "Bullet"    "357"
            "Damage"    "16"
            "ShotCount"    "1"
            "Tracer"    "5"
            "Force"        "1"
            "Penetrate"    "4"
            "TraceLength"    "2750"
            "Attenuate"    "500"
        }

        "Npc"        {
            "AdjustSpread"    "0.2"
            "AminType"    "ar2"
            "BurstMax"    "2"
            "BurstMin"    "1"
            "FireRate"    "0.21"
            "Range"        "2500"
            "MuzzleFire"    "1"
            "UseGl"        "0"
            "UseLaserPointer"    "0"
            "FireRagDoll"    "1"
        }
    }
}
   

Code: [Select]
"Weapon_SL8.Fire"
{
    "channel"        "CHAN_WEAPON"
    "volume"        "0.9"
    "soundlevel"        "SNDLVL_GUNFIRE"

    "pitch"            "88,93"   

    "wave"            "weapons/SL8/sl8-1.wav"
}

"Weapon_SL8.Reload"
{
    "channel"        "CHAN_ITEM"
    "volume"        "1.0"   
    "CompatibilityAttenuation"    "1.0"
    "pitch"            "95,105"



    "wave"            "weapons/SL8/sl8_reload.wav"
}
Title: Re: Need a bit of help
Post by: 0per4t0r on August 06, 2011, 01:02:20 PM
I'm assuming that you're using this skin?: http://www.gamebanana.com/skins/37246 (http://www.gamebanana.com/skins/37246)

This skin uses four different wav files to make up the reload sounds, not just "reload.wav," so try just using the weapon_sg550.txt from that skin as a base for the scripts/weapons/sl8.txt (try using Weapon_sg550.clipin instead of Weapon_sl8.clipin, etc for the values if it doesn't work with the latter), add in your fire sound on the first line of the script, copy all the sound files over from the skin to smod and rename them in both the sounds/weapons folder and in your script,  and make sure to add your script to the game_sounds_manifest.txt after saving it. The weapon sounds should work after that.
Title: Re: Need a bit of help
Post by: FreeKill on August 06, 2011, 08:06:08 PM
Problem is, Its not that model. It was a custom one from years ago when they used to have custom weapons in synergy.

Hang on, An idea struck me. I went ahead and got the soundscript from Synergy.

Code: [Select]

// SYNERGY WEAPON:  SL8 Combat Rifle

"Weapon_SL8.Fire"
{
"channel" "CHAN_WEAPON"
"volume" "0.9"
"soundlevel" "SNDLVL_GUNFIRE"
"pitch" "88,93"

// "rndwave"
// {
"wave" "^weapons/SL8/SL8-1.wav"
// }
}

"Weapon_SL8.Reload"
{
}

"Weapon_SL8.Zoom"
{
}

"Weapon_SL8.ClipOut"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation" "1.0"
"pitch" "95,105"

"wave" "weapons/SL8/sl8_magout.wav"
}

"Weapon_SL8.ClipIn"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation" "1.0"
"pitch" "95,105"

"wave" "weapons/SL8/sl8_magin.wav"
}

"Weapon_SL8.BoltBack"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation" "1.0"
"pitch" "95,105"

"wave" "weapons/SL8/sl8_boltback.wav"
}

"Weapon_SL8.BoldForward"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation" "1.0"
"pitch" "95,105"

"wave" "weapons/SL8/sl8_boltforward.wav"
}



Title: Re: Need a bit of help
Post by: FreeKill on August 06, 2011, 09:29:38 PM
Now none of the sounds are working.

Code: [Select]
//HK SL8-2

"WeaponData"
{
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "SL8-2 COMBAT RIFLE"
"viewmodel" "models/weapons/v_sl8.mdl"
"playermodel" "models/weapons/w_sl8.mdl"
"anim_prefix" "ar2"
"bucket" "3"
"bucket_position" "12"

"clip_size" "20"
"clip2_size" "-1"

"default_clip" "20"
"default_clip2" "-1"

"primary_ammo" "AR2"
"secondary_ammo" "None"

"weight" "3"
"item_flags" "0"

"BuiltRightHanded" "1"
"AllowFlipping" "1"

"csviewmodel" "0"

 //Sounds aliases for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
SoundData
{
"reload" "Weapon_SMG1.Reload"
"reload_npc" "Weapon_SMG1.NPC_Reload"
"empty" "Weapon_SMG1.Empty"

// "single_shot" "Weapon_SMG1.NPC_Single"
"single_shot" "Weapon_SL8.Fire"

// "single_shot_npc" "Weapon_SMG1.NPC_Single"
"single_shot_npc" "Weapon_SL8.Fire"

"special1" "Weapon_SMG1.Special1"
"special2" "Weapon_SMG1.Special2"
"double_shot" "Weapon_SMG1.Double"
"burst" "Weapon_SMG1.Burst"
}
// Weapon Sprite data is loaded by the Client DLL.
"TextureData"
{
"weapon"
{
"file" "sprites/hud_weapons_sl8"
"x" "0"
"y" "0"
"width" "128"
"height" "32"
}
"weapon_s"
{
"file" "sprites/hud_weapons_sl8"
"x" "0"
"y" "0"
"width" "128"
"height" "32"
}
"ammo"
{
"font" "WeaponIcons"
"character" "u"
}
"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" "0"
"FireRate" "0.21"
"UnderWater" "0"
"Akimbo "0"

"Options" {
"CrossHairMove" "0.05"
"CrossHairMinSize" "12.5"
"LastDryFireActivity" "0"
}

"Recoil"  {
"PunchPitch" "0.5 -0.5"
"PunchYaw" "-0.10 0.2"
"EnableSnap" "0"
"SnapPitch" "-0.0 0.0"
"SnapYaw" "-0.0 0.0"
"Crouch" "0.8"
"Amp" "1.3
"PunchLimit" "4.0
}

"Spread"  {
"Default" "1.25
"MaxSpread" "4.5"
"Run" "2.0"
"RunSpeed" "95"
"Crouch" "0.89"
"Fire" "1.35"
}

"Scope"   {
"Type" "4"
"Switch" "2"
"ZoomFact" "3.0"
"CrosshairOff" "0"
"AccBonus" "0.25"
"DrawViewmodel" "0"
"Drift" "0.13"
"UseButton" "0"
"IronsightIsScope" "1"
}

"Bullet" {
"Bullet" "357"
"Damage" "14"
"ShotCount" "1"
"Tracer" "5"
"Force" "1"
"Penetrate" "4"
"TraceLength" "2750"
"Attenuate" "500"
}

"Npc" {
"AdjustSpread" "0.2"
"AminType" "ar2"
"BurstMax" "2"
"BurstMin" "1"
"FireRate" "0.21"
"Range" "2500"
"MuzzleFire" "1"
"UseGl" "0"
"UseLaserPointer" "0"
"FireRagDoll" "1"
}
}
}

On a side note, My scope doesn't work.
Title: Re: Need a bit of help
Post by: FreeKill on August 07, 2011, 03:56:50 AM
I'm still a bit confused about the scope though, any insight with that?
Title: Re: Need a bit of help
Post by: FreeKill on August 07, 2011, 04:01:43 AM
Despite everything I do, I still have no sound. This is getting a bit confusing.

Also, That didn't really help. How would you type it exactly?
Title: Re: Need a bit of help
Post by: FreeKill on August 07, 2011, 04:51:51 AM
Despite everything I do, I still have no sound. This is getting a bit confusing.

Also, That didn't really help. How would you type it exactly?

That didn't work either?I dunno how now,I'm sorry bro.

You want the source files? This is my first weapon and I'm going purely by example.
Title: Re: Need a bit of help
Post by: Counter-Life™ on August 07, 2011, 06:00:45 AM
To make the Scope work you have to add some random Ironsight cooridinates

Here are some from me simply add them into your script:

   IronSight
   {
      "right"      "2.16"
      "up"      "1.39"
                "AdjustAccuracy" "0.4"
   }

Title: Re: Need a bit of help
Post by: FreeKill on August 07, 2011, 06:05:27 AM
Now if only I knew how to fix the sounds. And that didn't work either.

If anyone wants it, I'll gladly hand over the files.