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

Author Topic: Scripting Problem.  (Read 1407 times)

0 Members and 1 Guest are viewing this topic.

Offline TLKwarrior

  • *
  • +1% chance to make useful post
  • TLKwarrior has no influence.
Scripting Problem.
« on: April 21, 2011, 12:25:50 AM »
Ok so I decided to add a HK416 into Smod that was a success but I had problems with it like incorrect iron-sight coordinates, no sound, and its left handed. I actually wanted to keep this forum alive by making Smod weapons for you people to use. Here's my Weapon_custom1.txt file.


//H&k 416 Assault Rifle

WeaponData
{
   // Weapon data is loaded by both the Game and Client DLLs.
   "printname"         "HK416"
   "viewmodel"         "models/weapons/v_rif_m4a1.mdl"
   "playermodel"         "models/weapons/w_rif_m4a1.mdl"
   "anim_prefix"         "rifle"
   "bucket"         "2"
   "bucket_position"      "4"

   "clip_size"         "30"
   "clip2_size"         "-1"

   "default_clip"         "90"
   "default_clip2"         "-1"

   "primary_ammo"         "smg1"
   "secondary_ammo"      "None"

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

   "BuiltRightHanded"      "0"
   "AllowFlipping"         "0"

   "CSViewModel"         "1"
   "MuzzleType"         "MZSMG"
   "MuzzleSize"         "1.5"
//   "MuzzleAttach"         "0"
   "LagScale"         ".5"
   "CSWorldModel"         "0"

   // SMOD Ironsight setting.
   IronSight
   {
      "right"      "0.51"
      "up"      "0.01"
      "forward"   "0.60"
      "fov"      "-10"
   }


   // Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
   SoundData
   {
//      "reload"      "Weapon_Pistol.Reload"
      "reload_npc"      "Weapon_Pistol.NPC_Reload"
      "empty"         "Weapon_Pistol.Empty"
      "single_shot"      "m4a1_unsil-1.single"
      "single_shot_npc"   "m4a1_unsil-2.Single"
   }

   // Weapon Sprite data is loaded by the Client DLL.
   TextureData
   {
      "weapon"
      {
            "font"      "WeaponIcons"
            "character"   "d"
      }
      "weapon_s"
      {   
            "font"      "WeaponIconsSelected"
            "character"   "d"
      }
      "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"
   {
      //   0 : single
      //   1 : automatic
      //   2 : shotgun
      //   3 : autoshotgun
      "WeaponType"   "1"
      "FireRate"   "0.3"
      "UnderWater"   "0"
      
   
      "Options" {
         "ReloadSound"   "0"
         "LastFireSound"   "0"
         "TurnoffScope"   "1"
         "TurnoffIron"   "0"
         "TimeScale"   "1"
         "LastDryFireActivity"   "1"   // not work
      }
      
      "Recoil" {
         "PunchPitch"   "-1 0"
         "PunchYaw"   "-0.2 .2"
         "EnableSnap"   "0"
         "SnapPitch"   "0 0"
         "SnapYaw"   "0 0"
         "Crouch"   "0.5"
         "Amp"      "1.5"
         "PunchLimit"   "0.5"
      }
      
      "Spread" {
         "Default"   "0.1"
         "MaxSpread"   "1"
         "Run"      "35.0"
         "RunSpeed"   "100"
         "Crouch"   "5.0"
         "Fire"      "20.0"
      }
      
      "Bullet" {
         "AmmoType"   "smg1"
         "Damage"   "25"
         "ShotCount"   "1"
         "Tracer"   "4"
         "Force"      "0.5"
      }

      "Npc" {
         "RifleAnim"   "1"
         "BurstMax"   "6"
         "BurstMin"   "3"
         "FireRate"   "0.45"
         "Range"      "80000"
         "MuzzleFire"   "1"
      }
   }
   
}

Offline TLKwarrior

  • *
  • +1% chance to make useful post
  • TLKwarrior has no influence.
Re: Scripting Problem.
« Reply #1 on: April 21, 2011, 07:39:35 AM »
Ok nvm about the problem i fixed it.

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Re: Scripting Problem.
« Reply #2 on: April 21, 2011, 01:40:56 PM »
it always seems like you find the answer right after you post  ;)

care to share how you fixed it so others may learn from your mistakes?

Offline Spasior

  • IKEA Meatballs Son!!!
  • *
  • *
  • +3% chance to make useful post
  • Spasior has no influence.
Re: Scripting Problem.
« Reply #3 on: April 21, 2011, 02:31:37 PM »
   // Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
   SoundData
   {
//      "reload"      "Weapon_Pistol.Reload"
      "reload_npc"      "Weapon_Pistol.NPC_Reload"
      "empty"         "Weapon_Pistol.Empty"
      "single_shot"      "m4a1_unsil-1.single"
      "single_shot_npc"   "m4a1_unsil-2.Single"
   }

Change the m4a1_unsil-x.single to weapon_m4a1.single then it will match your game_sounds_weapons.txt file script thingy.
erutangiS