Morbus Custom Weapons

I have been looking through most of the Morbus gamemode files, trying to make a gun i got from the workshop work on it. I can’t seem to make it spawn in my pointshop, or even add it to the spawnlist on the morbus maps. Does anyone have any idea if morbus has some sort of protection from customs or am i screwing something up? I even took the lua from a gun in morbus and pretty much copy pasted it (minus sounds, dmg, and models) into my customs lua and still nothing.

If this is the wrong section to post this on i apologize, but out of all of them it seemed the most fitting…

Does morbus use it’s own models and materials folder for it’s guns? Could that be the problem since they are in my main directory?

It might be easier to just explain to me the process of adding content, the only process I know of is extracting all of it’s files to the root directory and going from there, but this gun won’t spawn.

First off it’s good to understand how SWEP’s work. Try reading the wiki and creating some of your own before you start trying to rip sweps from gamemodes since usually they have gamemode-specific functions or advanced code.

Now if i’m reading this properly, you’re trying to take the gun models from Morbus and get them as a workshop addon or something. Unless you know some decent lua, and have the capabilities of porting over the weapon base and the weapons to be compatible as a stand alone addon, this task will be impossible for you. The weapon models, materials, and sounds are located in a number of different locations. Furthermore some of the code which sets up the sounds for the guns are stored inside the main weapon base.

I have been planning on creating an addon for the workshop that contains all of the Morbus weapons packaged for reuse in sandbox/derprp, you might just want to wait till then.

What I am trying to do is add a gun FROM the workshop INTO my morbus gamemode and make it available to be purchased in the pointshop (until i add it to the maps spawncode for guns) But it seems nothing i do works. I took a gun from the morbus’s gamemode (the swep) and copied most of the values over minus the damage sounds and models and nothing worked still.

[editline]1st October 2013[/editline]

I am thinking it might be pointshop related now…considering i completely copied the gun into the swep and nothing worked =p

Does the pointshop automatically detect the gamemode being played and look for the files in the morbusgame folder?

EDIT: Added it to the spawntables for the morbus map and it spawns but i cannot pick it up. The swep i am using is pretty much a 100% import from the Scar M8, minus the model and sounds.

Well, are you sure it isn’t the SWep itself? Have you tried giving yourself the swep without using Pointshop?

I am assuming it is the SWEP considering it spawns now (read edit on post above) but i cannot pick it up with E like i can the Scar M8.

Edit: replaced the model and sounds with the actual scar M8 swep, and it works -_- don’t understand what the problem is…do i need to rename the folder from weapon_me3_scimitar to weapon_mor_scimitar?

You’re being too vague. Without actually seeing the content we can’t help much.

This is the swep for the shotgun i want to work ingame


if(CLIENT) then
SWEP.PrintName = "M-27 Scimitar";
SWEP.Slot = 3;
SWEP.SlotPos = 3;
SWEP.DrawAmmo = true;
SWEP.DrawCrosshair = true;
end

SWEP.Author = "N7 Shepard EA"
SWEP.Contact = "masseffectgmod.esport-awg.com"
SWEP.Purpose = '"An elite military shotgun capable of rapid fire, this weapon is deadly at short range but ineffective at long range."'
SWEP.Instruction = "Primary to shoot - No Ironsights have been made yet!"
SWEP.Category = "Mass Effect GMOD"

SWEP.Spawnable = true
SWEP.AdminSpawnable = true

SWEP.ViewModel = "models/me3/wrp/v_shotgun.mdl"
SWEP.WorldModel = "models/me3/wrp/w_shotgun.mdl"

SWEP.HoldType = "ar2"

SWEP.FiresUnderwater = true

SWEP.ReloadSound = "weapons/avenger_smg1/smg1_reload.wav"

SWEP.base = "weapon_base"

SWEP.Primary.ClipSize = 10
SWEP.Primary.DefaultClip = 20
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "shotgunshell"
SWEP.Primary.Sound = "weapons/avenger_smg1/smg1_fire1.wav"
--SWEP.Primary.Sounds = {"weapons/predator_pistol/pistol_fire2.wav","weapons/predator_pistol/pistol_fire3.wav"}
SWEP.Primary.Sounds = {"weapons/scimitar_shotgun/shotgun_fire7.wav","weapons/scimitar_shotgun/shotgun_dbl_fire.wav"}
SWEP.Primary.TakeAmmo = 1
SWEP.Primary.Damage = 100/120
SWEP.Primary.Spread = 0.66
SWEP.Primary.Delay = 0.65
SWEP.Primary.Force = 15
SWEP.Primary.NumberofShots = 6
SWEP.Primary.Recoil = 0.35
 
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.Sounds = {"weapons/scimitar_shotgun/shotgun_fire6.wav","weapons/scimitar_shotgun/shotgun_dbl_fire7.wav"}

