Bullet Penetration

Hey, I was wondering if it is possible to make it so that bullets go through things when fired. You know, like Call Of Duty or something. If so, someone should make this. That would be bad ass.

Haha nobody?

I dont think the Source engine G-mod uses can handle that, Cs:s can, but, That’s all i know Mabe someone can make a code deciding relative path of bullet and Allow to pass, but that would take ALOT of coding, and i dont think anyone but a LUA God has that much patience, and ability to stave of sleep Deprivation that long, Sorry i couldn’t be much more help

You could do damage behind a wall, but the bullet would look to stop in the wall, and wouldn’t actually hit anything behind it.

But I’ve seen Sweps like the Tactical Aggro Sniper do it before. So is there someway to make all the weapons do this?

Dooooohhhh… Hang on. I have this coded in my gamemode somewhere… I will paste a few snippets :slight_smile:

[editline]05:42PM[/editline]

[lua]if( self.Primary.PenetrateDoors ) then

 	local trace = { }
 	trace.start = self.Owner:GetShootPos();
 	trace.endpos = trace.start + self.Owner:GetAimVector() * 600;
 	trace.filter = self.Owner;
 	
 	local tr = util.TraceLine( trace );
 	
 	if( tr.Entity:IsValid() and tr.Entity:GetModel() == "models/props_c17/door01_left.mdl" and tonumber( tr.Entity:GetSkin() ) ~= 12 ) then
 	 
	 	local trace = { }
	 	trace.start = tr.HitPos;
	 	trace.endpos = trace.start + self.Owner:GetAimVector() * 600;
	 	trace.filter = tr.Entity;
	 	
	 	local tr2 = util.TraceLine( trace );
 	
 		local mul2 = ( tr.HitPos - tr2.HitPos ):Length() * .01;
 	 
	 	local bullet = {} 
	 	bullet.Num 		= self.Primary.NumShots;
	 	bullet.Src 		= tr.HitPos + self.Owner:GetAimVector() * 5;
	 	bullet.Dir 		= self.Owner:GetAimVector()			// Dir of bullet 
	 	bullet.Spread 	= ( self.Primary.SpreadCone + Vector( .04, .04, .04 ) * self.Primary.Recoil ) * mul2 * mul;
	 	bullet.Tracer	= 1									// Show a tracer on every x bullets  
	 	bullet.Force	= .1									// Amount of force to give to phys objects 
	 	bullet.Damage	= self.Primary.Damage;
 	 	bullet.TracerName = self.Primary.Tracer;
 	 	
 	 	self.Owner:FireBullets( bullet ) 
 	 
 	end 
 	
 end[/lua]

It’s for penetrating doors. You could just as easily change it to any other entity. It works :stuck_out_tongue: Good luck.

Edit…
Fuck you Lua tags.

Cool thank you so much… Now I just gotta figure out what to do with this hahaha.

maybe change hte entity used to func_brush?

But that would still require a custom map for it to work.

No it wouldn’t… It would work on any map using func_brush at that location… JDud, I put this in the base weapon I made for my gamemode. However, if your not using a base, you can just put it in any SWEP, and just change the settings around and it should work if you do it right.

[editline]01:49AM[/editline]

Oh and to answer your original question of is there anyway to make it work on all your weapons, yes there is. Just make all your weapons run off of a base weapon, and put the code in there, then set the base that all your weapons derive from to the base with the penetration code in it. It should work fine.

But what map is made mostly of func_brushes?

I don’t know, but he can change it to func_brush and it will work on them. He could just add or statements defining any other map based entity he wanted to…

He?.. meh… never mind, whatever, anyway! func_brush i belive, is walls, or func_detail… i think, i map stuff, but i dont know every essence of it.

So what am I to do?

Do you read?

Making every brush func_brush will fuck up your map. It will leak and you will get massive FPS drops.

Shit