I'm making this SWEP pack and as I went into the game and pulled out the test swep to see if it works this happened:
[IMG]http://i51.tinypic.com/298pvn.jpg[/IMG]
(Sorry for big picture)
The hand textures are fine in the dark but I don't really care about them at the moment, it's guns positioning that's a bit confusing, also the reloading.
[video=youtube;NyJksmZC6Ow]http://www.youtube.com/watch?v=NyJksmZC6Ow[/video]
This is what I am doing to fix the CSS weapon origins: (simplified version)
[lua]
local BlendPos;
local BlendAng;
function SWEP:GetViewModelPosition(pos, ang)
local TargetPos, TargetAng = self.NormalTargetPos, self.NormalTargetAng;
BlendPos = LerpVector(0.3, BlendPos, TargetPos);
BlendAng = LerpVector(0.3, BlendAng, TargetAng);
local Right = ang:Right();
local Up = ang:Up();
local Forward = ang:Forward();
pos = pos + BlendPos.x * Right;
pos = pos + BlendPos.y * Forward;
pos = pos + BlendPos.z * Up;
return pos, ang;
end
[/lua]
Sorry if I forgot something, I just scrapped a lot of code.
You will have to set the origin variables.
[QUOTE=_NewBee;31005083]This is what I am doing to fix the CSS weapon origins: (simplified version)
*Code*
Sorry if I forgot something, I just scrapped a lot of code.
You will have to set the origin variables.[/QUOTE]
Thank you, will try it out soon.
This bugged reload made me laugh a bit, it looks like he's petting the mag.
[QUOTE=BBOOBBYY!;31007239]This bugged reload made me laugh a bit, it looks like he's petting the mag.[/QUOTE]
Haha, I thought the same. I don't have any idea on how to fix it though
Just a thought, what holdtype are you using?
[QUOTE=thefreeman193;31007485]Just a thought, what holdtype are you using?[/QUOTE]
ar2, should I post the code?
Yeah if you can, thanks.
Here:
[lua]if (SERVER) then
AddCSLuaFile( "shared.lua" )
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
end
SWEP.Category = "Example Swep"
SWEP.PrintName = "AA13"
SWEP.Author = "SampleFriend"
SWEP.Purpose = ""
SWEP.Instructions = "MB1 = Fire Bullets. MB2 = Iron Sights"
SWEP.ViewModelFOV = 82
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/v_jinrai_aa13.mdl"
SWEP.WorldModel = "models/weapons/w_aa13.mdl"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.Base = "weapon_az_base_shotgun"
SWEP.Slot = 2
SWEP.SlotPos = 5
SWEP.Primary.Sound = Sound("weapons/aa13/aa13_fire.wav")
SWEP.Primary.Automatic = false
SWEP.Hold = "ar2"
SWEP.Spread = 0.03
SWEP.Primary.ClipSize = 8
SWEP.Primary.DefaultClip = 60
SWEP.Primary.Ammo = "Buckshot"
SWEP.MuzzleEffect = "muzzle_shotgun"
SWEP.ViewPunch = 1.3
SWEP.ViewKick = 1.8
SWEP.MuzzleAttachment = "1"
SWEP.Caliber = "gauge_ball"
SWEP.RPM = 300
SWEP.Zoom = 2.1
SWEP.Gauge = 12
SWEP.CrossHairScale = 0.03
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Ammo = "none"
SWEP.PumpAfterShoot = false
SWEP.IronSightModifier = 0.6
SWEP.IronSightsPos = Vector (2.641, -3.1996, 2.4774)
SWEP.IronSightsAng = Vector (0.1579, 0.2034, -8.8101)
function SWEP:IronSight()
if self.Owner:KeyPressed(IN_ATTACK2) then
self:SetIronsights(true, self.Owner)
self.Owner:SetFOV( 20, 0.15 )
self.Owner:SetWalkSpeed(100)
self.Owner:SetRunSpeed(100)
self.Weapon:SetNetworkedBool("Scoped",true)
if SERVER then
self.Owner:DrawViewModel(false)
end
end
if self.Owner:KeyReleased(IN_ATTACK2) then
self.Owner:SetFOV( 0, 0.15 )
self.Weapon:SetNetworkedBool("Scoped",false)
self:SetIronsights(false, self.Owner)
self.Owner:SetWalkSpeed(250)
self.Owner:SetRunSpeed(500)
if SERVER then
self.Owner:DrawViewModel(true)
end
end
end[/lua]
I can see 2 problems here, the holdtype and base. Firstly, shouldn't it be SWEP.HoldType and not SWEP.Hold? And secondly, the problem is probably caused by using the base 'weapon_az_base_[B]shotgun[/B]', and therefore the weapon is reloading like a shotgun, with the hand animation adding bullets to the gun.
[QUOTE=thefreeman193;31008623]I can see 2 problems here, the holdtype and base. Firstly, shouldn't it be SWEP.HoldType and not SWEP.Hold? And secondly, the problem is probably caused by using the base 'weapon_az_base_[B]shotgun[/B]', and therefore the weapon is reloading like a shotgun, with the hand animation adding bullets to the gun.[/QUOTE]
Ooooh, that'll probably do it (I'll check when I get home). Thank you very much!
EDIT: Ok, so it fixed the reload but I think the origins of the weapons are off I'll mess around with what _NewBee posted to see if I can get it working.
Thanks for the help guys.
Sorry, you need to Log In to post a reply to this thread.