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

Author Topic: The Custom Weapon TUTORIAL! - EDITED FOR BETA 0.2.0.2  (Read 3182 times)

0 Members and 1 Guest are viewing this topic.

Offline Bitl

  • *
  • *
  • +7% chance to make useful post
  • Bitl is working their way up.Bitl is working their way up.Bitl is working their way up.
The Custom Weapon TUTORIAL! - EDITED FOR BETA 0.2.0.2
« on: February 03, 2015, 01:51:18 AM »
EDIT: IF YOU HAVE CRASHING PROBLEMS, REMOVE EVERYTHING IN THE "customization" TAG!

Since the Pre-Beta was released I thought it might be nice to do a little tutorial for the Custom Weapons System.

First of all, your viewmodel and worldmodel NEED to have the "muzzle" attachment in order to work properly, so if you see random bullets all over the place you know why.

Got that? Good, let's roll!

In the scripts/example folder you can find a file called "weapon_customexample.txt". Copy it to the root of the "scripts" folder and change the "example" part of the name to be any number you want (up to 30)

Inside, you will see the following:

Code: [Select]
// Pistol

WeaponData
{
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "Example Gun" //Name.
"viewmodel" "models/weapons/v_pistol.mdl" //Viewmodel.
"playermodel" "models/weapons/w_pistol.mdl" //Worldmodel.
"anim_prefix" "pistol" //Animations for NPCs.
"weapon_type" "pistol" //Weapon Type.
"bucket" "1" //The category this will go into.
"bucket_position" "0" //The slot this will go into.
"bucket_360" "0"
"bucket_position_360" "0"

"clip_size" "18" //Clip 1 size
"clip2_size" "-1" //Clip 2 size

"default_clip" "18" //The amount this will have in Clip 1 when spawned by default.
"default_clip2" "-1" //The amount this will have in Clip 2 when spawned by default.

"primary_ammo" "Pistol" //Primary ammo type.
"secondary_ammo" "None" //Secondary ammo type.

"weight" "2" //How much NPCs want to pick this up.
"rumble" "1" //Rumble setting for controllers.
"item_flags" "0" //Flags for the weapon.

"BuiltRightHanded" "1" //Check to see if this is Left-Handed. Useful for CSS weapons.
"AllowFlipping" "1" //Check to see if we can use flipping.
"MagazineStyledReloads" "1" //Check to see if we can use Magazine-Styled Reloads.
"UseMuzzleSmoke" "1" //Check to see if we can use Muzzle Smoke.
"useironsights" "1" //Check if we can use Ironsights.
"LowerWeapon" "1" //Check if we can lower the weapon while sprinting. Disable this if your viewmodel does not have a lowering animation.

//Ironsight settings
IronSight
{
"right" "-6.010000"
"up" "4.050000"
"forward" "-10"
"pitch" "-0.1"
"yaw" "-1.050000"
"fov" "-5"
}

// 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" "Weapon_Pistol.Single"
"single_shot_npc" "Weapon_Pistol.NPC_Single"
"special1" "Weapon_Pistol.Special1"
"special2" "Weapon_Pistol.Special2"
"burst" "Weapon_Pistol.Burst"
}

// Weapon Sprite data is loaded by the Client DLL.
TextureData
{
"weapon"
{
"font" "WeaponIcons"
"character" "d"
}
"weapon_s"
{
"font" "WeaponIconsSelected"
"character" "d"
}
"weapon_small"
{
"font" "WeaponIconsSmall"
"character" "d"
}
"ammo"
{
"font" "WeaponIconsSmall"
"character" "p"
}
"crosshair"
{
"font" "Crosshairs"
"character" "Q"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}

//The "meat" of the weapon.
"WeaponSpec"
{
"WeaponOptions"
{
"CanReloadSingly" "1" //Check if we can reload 1 round at a time.
"DualWeapons" "0" //Check if we can use dual welding. This only works on primary fire unless you want "FireBothGuns" on secondary fire.
}

//Stuff that we will do on primary fire. Remove if you do not need primary fire (if you want night vision binoculars).
"PrimaryFire"
{
"FireRate" "1.0" //How fast this fires
"IronsightFireRate" "1.0" //How fast this fires when ironsighted.
"ZoomFireRate" "1.0" //How fast this fires when zoomed in.
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "1400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
                        "FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "4" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
}
//RPG Missle Settings. Remove if you do not want RPG Missles.
"Missle"
{
"UseRecoil" "1" //Should we use recoil when firing this?
}
//SMG Grenade Settings. Remove if you do not want SMG Grenades.
"SMGGrenade"
{
"Damage" "4" //Amount of damage we will do.
"UseRecoil" "1" //Should we use recoil when firing this?
}
//Combine Energy Ball Settings. Remove if you do not want Combine Energy Balls.
"AR2EnergyBall"
{
"Radius" "10" //The radius that this will spawn at.
"Mass" "150" //The amount of mass that this will have.
"Duration" "2" //How long this will be live for.
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "1" //How many degrees.
"Seconds" "2" //How long this will be.
}
}
//Stuff that we will do on Secondary Fire. Remove if you do not need Secondary Fire.
"SecondaryFire"
{
"FireRate" "1.0" //How fast this fires
"IronsightFireRate" "1.0" //How fast this fires when ironsighted.
"ZoomFireRate" "1.0" //How fast this fires when zoomed in.
"UsePrimaryAmmo" "0" //Check if we can use primary ammo on secondary fire
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "1400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
                        "FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "4" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
}
//RPG Missle Settings. Remove if you do not want RPG Missles.
"Missle"
{
"UseRecoil" "1" //Should we use recoil when firing this?
}
//SMG Grenade Settings. Remove if you do not want SMG Grenades.
"SMGGrenade"
{
"Damage" "4" //Amount of damage we will do.
"UseRecoil" "1" //Should we use recoil when firing this?
}
//Combine Energy Ball Settings. Remove if you do not want Combine Energy Balls.
"AR2EnergyBall"
{
"Radius" "10" //The radius that this will spawn at.
"Mass" "150" //The amount of mass that this will have.
"Duration" "2" //How long this will be live for.
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "1" //How many degrees.
"Seconds" "2" //How long this will be.
}
}

