Page 1 of 2
Help with custom weapons
Posted: Thu Jul 15, 2010 1:25 am
by ShadowX99
Im having a problem with my custom weapons, when ever i try to select them they dont allow me to, I think it has to do with "missing { in file scripts (*autoAim*)
Anyone know how to fix this?
Posted: Thu Jul 15, 2010 4:40 am
by Neico
wrong forum, moved...
also: without a little insight of how your script looks like is it quite hard to see where the problem is
Posted: Thu Jul 15, 2010 5:19 pm
by ShadowX99
Here is what my script looks like
Code: Select all
"WeaponData"
{
// Weapon data is loaded by both the Game and client DLLs.
"printname" "F2000"
"viewmodel" "models/weapons/V_lam_elf.mdl"
"playermodel" "models/weapons/W_lam_elf.mdl"
"anim_prefix" "ar2"
"bucket" "2"
"bucket_position" "17"
"clip_size" "30"
"clip2_size" "0"
"default_clip" "30"
"default_clip2" "0"
"primary_ammo" "ar2"
"secondary_ammo" "none"
"weight" "0"
"item_flags" "0"
"BuiltRightHanded" "0"
"AllowFlipping "1"
"csviewmodel" "1"
// Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
"SoundData"
{
"reaload_npc" "Weapon_AR2.NPC_Reload"
"empty" "Default.ClipEmpty_Rifle"
"single_shot" "weapon_F2000.Single"
"single_shot_npc" "weapon_F2000.Single"
//Zoom in
"special1" "Default.Zoom"
//Zoom out
"special2" "Default.Zoom"
}
// Weapon Sprite data is loaded by the Client DLL.
"TextureData"
{
"weapon"
{
"font" "CSWeaponIcons"
"character" "e"
}
"weapon_s"
{
"font" "CSWeaponIconsSelected"
"character" "e"
}
"ammo"
{
"font" "WeaponIcons"
"character "u"
}
"crosshair"
{
"font" "Crosshairs"
"character" "Q"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}
"Advanced" // only for Weapon_Scripted
{
// **Primary Attack**
// 0 = none, 1 = Basic Bullet, 2 = Burst, 3 = shotgun, 4 = autoshotgun, 5 = laser, 6 = warp
"FireType1" "1"
// Rate of Weapons Fire ( Not for laser or warp )
"FireRate1" "0.1"
// Allow a refire as fast as the player can click, Basic Bullet Only.
"FastFire1" "0"
// Allow Fire Underwater?
"FireUnderWater1" "0"
// For Bullet accuracy
"FireCone1" "1" // Starting Value ( 0-20 )
"FireConeLerp1" "1" // Bool
"FireConeLerpto1" "5" // Value to lerp accuracy too ( 0-20 )
// **Secondary Attack**
// 0 = none, 1 = Basic Bullet, 2 = Burst, 3 = shotgun, 4 = autoshotgun, 5 = laser, 6 = warp, 8 = scope
"FireType2" "0"
// Rate of Weapons Fire ( Not for laser or warp )
"FireRate2" "0.1"
// Allow a refire as fast as the player can click, Basic Bullet Only.
"FastFire2" "0"
// Allow Fire Underwater?
"FireUnderWater2" "0"
// Secondary Fire uses Secondary Ammo Type. If 0, will use primary ammo.
"SecondaryAmmoUsed" "0"
// For Bullet accuracy
"FireCone2" "1" // Starting Value ( 0-20 )
"FireConeLerp2" "1" // Bool
"FireConeLerpto2" "5" // Value to lerp accuracy too ( 0-20 )
// ** Global Weapon Settings**
// Number of Recoil Animations, weapon models with ACT_VM_RECOIL animations.
// ( Only if a weapon has recoil animations, Not for laser or warp )
"NumberOfRecoilAnims" "0"
// Shots fired till next recoil animation. ( Only if a weapon has recoil animations )
"RecoilIncrementSpeed" "1"
// 1 = Pistol, 2 = AR2, 3 = crossbow, 4 = physgun, 5 = shotgun, 6 = smg1
// This is the player animation set that will be used on all players you view ingame.
"PlayerAnimationSet" "6"
"UseScopedFireCone" "1"
"ScopedFireCone" "1"
"ScopedColorR" "0"
"ScopedColorG" "0"
"ScopedColorB" "0"
}
}
I used the aug script for an example because i couldnt find a tutorial on making a weapon
Posted: Thu Jul 15, 2010 6:48 pm
by fug4life
When you say 'select' them you mean you can't 'spawn' them (give custom_weapon)?
Or you can spawn them but cannot select the weapon from the weapon hud menu?
Also if you think a } is missing or something, then re copy the script and update it again to use your weapon settings. Thats if you want to be sure.
Posted: Thu Jul 15, 2010 7:10 pm
by ShadowX99
I copyed the aug script and placed it in my custom weapon script but it only solved my hud icon problem, and i ment to say is that i can spawn the weapon but i cant select it from my weapon hud menu
Posted: Thu Jul 15, 2010 7:17 pm
by fug4life
So to clarify, you can spawn the weapon. You can see the weapon hud icon?
Does the text (F2000) show red on the icon?
Posted: Thu Jul 15, 2010 7:19 pm
by ShadowX99
Yes it does say F2000 on the red icon
Posted: Thu Jul 15, 2010 9:33 pm
by fug4life
The only things I can suggest are change bucket&slot positions incase you're conflictin with somethin else.
Also you've given scoped settings but havent specified here:
// **Secondary Attack**
// 0 = none, 1 = Basic Bullet, 2 = Burst, 3 = shotgun, 4 = autoshotgun, 5 = laser, 6 = warp, 8 = scope
"FireType2" "0"
Either specify scope settings above and scope actually = 7
not 8
Or delete:
"UseScopedFireCone" "1"
"ScopedFireCone" "1"
"ScopedColorR" "0"
"ScopedColorG" "0"
"ScopedColorB" "0"
Thats all I can suggest to you
Also make sure you're restarting the mod or renaming the script files when saving changes for the changes to take affect.
Posted: Thu Jul 15, 2010 10:48 pm
by ShadowX99
I tried your suggestions but they didnt work
, but for some reason when i drop all my weapons it shows up but when i pick them back up i cant use it?
Posted: Thu Jul 15, 2010 11:14 pm
by fug4life
Try changing the name of the custom weapon script.
custom_f2000_new
or something.
Posted: Thu Jul 15, 2010 11:31 pm
by ShadowX99
That custom_f2000_new worked
Now i can select from my weapons hud, now my only problems are the sound and the fact that the weapons is sticking out of my characters crotch
Posted: Fri Jul 16, 2010 12:10 am
by fug4life
The crotch issue, will need fixing in a modeling program.
Is the model just a css re-skin? or completely new model?
If it was a reskin I thought you may be able to use the skin and hex an exsisting converted cs weapon.
As for sound describe what you've done so far and I'll see if I can help.
Posted: Fri Jul 16, 2010 12:19 am
by ShadowX99
Well the weapon is a custom model, but i dont have any modeling programs
and for the sounds i used a txt i found in the folder
"weapon_F2000.Single"
{
"channel" "CHAN_WEAPON
"volume" "1.0"
"Compatibilityattenuation" "ATTN_NORM"
"Pitch" "PITCH_NORM"
"wave" "weapons\F2000\f2000-1.wav"
}
"Weapon_F2000.boltback"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation" "1.0"
"pitch" "PITCH_NORM"
"wave" "weapons\F2000\f2000_boltback.wav"
}
"Weapon_F2000.magout"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation" "1.0"
"pitch" "PITCH_NORM"
"wave" "weapons\F2000\f2000_magout.wav"
}
"Weapon_F2000.magin"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation" "1.0"
"pitch" "PITCH_NORM"
"wave" "weapons\F2000\f2000_magin.wav"
}
"Weapon_F2000.boltforward"
{
"channel" "CHAN_ITEM"
"volume" "1.0"
"CompatibilityAttenuation" "1.0"
"pitch" "PITCH_NORM"
"wave" "weapons\F2000\f2000_boltforward.wav"
}
I placed it into game_sounds_cs_weapons
Posted: Fri Jul 16, 2010 12:48 am
by fug4life
as long as you placed at the bottom should be fine, I'd just check css is mounting correctly for you when you load a map or weapon.
Posted: Fri Jul 16, 2010 1:51 am
by ShadowX99
When i try adding the sounds to the bottom of the list and when i try to spawn it, it will disconect me and says theres a bad string or something?