function SWEP:Initialize()
	util.PrecacheSound(self.Primary.Sound)
	util.PrecacheSound(self.ReloadSound)
	for k,v in pairs(self.Primary.Sounds) do
		util.PrecacheSound(v)
	end
    self:SetWeaponHoldType( self.HoldType )
end 

function SWEP:PrimaryAttack()
 
	if ( !self:CanPrimaryAttack() ) then return end
 
	local bullet = {} 
		bullet.Num = self.Primary.NumberofShots
		bullet.Src = self.Owner:GetShootPos()
		bullet.Dir = self.Owner:GetAimVector()
		bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0)
		bullet.Tracer = 1
		bullet.Force = self.Primary.Force 
		bullet.Damage = self.Primary.Damage 
		bullet.AmmoType = self.Primary.Ammo 
 
	local rnda = self.Primary.Recoil * -1 
	local rndb = self.Primary.Recoil * math.random(-1, 1) 
 
	self.BaseClass.ShootEffects(self)
 
	self.Owner:FireBullets( bullet ) 
	self:EmitSound(Sound( self.Primary.Sounds[math.random(1,table.Count(self.Primary.Sounds))] )) 
	self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) ) 
	--self.Owner:ViewPunch( Angle( rnda * 0.75,rndb * 0.75,rnda ) ) 
	--self.Owner:SetEyeAngles( self.Owner:EyeAngles() + Angle( rnda, math.Clamp(rndb,0,180), 0 ) )
	self:TakePrimaryAmmo(self.Primary.TakeAmmo) 
 
	self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
	self:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
end 

function SWEP:SecondaryAttack()
 
	if ( !self:CanPrimaryAttack() ) then return end
	if ( self.Owner:GetActiveWeapon():Clip1() == 1 ) then
		self:PrimaryAttack()
		return
	end
 
	local bullet = {} 
		bullet.Num = self.Primary.NumberofShots * 2
		bullet.Src = self.Owner:GetShootPos()
		bullet.Dir = self.Owner:GetAimVector()
		bullet.Spread = Vector( self.Primary.Spread * 0.1 * 1.5 , self.Primary.Spread * 0.1 * 1.5, 0)
		if (self.Owner:GetActiveWeapon():Clip1() <= math.Round(self.Primary.ClipSize/3)) then
			bullet.Tracer = 1
		else
			bullet.Tracer = math.Clamp( math.random(-1,1), 0, 1 )
		end
		bullet.Force = self.Primary.Force * 1.25
		bullet.Damage = self.Primary.Damage * 1.25
		bullet.AmmoType = self.Primary.Ammo 
 
	local rnda = self.Primary.Recoil * -1 * 2
	local rndb = self.Primary.Recoil * math.random(-1, 1) * 2
 
	self.BaseClass.ShootEffects(self)
 
	self.Owner:FireBullets( bullet ) 
	self:EmitSound(Sound( self.Secondary.Sounds[math.random(1,table.Count(self.Secondary.Sounds))] )) 
	self.Owner:ViewPunch( 2*Angle( rnda,rndb,rnda ) ) 
	--self.Owner:ViewPunch( 2*Angle( rnda * 0.75,rndb * 0.75,rnda ) ) 
	--self.Owner:SetEyeAngles( self.Owner:EyeAngles() + 2*Angle( rnda, math.Clamp(rndb,0,180), 0 ) )
	self:TakePrimaryAmmo(self.Primary.TakeAmmo*2)
 
	self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
	self:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
end 

function SWEP:Reload()
 
	if self.ReloadingTime and CurTime() <= self.ReloadingTime then return end
 
	if ( self:Clip1() < self.Primary.ClipSize and self.Owner:GetAmmoCount( self.Primary.Ammo ) > 0 ) then
		self:EmitSound(Sound(self.ReloadSound))
		self:DefaultReload( ACT_VM_RELOAD )
                local AnimationTime = self.Owner:GetViewModel():SequenceDuration() * 3
                self.ReloadingTime = CurTime() + AnimationTime
                self:SetNextPrimaryFire(CurTime() + AnimationTime)
                self:SetNextSecondaryFire(CurTime() + AnimationTime)
				timer.Simple(AnimationTime,function()
					self:SendWeaponAnim( ACT_VM_IDLE )
				end)
	end
