Electric Wire Trap



Like in Bioshock.


Goes in addons.

Loki ( Arkantos ) fixed the rope sound for me.

Cool downloading right now.

Nice, I like it.

Looks like a lot of fun. It actually gave me an idea, shoot 2 bolts and make a rope, except maybe use it as a zip line? or something similar. Anyway, well done!

My name is Feihc, and I approve this SWEP Post.

This is great, but I ask only one thing: can you add the traps to the undo queue? Sometimes I’ll place one in the wrong spot, and I want to remove it without hassle.

^^ that, and give it a view model (and world, if possible) like the crossbow in Bioshock!

I support my mate above, a custom view/world model would be great, but could be hard.
Still I’m downloading as soon as I get home.

Looks bad. the wires and effects i mean

Updated, try the new version and tell me what works and doesn’t work.

*Reload animation no longer blocks
*Fire rate increased by .17 seconds
*Fire is now automatic, meaning you don’t need to click each time
*Fixed stake model to improve collisions
*Added some effects to the shocked entity
*Aligned the stake to hitnormals rather than it’s impact angle. This leads to better appearance and functionality ( world no longer blocks some traces ).
*Implemented an ignore list for the controller that will have it ignore non-player and non-npc entities in the line between stakes.

Probably a few other things, but those are the big ones.


Would you able to make it sort of like a live wire? Right click on a wall and a limp electrical wire appears and droops to the ground, for example? I think it’d be fun for ‘downed’ power lines and such. I haven’t tried it yet, so if it’s already implemented, I apologize.


Very nice.

I am having a lot of fun with this.

Sometimes, when i pass the wire, im not eletrocouted.

I’ve noticed this too, I’m not sure if it’s because the entity isn’t thinking fast enough ( allowing you to “glitch” ) through, or if I just need to make the hull bigger that it traces with to prevent this from happening.

I read this as electric wire TAP.

I could have been listening to peoples gmod phone calls :eng99:

There are ways around the “not thinking fast enough.” You’re probably using the entity’s think method.

Here’s a concept I used which actually helped me make physics recording as smooth as you can programmatically get it to be.

Name: OnThink
function ENT:OnThink()

hook.Add( "Think", self:GetClass() .. " (" .. self:EntIndex() .. ")", function()

	// Bunch of code cut here.

	// Exceptional if, than, else statement placed here to remove the hook

		hook.Remove( "Think", self:GetClass() .. " (" .. self:EntIndex() .. ")" )

	// end of if, than, else statment

	// Bunch of code cut here.

end )



“OnThink” is a method I created which was placed within the “Think” method. It was done for reasons which are irrelevant here.

function ENT:Think( )
self:NextThink( CurTime( ) + .01 )

return true

That would cause the entity to think 100 times a second ( although I believe it is capped at the tickrate of the server, could be wrong ).

I’m not using anything to speed up thinking because I felt it didn’t need it, but I plan to play around with it and see if it helps.

Thanks for somewhat confirming my suspicions.

You can set the next think occurrence, but it’s capped.