//Stuff that we will do on Zoom. Remove if you do not need Zoom.
"Zoom"
{
"UsesSound" "0" //Check to use a sound when zooming (SPECIAL1 is the default)
"UsesColor" "0" //Check to change the color of the screen when zoomed in.
"UseOnPrimaryFire" "0" //Check to see if we can use this on Primary Fire instead on secondary fire.
//Color (Only works when "UsesColor" is enabled". Uses the RGBA format.)
"ZoomColor"
{
"Red" "0"
"Green" "0"
"Blue" "0"
"Alpha" "0"
}
}

A LOT of code there, isn't it? Well, let's go over it.

Most of this top code can be explained here: http://bsnooch.com/forums/index.php?topic=92.0

However, here's a few little things I should point out:

Code: [Select]
"rumble"The rumble value for controllers. Since this version of Source has full controller support, you CAN use this if you want to.

Code: [Select]
"MagazineStyledReloads"
Toggles Magazine-styled reloads for the weapon. Can be explained here:
Quote from here: https://developer.valvesoftware.com/wiki/Magazine_style_reloads

Quote
Say you want to make each shot and each reload count? In CS you can reload anytime you feel like. Some bullets will be deducted and that is all. However, in real life, you will not start to load the half-empty mag, you pull out a new one, and toss the used one. This system can be found in BF2, and some other games.


Code: [Select]
"UseMuzzleSmoke"Toggles L4D-styled muzzle smoke on the weapon after firing. NOTE: You have to have the "muzzle" attachment (and "muzzle2" if you want dual weapons) in order for this to work!
Code: [Select]
"useironsights"Toggles if we can use Ironsights on the weapon. ENABLE THIS if you want ironsights or they will not work.
Code: [Select]
"LowerWeapon"A toggle to see if we can lower the weapon while sprinting/waiking. If you don't have a lowering animation on your viewmodel, DISABLE THIS.

Code: [Select]
"weapon_small"
{
"font" "WeaponIconsSmall"
"character" "d"
}

This is a new one in the TextureData key. It seems to display a small version of the weapon icon for your weapon. Be sure you have a small one.

Before we go to the good stuff, here's a list of custom ammotypes you can use in the mod.

Code: [Select]
"CustomBullet1_Normal"
"CustomBullet2_NormalBurn"
"CustomBullet3_NormalBurnGib"
"CustomBullet4_NormalAlwaysGib"
"CustomBullet5_NormalDissolve"
"CustomBullet6_NormalDissolveGib"
"CustomBullet7_Buckshot"
"CustomBullet8_BuckshotBurn"
"CustomBullet9_BuckshotBurnGib"
"CustomBullet10_BuckshotAlwaysGib"
"CustomBullet11_BuckshotDissolve"
"CustomBullet12_BuckshotDissolveGib"
"CustomBullet13_Sniper"
"CustomBullet14_SniperBurn"
"CustomBullet15_SniperBurnGib"
"CustomBullet16_SniperAlwaysGib"
"CustomBullet17_SniperDissolve"
"CustomBullet18_SniperDissolveGib"
"CustomBullet19_BuckshotSniper"
"CustomBullet20_BuckshotSniperBurn"
"CustomBullet21_BuckshotSniperBurnGib"
"CustomBullet22_BuckshotSniperAlwaysGib"
"CustomBullet23_BuckshotSniperDissolve"
"CustomBullet24_BuckshotSniperDissolveGib"
"CustomBullet25_NormalKnockback"
"CustomBullet26_BuckshotKnockback"
"CustomBullet27_SniperKnockback"
"CustomBullet28_BuckshotSniperKnockback"

Now it is time to go into the "meat of the weapon"!

Code: [Select]
//The "meat" of the weapon.
"WeaponSpec"
{
"WeaponOptions"
{
"CanReloadSingly" "1" //Check if we can reload 1 round at a time.
"DualWeapons" "0" //Check if we can use dual welding. This only works on primary fire unless you want "FireBothGuns" on secondary fire.
}

//Stuff that we will do on primary fire. Remove if you do not need primary fire (if you want night vision binoculars).
"PrimaryFire"
{
"FireRate" "1.0" //How fast this fires
"IronsightFireRate" "1.0" //How fast this fires when ironsighted.
"ZoomFireRate" "1.0" //How fast this fires when zoomed in.
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "1400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
                        "FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "4" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
}
//RPG Missle Settings. Remove if you do not want RPG Missles.
"Missle"
{
"UseRecoil" "1" //Should we use recoil when firing this?
}
//SMG Grenade Settings. Remove if you do not want SMG Grenades.
"SMGGrenade"
{
"Damage" "4" //Amount of damage we will do.
"UseRecoil" "1" //Should we use recoil when firing this?
}
//Combine Energy Ball Settings. Remove if you do not want Combine Energy Balls.
"AR2EnergyBall"
{
"Radius" "10" //The radius that this will spawn at.
"Mass" "150" //The amount of mass that this will have.
"Duration" "2" //How long this will be live for.
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "1" //How many degrees.
"Seconds" "2" //How long this will be.
}
}
//Stuff that we will do on Secondary Fire. Remove if you do not need Secondary Fire.
"SecondaryFire"
{
"FireRate" "1.0" //How fast this fires
"IronsightFireRate" "1.0" //How fast this fires when ironsighted.
"ZoomFireRate" "1.0" //How fast this fires when zoomed in.
"UsePrimaryAmmo" "0" //Check if we can use primary ammo on secondary fire
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "1400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
                        "FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "4" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
}
//RPG Missle Settings. Remove if you do not want RPG Missles.
"Missle"
{
"UseRecoil" "1" //Should we use recoil when firing this?
}
//SMG Grenade Settings. Remove if you do not want SMG Grenades.
"SMGGrenade"
{
"Damage" "4" //Amount of damage we will do.
"UseRecoil" "1" //Should we use recoil when firing this?
}
//Combine Energy Ball Settings. Remove if you do not want Combine Energy Balls.
"AR2EnergyBall"
{
"Radius" "10" //The radius that this will spawn at.
"Mass" "150" //The amount of mass that this will have.
"Duration" "2" //How long this will be live for.
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "1" //How many degrees.
"Seconds" "2" //How long this will be.
}
}