end

function SWEP:Deploy()
return true
end
 
function SWEP:Holster()
return true
end
 
function SWEP:Think()
end

And this is the merged pile of crap i tried to make to get it to work =p


if (SERVER) then
	AddCSLuaFile("shared.lua")
	end

SWEP.PrintName 		= "Scar M8"
if (CLIENT) then
	SWEP.PrintName 		= "Scar M8"
	SWEP.Slot 			= 3
	SWEP.SlotPos 		= 1
	SWEP.IconLetter 		= "k"
    SWEP.ViewModelFlip = false
	SWEP.DrawAmmo = true;
	SWEP.DrawCrosshair = true;
end


SWEP.MuzzleAttachment		= "1" -- Should be "1" for CSS models or "muzzle" for hl2 models

SWEP.EjectDelay			= 0.53


SWEP.HoldType 		= "shotgun"

SWEP.Instructions 		= ""

SWEP.Base 				= "weapon_mor_base_pump"

SWEP.Spawnable 			= false
SWEP.AdminSpawnable 		= false

SWEP.ViewModel = "models/weapons/v_shotgun.mdl"
SWEP.WorldModel = "models/weapons/w_shotgun.mdl"
SWEP.ReloadSound = "weapons/avenger_smg1/smg1_reload.wav"
SWEP.ShowWorldModel         = false

SWEP.Primary.Sound = Sound("weapons/avenger_smg1/smg1_fire1.wav")
--SWEP.Primary.Sounds = {"weapons/predator_pistol/pistol_fire2.wav","weapons/predator_pistol/pistol_fire3.wav"}
SWEP.Primary.Sounds = {"weapons/scimitar_shotgun/shotgun_fire7.wav","weapons/scimitar_shotgun/shotgun_dbl_fire.wav"}
SWEP.Primary.TakeAmmo = 1
SWEP.Primary.Damage = 100/120
SWEP.Primary.Spread = 0.66
SWEP.Primary.Delay = 0.65
SWEP.Primary.Force = 15
SWEP.Primary.NumberofShots = 6
SWEP.Primary.Recoil = 0.35
SWEP.Primary.ClipSize = 10
SWEP.Primary.DefaultClip = 20
SWEP.Primary.Automatic 		= false
SWEP.Primary.Ammo 		= "Buckshot"

SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.Sounds = {"weapons/scimitar_shotgun/shotgun_fire6.wav","weapons/scimitar_shotgun/shotgun_dbl_fire7.wav"}

SWEP.Primary.KickUp         = 0.8
SWEP.Primary.KickDown           = 0.4
SWEP.Primary.KickHorizontal         = 0.5

SWEP.Gun = "weapon_mor_scarm8"
SWEP.GunHud = {height = 2, width = 4, attachmentpoint = "1", enabled = false}
SWEP.Kind = WEAPON_RIFLE
SWEP.AllowDrop = true
SWEP.AmmoEnt = "item_ammo_buckshot_mor"
SWEP.KGWeight = 24
SWEP.AutoSpawnable = true
SWEP.StoredAmmo = 0

SWEP.ShotgunReloading		= false
SWEP.ShotgunFinish		= 0.3
SWEP.ShellTime		= 0.5
SWEP.InsertingShell	=		false

function SWEP:Initialize()
	util.PrecacheSound(self.Primary.Sound)
	util.PrecacheSound(self.ReloadSound)
	for k,v in pairs(self.Primary.Sounds) do
		util.PrecacheSound(v)
	end
    self:SetWeaponHoldType( self.HoldType )
end 

