Help with custom weapons

Discuss Certain Aspects of Mapping, Modeling, and Coding.
User avatar
ShadowX99
Vertex
Vertex
Posts: 11
Joined: Mon Jul 12, 2010 10:18 pm
Location: over there

Help with custom weapons

Post 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?
User avatar
Neico
Lead Coder
Lead Coder
Posts: 1799
Joined: Tue Aug 15, 2006 3:39 pm
Location: Germany
Contact:

Post 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
Image
User avatar
ShadowX99
Vertex
Vertex
Posts: 11
Joined: Mon Jul 12, 2010 10:18 pm
Location: over there

Post 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
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post 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.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
User avatar
ShadowX99
Vertex
Vertex
Posts: 11
Joined: Mon Jul 12, 2010 10:18 pm
Location: over there

Post 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
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post 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?
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
User avatar
ShadowX99
Vertex
Vertex
Posts: 11
Joined: Mon Jul 12, 2010 10:18 pm
Location: over there

Post by ShadowX99 »

Yes it does say F2000 on the red icon
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post 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.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
User avatar
ShadowX99
Vertex
Vertex
Posts: 11
Joined: Mon Jul 12, 2010 10:18 pm
Location: over there

Post 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?
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

Try changing the name of the custom weapon script.

custom_f2000_new

or something.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
User avatar
ShadowX99
Vertex
Vertex
Posts: 11
Joined: Mon Jul 12, 2010 10:18 pm
Location: over there

Post by ShadowX99 »

That custom_f2000_new worked :D 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
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post 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.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
User avatar
ShadowX99
Vertex
Vertex
Posts: 11
Joined: Mon Jul 12, 2010 10:18 pm
Location: over there

Post 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
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post 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.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
User avatar
ShadowX99
Vertex
Vertex
Posts: 11
Joined: Mon Jul 12, 2010 10:18 pm
Location: over there

Post 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?
Post Reply