//Stuff that we will do on Zoom. Remove if you do not need Zoom.
"Zoom"
{
"UsesSound" "0" //Check to use a sound when zooming (SPECIAL1 is the default)
"UsesColor" "0" //Check to change the color of the screen when zoomed in.
"UseOnPrimaryFire" "0" //Check to see if we can use this on Primary Fire instead on secondary fire.
//Color (Only works when "UsesColor" is enabled". Uses the RGBA format.)
"ZoomColor"
{
"Red" "0"
"Green" "0"
"Blue" "0"
"Alpha" "0"
}
}

"WeaponOptions"
{
Code: [Select]
"CanReloadSingly"Check if we can reload 1 round at a time.
Code: [Select]
"DualWeapons"Check if we can use dual welding. This only works on primary fire unless you want "FireBothGuns" on secondary fire.
NOTE: your weapon model needs to have the following animation events:
ACT_VM_PRIMARYATTACK_R
ACT_VM_PRIMARYATTACK_R_RECOIL1
ACT_VM_PRIMARYATTACK_R_RECOIL2
ACT_VM_PRIMARYATTACK_R_RECOIL3
ACT_VM_PRIMARYATTACK_L
ACT_VM_PRIMARYATTACK_L_RECOIL1
ACT_VM_PRIMARYATTACK_L_RECOIL2
ACT_VM_PRIMARYATTACK_L_RECOIL3

}

Stuff that we will do on primary fire. Remove if you do not need primary fire (if you want night vision binoculars).
"PrimaryFire"
{
Code: [Select]
"FireRate"How fast this fires
Code: [Select]
"IronsightFireRate"How fast this fires when ironsighted.
Code: [Select]
"ZoomFireRate"How fast this fires when zoomed in.
Code: [Select]
"InfiniteAmmoPerk"Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
Code: [Select]
"InfiniteAmmo"Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
Code: [Select]
"MinRange"The minimum amount of range that this weapon would fire at.
Code: [Select]
"MaxRange"The maximum amount of range that this weapon would fire at.
Code: [Select]
"CanFireUnderwater"Can we use this underwater?
Code: [Select]
"FireBothGuns"Can we fire both guns? Only works if "Dual Weapons" is on.

Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
Code: [Select]
"Damage"Amount of damage we will do.
Code: [Select]
"ShotCount"How many shots we will fire at once.
Code: [Select]
"Spread"
{
"x" "2"
"y" "2"
"z" "2"
}
Spread (in degrees)
Code: [Select]
"IronsightSpread"
{
"x" "2"
"y" "2"
"z" "2"
}
Spread when ironsighted (in degrees)
Code: [Select]
"ZoomSpread"
{
"x" "2"
"y" "2"
"z" "2"
}
Spread when zoomed in (in degrees)
}
RPG Missle Settings. Remove if you do not want RPG Missles.
"Missle"
{
Code: [Select]
"UseRecoil"Should we use recoil when firing this?
}
SMG Grenade Settings. Remove if you do not want SMG Grenades.
"SMGGrenade"
{
Code: [Select]
"Damage"Amount of damage we will do.
Code: [Select]
"UseRecoil"Should we use recoil when firing this?
}
Combine Energy Ball Settings. Remove if you do not want Combine Energy Balls.
"AR2EnergyBall"
{
Code: [Select]
"Radius"The radius that this will spawn at.
Code: [Select]
"Mass"The amount of mass that this will have.
Code: [Select]
"Duration"How long this will be live for.
}
Recoil Settings.
"Recoil"
{
Code: [Select]
"EasyDampen"How much we will dampen the recoil on the Easy difficulty.
Code: [Select]
"Degrees"How many degrees.
Code: [Select]
"Seconds"How long this will be.
}
}

Stuff that we will do on Secondary Fire. Remove if you do not need Secondary Fire.
"SecondaryFire"
{
Everything is about the same except there is one more option to talk about:
Code: [Select]
"UsePrimaryAmmo"This is used to see if we can use the weapon's primary ammo instead of the weapon's secondary ammo.
}

Stuff that we will do on Zoom. Remove if you do not need Zoom.
"Zoom"
{
Code: [Select]
"UsesSound"Check to use a sound when zooming (SPECIAL1 is the default)
Code: [Select]
"UsesColor"Check to change the color of the screen when zoomed in.
Code: [Select]
"UseOnPrimaryFire"Check to see if we can use this on Primary Fire instead of secondary fire.

Color (Only works when "UsesColor" is enabled". Uses the RGBA format.)
Code: [Select]
"ZoomColor"
{
"Red" "0"
"Green" "0"
"Blue" "0"
"Alpha" "0"
}
}

Once you have finished your custom weapon, you can either place it in the root of your scripts directory, or you can create a folder in the addons directory, then create a script folder in there, then place your weapon file in. Read more here: http://bsnooch.com/forums/index.php?topic=1551.0
« Last Edit: May 06, 2015, 12:27:28 AM by Bitl »
FIREFIGHT RELOADED: GET IT NOW ON STEAM! http://store.steampowered.com/app/397680

Visit my Discord here: https://discord.gg/chfVwk2

crack tales, ooo-ooo

My Blog

"They are rage, brutal, without mercy. But you. You will be worse. Rip and tear, until it is don

Offline Pepsifan04

  • *
  • *
  • +11% chance to make useful post
  • Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...Pepsifan04 might someday be someone...
    • Smod: CryLife
Re: The Custom Weapon TUTORIAL!
« Reply #1 on: February 03, 2015, 06:17:00 AM »
Yessss. bodygroups ans skin
I love you man
DROP DATABASE bsnooch

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: The Custom Weapon TUTORIAL!
« Reply #2 on: February 03, 2015, 12:07:30 PM »
Godlike stuff. I'll try to make a bunch of custom skins and release a vid or something, this should get really interesting.

I saw "up to 30 custom weapons", I hope this is bound to change :)

Offline Bitl

  • *
  • *
  • +7% chance to make useful post
  • Bitl is working their way up.Bitl is working their way up.Bitl is working their way up.
Re: The Custom Weapon TUTORIAL!
« Reply #3 on: February 03, 2015, 12:36:02 PM »
I saw "up to 30 custom weapons", I hope this is bound to change :)

It won't.
FIREFIGHT RELOADED: GET IT NOW ON STEAM! http://store.steampowered.com/app/397680

Visit my Discord here: https://discord.gg/chfVwk2

crack tales, ooo-ooo

My Blog