function SWEP:PrimaryAttack()
 
	if ( !self:CanPrimaryAttack() ) then return end
 
	local bullet = {} 
		bullet.Num = self.Primary.NumberofShots
		bullet.Src = self.Owner:GetShootPos()
		bullet.Dir = self.Owner:GetAimVector()
		bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0)
		bullet.Tracer = 1
		bullet.Force = self.Primary.Force 
		bullet.Damage = self.Primary.Damage 
		bullet.AmmoType = self.Primary.Ammo 
 
	local rnda = self.Primary.Recoil * -1 
	local rndb = self.Primary.Recoil * math.random(-1, 1) 
 
	self.BaseClass.ShootEffects(self)
 
	self.Owner:FireBullets( bullet ) 
	self:EmitSound(Sound( self.Primary.Sounds[math.random(1,table.Count(self.Primary.Sounds))] )) 
	self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) ) 
	--self.Owner:ViewPunch( Angle( rnda * 0.75,rndb * 0.75,rnda ) ) 
	--self.Owner:SetEyeAngles( self.Owner:EyeAngles() + Angle( rnda, math.Clamp(rndb,0,180), 0 ) )
	self:TakePrimaryAmmo(self.Primary.TakeAmmo) 
 
	self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
	self:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
end 

function SWEP:SecondaryAttack()
 
	if ( !self:CanPrimaryAttack() ) then return end
	if ( self.Owner:GetActiveWeapon():Clip1() == 1 ) then
		self:PrimaryAttack()
		return
	end
 
	local bullet = {} 
		bullet.Num = self.Primary.NumberofShots * 2
		bullet.Src = self.Owner:GetShootPos()
		bullet.Dir = self.Owner:GetAimVector()
		bullet.Spread = Vector( self.Primary.Spread * 0.1 * 1.5 , self.Primary.Spread * 0.1 * 1.5, 0)
		if (self.Owner:GetActiveWeapon():Clip1() <= math.Round(self.Primary.ClipSize/3)) then
			bullet.Tracer = 1
		else
			bullet.Tracer = math.Clamp( math.random(-1,1), 0, 1 )
		end
		bullet.Force = self.Primary.Force * 1.25
		bullet.Damage = self.Primary.Damage * 1.25
		bullet.AmmoType = self.Primary.Ammo 
 
	local rnda = self.Primary.Recoil * -1 * 2
	local rndb = self.Primary.Recoil * math.random(-1, 1) * 2
 
	self.BaseClass.ShootEffects(self)
 
	self.Owner:FireBullets( bullet ) 
	self:EmitSound(Sound( self.Secondary.Sounds[math.random(1,table.Count(self.Secondary.Sounds))] )) 
	self.Owner:ViewPunch( 2*Angle( rnda,rndb,rnda ) ) 
	--self.Owner:ViewPunch( 2*Angle( rnda * 0.75,rndb * 0.75,rnda ) ) 
	--self.Owner:SetEyeAngles( self.Owner:EyeAngles() + 2*Angle( rnda, math.Clamp(rndb,0,180), 0 ) )
	self:TakePrimaryAmmo(self.Primary.TakeAmmo*2)
 
	self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
	self:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
end 

function SWEP:Reload()
 
	if self.ReloadingTime and CurTime() <= self.ReloadingTime then return end
 
	if ( self:Clip1() < self.Primary.ClipSize and self.Owner:GetAmmoCount( self.Primary.Ammo ) > 0 ) then
		self:EmitSound(Sound(self.ReloadSound))
		self:DefaultReload( ACT_VM_RELOAD )
                local AnimationTime = self.Owner:GetViewModel():SequenceDuration() * 3
                self.ReloadingTime = CurTime() + AnimationTime
                self:SetNextPrimaryFire(CurTime() + AnimationTime)
                self:SetNextSecondaryFire(CurTime() + AnimationTime)
				timer.Simple(AnimationTime,function()
					self:SendWeaponAnim( ACT_VM_IDLE )
				end)
	end
end

function SWEP:Deploy()
return true
end
 
function SWEP:Holster()
return true
end
 
function SWEP:Think()
end

I moved all of the files i needed for the gun into the morbusgame/content folder…but now the gun is invisible (can pick it up but no model when it’s on the ground) and when i pick it up it has the normal shutgun model instead of the custom model.

I don’t get any LUA errors so it’s hard for me to know where i messed up since i don’t know anything =)

[editline]1st October 2013[/editline]

I took 90% of the swep code from the Scar M8 and then peiced in chunks of the Scimitar code…needless to say i confused myself while breaking the gun =)

I have a backup for the Scar M8 swep so it doesn’t matter to me that i broke it.

I also have a SWEP for the scimitar that spawns the gun, with the model, but i can’t pick it up…so i have a gun with no model i can pick up and the model doesn’t work, and a gun with a model i cant pick up =(

FIXED IT, i am an idiot btw, i had the swep turn off worldmodels…now everything works flawlessly. Sorry about all the trouble =(