"They are rage, brutal, without mercy. But you. You will be worse. Rip and tear, until it is don

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: The Custom Weapon TUTORIAL!
« Reply #4 on: February 03, 2015, 02:06:13 PM »
I saw "up to 30 custom weapons", I hope this is bound to change :)

It won't.

Why would that be?

Offline Bitl

  • *
  • *
  • +7% chance to make useful post
  • Bitl is working their way up.Bitl is working their way up.Bitl is working their way up.
Re: The Custom Weapon TUTORIAL!
« Reply #5 on: February 03, 2015, 04:20:49 PM »
I saw "up to 30 custom weapons", I hope this is bound to change :)

It won't.

Why would that be?
Because I want to allow people to fit all weapons on the HUD at once.
FIREFIGHT RELOADED: GET IT NOW ON STEAM! http://store.steampowered.com/app/397680

Visit my Discord here: https://discord.gg/chfVwk2

crack tales, ooo-ooo

My Blog

"They are rage, brutal, without mercy. But you. You will be worse. Rip and tear, until it is don

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: The Custom Weapon TUTORIAL!
« Reply #6 on: February 03, 2015, 04:53:25 PM »
I saw "up to 30 custom weapons", I hope this is bound to change :)

It won't.

Why would that be?
Because I want to allow people to fit all weapons on the HUD at once.

what if THEY don't want to do that

Offline Bitl

  • *
  • *
  • +7% chance to make useful post
  • Bitl is working their way up.Bitl is working their way up.Bitl is working their way up.
Re: The Custom Weapon TUTORIAL!
« Reply #7 on: February 03, 2015, 06:24:21 PM »
I saw "up to 30 custom weapons", I hope this is bound to change :)

It won't.

Why would that be?
Because I want to allow people to fit all weapons on the HUD at once.

what if THEY don't want to do that
The main reason that there are only 30 custom weapons is that there is NO reason to have 999 weapons.

If you guys want I could increase the limit, but not add infinite weapon limits. Take it to the Suggestions forum.
FIREFIGHT RELOADED: GET IT NOW ON STEAM! http://store.steampowered.com/app/397680

Visit my Discord here: https://discord.gg/chfVwk2

crack tales, ooo-ooo

My Blog

"They are rage, brutal, without mercy. But you. You will be worse. Rip and tear, until it is don

Offline Lolkat

  • *
  • +1% chance to make useful post
  • Lolkat has no influence.
Re: The Custom Weapon TUTORIAL!
« Reply #8 on: May 05, 2015, 11:46:57 PM »
How and where does the custom weapon show up in game? I can't find mine anywhere. I've tried placing it in addons, custom, and the script folder.

Code: [Select]
WeaponData
{
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "P90" //Name.
"viewmodel" "models/weapons/v_smg1.mdl" //Viewmodel.
"playermodel" "models/weapons/w_smg1.mdl" //Worldmodel.
"anim_prefix" "smg2" //Animations for NPCs.
"weapon_type" "smg" //Weapon Type.
"bucket" "1" //The category this will go into.
"bucket_position" "0" //The slot this will go into.
"bucket_360" "0"
"bucket_position_360" "0"

"clip_size" "50" //Clip 1 size
"clip2_size" "-1" //Clip 2 size

"default_clip" "100" //The amount this will have in Clip 1 when spawned by default.
"default_clip2" "-1" //The amount this will have in Clip 2 when spawned by default.

"primary_ammo" "SMG1" //Primary ammo type.
"secondary_ammo" "None" //Secondary ammo type.

"weight" "2" //How much NPCs want to pick this up.
"rumble" "1" //Rumble setting for controllers.
"item_flags" "0" //Flags for the weapon.

"BuiltRightHanded" "1" //Check to see if this is Left-Handed. Useful for CSS weapons.
"AllowFlipping" "1" //Check to see if we can use flipping.
"MagazineStyledReloads" "1" //Check to see if we can use Magazine-Styled Reloads.
"UseMuzzleSmoke" "1" //Check to see if we can use Muzzle Smoke.
"useironsights" "1" //Check if we can use Ironsights.
"LowerWeapon" "1" //Check if we can lower the weapon while sprinting. Disable this if your viewmodel does not have a lowering animation.
"useironsightcrosshair" "0" //Check if we can display a crosshair on ironsight.

//Ironsight settings
IronSight
{
"right" "-6.010000"
"up" "4.050000"
"forward" "-10"
"pitch" "-0.1"
"yaw" "-1.050000"
"roll" "0"
"fov" "-5"
}

//adjust settings
Adjust
{
"right" "-6.010000"
"up" "4.050000"
"forward" "-10"
"pitch" "-0.1"
"yaw" "-1.050000"
"roll" "0"
}

// Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
SoundData
{

"reload" "weapon/p90/reload1.wav"
"reload_npc" "Weapon_Pistol.NPC_Reload"
"empty" "Weapon_Pistol.Empty"
"single_shot" "weapon/p90/fire1.wav"
"single_shot_npc" "weapon/p90/npcfire1.wav"
"special1" "Weapon_Pistol.Special1"
"special2" "Weapon_Pistol.Special2"
"burst" "Weapon_Pistol.Burst"
}

// Weapon Sprite data is loaded by the Client DLL.
TextureData
{
"weapon"
{
"font" "WeaponIcons"
"character" "d"
}
"weapon_s"
{
"font" "WeaponIconsSelected"
"character" "d"
}
"weapon_small"
{
"font" "WeaponIconsSmall"
"character" "d"
}
"ammo"
{
"font" "WeaponIconsSmall"
"character" "p"
}
"crosshair"
{
"font" "Crosshairs"
"character" "Q"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}

//The "meat" of the weapon.
"WeaponSpec"
{
"WeaponOptions"
{
"CanReloadSingly" "0" //Check if we can reload 1 round at a time.
"DualWeapons" "0" //Check if we can use dual welding. This only works on primary fire unless you want "FireBothGuns" on secondary fire.
}

//Stuff that we will do on primary fire. Remove if you do not need primary fire (if you want night vision binoculars).
"PrimaryFire"
{
"FireRate" "0.1" //How fast this fires
"IronsightFireRate" "0.1" //How fast this fires when ironsighted.
"ZoomFireRate" "0.1" //How fast this fires when zoomed in.
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "1400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
"FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "6" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "1.5"
"y" "1.5"
"z" "1.5"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "0.2" //How many degrees.
"Seconds" "1" //How long this will be.
}
}

//Customization options.
"Customization"
{
//Skin options. set to -1 or 0 for default skin.
"Skin" "0"
//Bodygroup options. You can have up to 6 bodygroups on one weapon. You can also remove some of them if you don't want them. NOTE: These will ONLY apply on the viewmodel, NOT the worldmodel (yet).
"Bodygroup1"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}

"Bodygroup2"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}

"Bodygroup3"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}

"Bodygroup4"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}

"Bodygroup5"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}

"Bodygroup6"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}
}
}
}
« Last Edit: May 06, 2015, 12:06:22 AM by Bitl »

Offline Bitl

  • *
  • *
  • +7% chance to make useful post
  • Bitl is working their way up.Bitl is working their way up.Bitl is working their way up.
Re: The Custom Weapon TUTORIAL!
« Reply #9 on: May 06, 2015, 12:06:57 AM »
How and where does the custom weapon show up in game? I can't find mine anywhere. I've tried placing it in addons, custom, and the script folder.

Code: [Select]
WeaponData
{
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "P90" //Name.
"viewmodel" "models/weapons/v_smg1.mdl" //Viewmodel.
"playermodel" "models/weapons/w_smg1.mdl" //Worldmodel.
"anim_prefix" "smg2" //Animations for NPCs.
"weapon_type" "smg" //Weapon Type.
"bucket" "1" //The category this will go into.
"bucket_position" "0" //The slot this will go into.
"bucket_360" "0"
"bucket_position_360" "0"

"clip_size" "50" //Clip 1 size
"clip2_size" "-1" //Clip 2 size

"default_clip" "100" //The amount this will have in Clip 1 when spawned by default.
"default_clip2" "-1" //The amount this will have in Clip 2 when spawned by default.

"primary_ammo" "SMG1" //Primary ammo type.
"secondary_ammo" "None" //Secondary ammo type.

"weight" "2" //How much NPCs want to pick this up.
"rumble" "1" //Rumble setting for controllers.
"item_flags" "0" //Flags for the weapon.

"BuiltRightHanded" "1" //Check to see if this is Left-Handed. Useful for CSS weapons.
"AllowFlipping" "1" //Check to see if we can use flipping.
"MagazineStyledReloads" "1" //Check to see if we can use Magazine-Styled Reloads.
"UseMuzzleSmoke" "1" //Check to see if we can use Muzzle Smoke.
"useironsights" "1" //Check if we can use Ironsights.
"LowerWeapon" "1" //Check if we can lower the weapon while sprinting. Disable this if your viewmodel does not have a lowering animation.
"useironsightcrosshair" "0" //Check if we can display a crosshair on ironsight.

//Ironsight settings
IronSight
{
"right" "-6.010000"
"up" "4.050000"
"forward" "-10"
"pitch" "-0.1"
"yaw" "-1.050000"
"roll" "0"
"fov" "-5"
}

//adjust settings
Adjust
{
"right" "-6.010000"
"up" "4.050000"
"forward" "-10"
"pitch" "-0.1"
"yaw" "-1.050000"
"roll" "0"
}

// Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
SoundData
{

"reload" "weapon/p90/reload1.wav"
"reload_npc" "Weapon_Pistol.NPC_Reload"
"empty" "Weapon_Pistol.Empty"
"single_shot" "weapon/p90/fire1.wav"
"single_shot_npc" "weapon/p90/npcfire1.wav"
"special1" "Weapon_Pistol.Special1"
"special2" "Weapon_Pistol.Special2"
"burst" "Weapon_Pistol.Burst"
}

// Weapon Sprite data is loaded by the Client DLL.
TextureData
{
"weapon"
{
"font" "WeaponIcons"
"character" "d"
}
"weapon_s"
{
"font" "WeaponIconsSelected"
"character" "d"
}
"weapon_small"
{
"font" "WeaponIconsSmall"
"character" "d"
}
"ammo"
{
"font" "WeaponIconsSmall"
"character" "p"
}
"crosshair"
{
"font" "Crosshairs"
"character" "Q"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}

//The "meat" of the weapon.
"WeaponSpec"
{
"WeaponOptions"
{
"CanReloadSingly" "0" //Check if we can reload 1 round at a time.
"DualWeapons" "0" //Check if we can use dual welding. This only works on primary fire unless you want "FireBothGuns" on secondary fire.
}

//Stuff that we will do on primary fire. Remove if you do not need primary fire (if you want night vision binoculars).
"PrimaryFire"
{
"FireRate" "0.1" //How fast this fires
"IronsightFireRate" "0.1" //How fast this fires when ironsighted.
"ZoomFireRate" "0.1" //How fast this fires when zoomed in.
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "1400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
"FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "6" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "1.5"
"y" "1.5"
"z" "1.5"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "0.2" //How many degrees.
"Seconds" "1" //How long this will be.
}
}

//Customization options.
"Customization"
{
//Skin options. set to -1 or 0 for default skin.
"Skin" "0"
//Bodygroup options. You can have up to 6 bodygroups on one weapon. You can also remove some of them if you don't want them. NOTE: These will ONLY apply on the viewmodel, NOT the worldmodel (yet).
"Bodygroup1"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}

"Bodygroup2"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}

"Bodygroup3"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}

"Bodygroup4"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}

"Bodygroup5"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}

"Bodygroup6"
{
"Bodygroup" "0" //Bodygroup Category
"Subgroup" "0" //Bodygroup Section
}
}
}
}

Have you tried the following:

1. renamed the file to weapon_custom#.txt? Replace # with what weapon it is, then spawn it with give weapon_custom# in-game

2. changed the bucket/bucket_position numbers? change then untill you se the weapon on your HUD.

also remove the "Customization" stuff as it will crash the game.
FIREFIGHT RELOADED: GET IT NOW ON STEAM! http://store.steampowered.com/app/397680

Visit my Discord here: https://discord.gg/chfVwk2

crack tales, ooo-ooo

My Blog

"They are rage, brutal, without mercy. But you. You will be worse. Rip and tear, until it is don

Offline Lolkat

  • *
  • +1% chance to make useful post
  • Lolkat has no influence.
Re: The Custom Weapon TUTORIAL!
« Reply #10 on: May 06, 2015, 01:55:36 AM »

Have you tried the following:

1. renamed the file to weapon_custom#.txt? Replace # with what weapon it is, then spawn it with give weapon_custom# in-game

2. changed the bucket/bucket_position numbers? change then untill you se the weapon on your HUD.

also remove the "Customization" stuff as it will crash the game.

#1 worked fine, I can only get it to spawn via command.

Offline Bitl

  • *
  • *
  • +7% chance to make useful post
  • Bitl is working their way up.Bitl is working their way up.Bitl is working their way up.
Re: The Custom Weapon TUTORIAL!
« Reply #11 on: May 06, 2015, 02:13:38 AM »

Have you tried the following:

1. renamed the file to weapon_custom#.txt? Replace # with what weapon it is, then spawn it with give weapon_custom# in-game

2. changed the bucket/bucket_position numbers? change then untill you se the weapon on your HUD.

also remove the "Customization" stuff as it will crash the game.

#1 worked fine, I can only get it to spawn via command.
If that's the case, change your bucket/bucket_position numbers around so your weapon fits on the hud properly
FIREFIGHT RELOADED: GET IT NOW ON STEAM! http://store.steampowered.com/app/397680

Visit my Discord here: https://discord.gg/chfVwk2

crack tales, ooo-ooo

My Blog

"They are rage, brutal, without mercy. But you. You will be worse. Rip and tear, until it is don

Offline Lolkat

  • *
  • +1% chance to make useful post
  • Lolkat has no influence.
Re: The Custom Weapon TUTORIAL! - EDITED FOR BETA 0.2.0.2
« Reply #12 on: May 06, 2015, 11:57:42 PM »
Well now I can't get custom sounds to work anymore.
My first weapon has custom sound but my second doesnt. Did the exact same stuff and exact same sound files and still no sound.

Code: [Select]
// Pistol

WeaponData
{
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "AWP" //Name.
"viewmodel" "models/weapons/v_snip_awp.mdl" //Viewmodel.
"playermodel" "models/weapons/w_snip_awp.mdl" //Worldmodel.
"anim_prefix" "pistol" //Animations for NPCs.
"weapon_type" "pistol" //Weapon Type.
"bucket" "4" //The category this will go into.
"bucket_position" "1" //The slot this will go into.
"bucket_360" "0"
"bucket_position_360" "0"

"clip_size" "10" //Clip 1 size
"clip2_size" "-1" //Clip 2 size

"default_clip" "50" //The amount this will have in Clip 1 when spawned by default.
"default_clip2" "-1" //The amount this will have in Clip 2 when spawned by default.

"primary_ammo" "Pistol" //Primary ammo type.
"secondary_ammo" "None" //Secondary ammo type.

"weight" "2" //How much NPCs want to pick this up.
"rumble" "1" //Rumble setting for controllers.
"item_flags" "0" //Flags for the weapon.

"BuiltRightHanded" "1" //Check to see if this is Left-Handed. Useful for CSS weapons.
"AllowFlipping" "1" //Check to see if we can use flipping.
"MagazineStyledReloads" "1" //Check to see if we can use Magazine-Styled Reloads.
"UseMuzzleSmoke" "1" //Check to see if we can use Muzzle Smoke.
"useironsights" "1" //Check if we can use Ironsights.
"LowerWeapon" "0" //Check if we can lower the weapon while sprinting. Disable this if your viewmodel does not have a lowering animation.
"useironsightcrosshair" "0" //Check if we can display a crosshair on ironsight.

//Ironsight settings
IronSight
{
"right" "-6.010000"
"up" "4.050000"
"forward" "-10"
"pitch" "-0.1"
"yaw" "-1.050000"
"roll" "0"
"fov" "-5"
}

//adjust settings
Adjust
{
"right" "0.010000"
"up" "0.050000"
"forward" "0"
"pitch" "-0.1"
"yaw" "-1.050000"
"roll" "0"
}

// 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" "Weapon_Awp.Single"
"single_shot_npc" "Weapon_Pistol.NPC_Single"
"special1" "Weapon_Pistol.Special1"
"special2" "Weapon_Pistol.Special2"
"burst" "Weapon_Pistol.Burst"
}

// Weapon Sprite data is loaded by the Client DLL.
TextureData
{
"weapon"
{
"font" "WeaponIcons"
"character" "d"
}
"weapon_s"
{
"font" "WeaponIconsSelected"
"character" "d"
}
"weapon_small"
{
"font" "WeaponIconsSmall"
"character" "d"
}
"ammo"
{
"font" "WeaponIconsSmall"
"character" "p"
}
"crosshair"
{
"font" "Crosshairs"
"character" "Q"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}

//The "meat" of the weapon.
"WeaponSpec"
{
"WeaponOptions"
{
"CanReloadSingly" "0" //Check if we can reload 1 round at a time.
"DualWeapons" "0" //Check if we can use dual welding. This only works on primary fire unless you want "FireBothGuns" on secondary fire.
}

//Stuff that we will do on primary fire. Remove if you do not need primary fire (if you want night vision binoculars).
"PrimaryFire"
{
"FireRate" "1.0" //How fast this fires
"IronsightFireRate" "1.0" //How fast this fires when ironsighted.
"ZoomFireRate" "1.0" //How fast this fires when zoomed in.
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "3400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
"FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "250" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "1" //How many degrees.
"Seconds" "2" //How long this will be.
}
}
//Stuff that we will do on Secondary Fire. Remove if you do not need Secondary Fire.
"SecondaryFire"
{
"FireRate" "1.0" //How fast this fires
"IronsightFireRate" "1.0" //How fast this fires when ironsighted.
"ZoomFireRate" "1.0" //How fast this fires when zoomed in.
"UsePrimaryAmmo" "0" //Check if we can use primary ammo on secondary fire
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "3400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
"FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "250" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "1" //How many degrees.
"Seconds" "2" //How long this will be.
}
}

//Stuff that we will do on Zoom. Remove if you do not need Zoom.
"Zoom"
{
"UsesSound" "1" //Check to use a sound when zooming (SPECIAL1 is the default)
"UsesColor" "0" //Check to change the color of the screen when zoomed in.
"UseOnPrimaryFire" "0" //Check to see if we can use this on Primary Fire instead of secondary fire.
//Color (Only works when "UsesColor" is enabled". Uses the RGBA format.)
"ZoomColor"
{
"Red" "0"
"Green" "0"
"Blue" "0"
"Alpha" "0"
}
}

}
}

Code: [Select]
//weapon_custom2.txt

"Weapon_Awp.Single"
{
"channel" "CHAN_WEAPON"
"volume" "0.8"
"soundlevel" "SNDLVL_GUNFIRE"
"pitch" "85,95"

"rndwave"
{
"wave" "weapons/awp/fire1.wav"
}
}

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: The Custom Weapon TUTORIAL! - EDITED FOR BETA 0.2.0.2
« Reply #13 on: May 07, 2015, 01:04:26 PM »
Well now I can't get custom sounds to work anymore.
My first weapon has custom sound but my second doesnt. Did the exact same stuff and exact same sound files and still no sound.

Code: [Select]
// Pistol

WeaponData
{
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "AWP" //Name.
"viewmodel" "models/weapons/v_snip_awp.mdl" //Viewmodel.
"playermodel" "models/weapons/w_snip_awp.mdl" //Worldmodel.
"anim_prefix" "pistol" //Animations for NPCs.
"weapon_type" "pistol" //Weapon Type.
"bucket" "4" //The category this will go into.
"bucket_position" "1" //The slot this will go into.
"bucket_360" "0"
"bucket_position_360" "0"

"clip_size" "10" //Clip 1 size
"clip2_size" "-1" //Clip 2 size

"default_clip" "50" //The amount this will have in Clip 1 when spawned by default.
"default_clip2" "-1" //The amount this will have in Clip 2 when spawned by default.

"primary_ammo" "Pistol" //Primary ammo type.
"secondary_ammo" "None" //Secondary ammo type.

"weight" "2" //How much NPCs want to pick this up.
"rumble" "1" //Rumble setting for controllers.
"item_flags" "0" //Flags for the weapon.

"BuiltRightHanded" "1" //Check to see if this is Left-Handed. Useful for CSS weapons.
"AllowFlipping" "1" //Check to see if we can use flipping.
"MagazineStyledReloads" "1" //Check to see if we can use Magazine-Styled Reloads.
"UseMuzzleSmoke" "1" //Check to see if we can use Muzzle Smoke.
"useironsights" "1" //Check if we can use Ironsights.
"LowerWeapon" "0" //Check if we can lower the weapon while sprinting. Disable this if your viewmodel does not have a lowering animation.
"useironsightcrosshair" "0" //Check if we can display a crosshair on ironsight.

//Ironsight settings
IronSight
{
"right" "-6.010000"
"up" "4.050000"
"forward" "-10"
"pitch" "-0.1"
"yaw" "-1.050000"
"roll" "0"
"fov" "-5"
}

//adjust settings
Adjust
{
"right" "0.010000"
"up" "0.050000"
"forward" "0"
"pitch" "-0.1"
"yaw" "-1.050000"
"roll" "0"
}

// 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" "Weapon_Awp.Single"
"single_shot_npc" "Weapon_Pistol.NPC_Single"
"special1" "Weapon_Pistol.Special1"
"special2" "Weapon_Pistol.Special2"
"burst" "Weapon_Pistol.Burst"
}

// Weapon Sprite data is loaded by the Client DLL.
TextureData
{
"weapon"
{
"font" "WeaponIcons"
"character" "d"
}
"weapon_s"
{
"font" "WeaponIconsSelected"
"character" "d"
}
"weapon_small"
{
"font" "WeaponIconsSmall"
"character" "d"
}
"ammo"
{
"font" "WeaponIconsSmall"
"character" "p"
}
"crosshair"
{
"font" "Crosshairs"
"character" "Q"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}

//The "meat" of the weapon.
"WeaponSpec"
{
"WeaponOptions"
{
"CanReloadSingly" "0" //Check if we can reload 1 round at a time.
"DualWeapons" "0" //Check if we can use dual welding. This only works on primary fire unless you want "FireBothGuns" on secondary fire.
}

//Stuff that we will do on primary fire. Remove if you do not need primary fire (if you want night vision binoculars).
"PrimaryFire"
{
"FireRate" "1.0" //How fast this fires
"IronsightFireRate" "1.0" //How fast this fires when ironsighted.
"ZoomFireRate" "1.0" //How fast this fires when zoomed in.
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "3400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
"FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "250" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "1" //How many degrees.
"Seconds" "2" //How long this will be.
}
}
//Stuff that we will do on Secondary Fire. Remove if you do not need Secondary Fire.
"SecondaryFire"
{
"FireRate" "1.0" //How fast this fires
"IronsightFireRate" "1.0" //How fast this fires when ironsighted.
"ZoomFireRate" "1.0" //How fast this fires when zoomed in.
"UsePrimaryAmmo" "0" //Check if we can use primary ammo on secondary fire
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "3400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
"FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "250" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "1" //How many degrees.
"Seconds" "2" //How long this will be.
}
}

//Stuff that we will do on Zoom. Remove if you do not need Zoom.
"Zoom"
{
"UsesSound" "1" //Check to use a sound when zooming (SPECIAL1 is the default)
"UsesColor" "0" //Check to change the color of the screen when zoomed in.
"UseOnPrimaryFire" "0" //Check to see if we can use this on Primary Fire instead of secondary fire.
//Color (Only works when "UsesColor" is enabled". Uses the RGBA format.)
"ZoomColor"
{
"Red" "0"
"Green" "0"
"Blue" "0"
"Alpha" "0"
}
}

}
}

Code: [Select]
//weapon_custom2.txt

"Weapon_Awp.Single"
{
"channel" "CHAN_WEAPON"
"volume" "0.8"
"soundlevel" "SNDLVL_GUNFIRE"
"pitch" "85,95"

"rndwave"
{
"wave" "weapons/awp/fire1.wav"
}
}
hold on just to clarify

you duplicated weapon_custom1.txt and named it weapon_custom2.txt?

Offline Lolkat

  • *
  • +1% chance to make useful post
  • Lolkat has no influence.
Re: The Custom Weapon TUTORIAL! - EDITED FOR BETA 0.2.0.2
« Reply #14 on: May 07, 2015, 10:36:51 PM »
Well now I can't get custom sounds to work anymore.
My first weapon has custom sound but my second doesnt. Did the exact same stuff and exact same sound files and still no sound.

Code: [Select]
// Pistol

WeaponData
{
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "AWP" //Name.
"viewmodel" "models/weapons/v_snip_awp.mdl" //Viewmodel.
"playermodel" "models/weapons/w_snip_awp.mdl" //Worldmodel.
"anim_prefix" "pistol" //Animations for NPCs.
"weapon_type" "pistol" //Weapon Type.
"bucket" "4" //The category this will go into.
"bucket_position" "1" //The slot this will go into.
"bucket_360" "0"
"bucket_position_360" "0"

"clip_size" "10" //Clip 1 size
"clip2_size" "-1" //Clip 2 size

"default_clip" "50" //The amount this will have in Clip 1 when spawned by default.
"default_clip2" "-1" //The amount this will have in Clip 2 when spawned by default.

"primary_ammo" "Pistol" //Primary ammo type.
"secondary_ammo" "None" //Secondary ammo type.

"weight" "2" //How much NPCs want to pick this up.
"rumble" "1" //Rumble setting for controllers.
"item_flags" "0" //Flags for the weapon.

"BuiltRightHanded" "1" //Check to see if this is Left-Handed. Useful for CSS weapons.
"AllowFlipping" "1" //Check to see if we can use flipping.
"MagazineStyledReloads" "1" //Check to see if we can use Magazine-Styled Reloads.
"UseMuzzleSmoke" "1" //Check to see if we can use Muzzle Smoke.
"useironsights" "1" //Check if we can use Ironsights.
"LowerWeapon" "0" //Check if we can lower the weapon while sprinting. Disable this if your viewmodel does not have a lowering animation.
"useironsightcrosshair" "0" //Check if we can display a crosshair on ironsight.

//Ironsight settings
IronSight
{
"right" "-6.010000"
"up" "4.050000"
"forward" "-10"
"pitch" "-0.1"
"yaw" "-1.050000"
"roll" "0"
"fov" "-5"
}

//adjust settings
Adjust
{
"right" "0.010000"
"up" "0.050000"
"forward" "0"
"pitch" "-0.1"
"yaw" "-1.050000"
"roll" "0"
}

// 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" "Weapon_Awp.Single"
"single_shot_npc" "Weapon_Pistol.NPC_Single"
"special1" "Weapon_Pistol.Special1"
"special2" "Weapon_Pistol.Special2"
"burst" "Weapon_Pistol.Burst"
}

// Weapon Sprite data is loaded by the Client DLL.
TextureData
{
"weapon"
{
"font" "WeaponIcons"
"character" "d"
}
"weapon_s"
{
"font" "WeaponIconsSelected"
"character" "d"
}
"weapon_small"
{
"font" "WeaponIconsSmall"
"character" "d"
}
"ammo"
{
"font" "WeaponIconsSmall"
"character" "p"
}
"crosshair"
{
"font" "Crosshairs"
"character" "Q"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}

//The "meat" of the weapon.
"WeaponSpec"
{
"WeaponOptions"
{
"CanReloadSingly" "0" //Check if we can reload 1 round at a time.
"DualWeapons" "0" //Check if we can use dual welding. This only works on primary fire unless you want "FireBothGuns" on secondary fire.
}

//Stuff that we will do on primary fire. Remove if you do not need primary fire (if you want night vision binoculars).
"PrimaryFire"
{
"FireRate" "1.0" //How fast this fires
"IronsightFireRate" "1.0" //How fast this fires when ironsighted.
"ZoomFireRate" "1.0" //How fast this fires when zoomed in.
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "3400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
"FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "250" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "1" //How many degrees.
"Seconds" "2" //How long this will be.
}
}
//Stuff that we will do on Secondary Fire. Remove if you do not need Secondary Fire.
"SecondaryFire"
{
"FireRate" "1.0" //How fast this fires
"IronsightFireRate" "1.0" //How fast this fires when ironsighted.
"ZoomFireRate" "1.0" //How fast this fires when zoomed in.
"UsePrimaryAmmo" "0" //Check if we can use primary ammo on secondary fire
"InfiniteAmmoPerk" "1" //Check to see if we can use this with the Infinite Ammo Perk. Disable "InfiniteAmmo" to stop conflicts.
"InfiniteAmmo" "0" //Check to see if we can use this with Infinite Ammo by default. Disable "InfiniteAmmoPerk" to stop conflicts.
"MinRange" "0" //The minimum amount of range that this weapon would fire at.
"MaxRange" "3400" //The maximum amount of range that this weapon would fire at.
"CanFireUnderwater" "1" //Can we use this underwater?
"FireBothGuns" "0" //Can we fire both guns? Only works if "Dual Weapons" is on.
//Bullet Settings. Remove if you do not want bullets.
"Bullet"
{
"Damage" "250" //Amount of damage we will do.
"ShotCount" "1" //How many shots we will fire at once.
"Spread"
{
//Spread (in degrees)
"x" "2"
"y" "2"
"z" "2"
}
"IronsightSpread"
{
//Spread when ironsighted (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
"ZoomSpread"
{
//Spread when zoomed in (in degrees)
"x" "0.01"
"y" "0.01"
"z" "0.01"
}
}
//Recoil Settings.
"Recoil"
{
"EasyDampen" "0.5" //How much we will dampen the recoil on the Easy difficulty.
"Degrees" "1" //How many degrees.
"Seconds" "2" //How long this will be.
}
}

//Stuff that we will do on Zoom. Remove if you do not need Zoom.
"Zoom"
{
"UsesSound" "1" //Check to use a sound when zooming (SPECIAL1 is the default)
"UsesColor" "0" //Check to change the color of the screen when zoomed in.
"UseOnPrimaryFire" "0" //Check to see if we can use this on Primary Fire instead of secondary fire.
//Color (Only works when "UsesColor" is enabled". Uses the RGBA format.)
"ZoomColor"
{
"Red" "0"
"Green" "0"
"Blue" "0"
"Alpha" "0"
}
}

}
}

Code: [Select]
//weapon_custom2.txt

"Weapon_Awp.Single"
{
"channel" "CHAN_WEAPON"
"volume" "0.8"
"soundlevel" "SNDLVL_GUNFIRE"
"pitch" "85,95"

"rndwave"
{
"wave" "weapons/awp/fire1.wav"
}
}
hold on just to clarify

you duplicated weapon_custom1.txt and named it weapon_custom2.txt?

No, I duplicated weapon_customexample