• Physgun Limiter. Stop prop pushing and throwing and set a max length.
    11 replies, posted
[url]https://github.com/thegrb93/gmodphysgunlimiter[/url] Put the lua file in lua/autorun/server for it to run. [b]Console Commands[/b] physgun_maxrange "0" - "How far the physgun can extend (This doesn't make it capable of being longer than the default. 0 is infinite)" physgun_stopproppush "1" - "Should prop pushing be stopped?" physgun_stopproppushunfrozen "0" - "Should prop pushing against unfrozen props be stopped?" physgun_stopthrowing "1" - "Should prop throwing be stopped?" Useful for a gamemode I'm working on. Probably also useful for rp servers that use the physgun.
just tested it with serverwatch. Proppushing is still possible and that pretty easy. Also the direct killing and crushing isnt working, but you can still do an double push. -snip- Still an nice idea, but needs some polishing. Falco can tell you quite a bit about these systems.
I could get rid of "(tr_ent:IsPlayer() or (tr_ent.CPPICanPhysgun and not tr_ent:CPPICanPhysgun(ply)))" and that would be fixed. Then the player wouldn't be able to build because they can't touch their own props with other props. I guess I could check if the colliding prop is frozen or not. [editline]29th May 2015[/editline] Okay, I added that. Thanks. [editline]29th May 2015[/editline] My only concern is maybe in sandbox players want to smash props around, but the prop push thing is too restrictive. I might add another convar for stopping on unfrozen props.
I appreciate that you see how restrictive such anti minge measures can be for the genuine player.
Added convar for pushing unfrozen props.
The anti push measure takes the prop position and traces towards the velocity divided by 20. This tracer can miss props if you push with a long prop, so you should still be able to prop push sideways.
It's using TraceEntity though. Shouldn't that make the trace take the entity size into account?
[QUOTE=thegrb93;47830681]It's using TraceEntity though. Shouldn't that make the trace take the entity size into account?[/QUOTE] TraceEntity uses tracehull internally, and hull traces don't take into account rotation at all. Even if it takes care of the size, rotation will be a problem.
[QUOTE=Jvs;47830694]TraceEntity uses tracehull internally, and hull traces don't take into account rotation at all. Even if it takes care of the size, rotation will be a problem.[/QUOTE] Ah, the wiki isn't that clear on how TraceEntity works in the background. This would nullify my previous comment, but gives rise to the opposite problem: false positives when moving a prop alongside another prop. That is if it uses aabb and not obb
Looks like I'll need to do this then.. [url]https://github.com/garrynewman/garrysmod/pull/847[/url] Dunno about the performance hit tho. >50 traces each frame doesn't sound too good (not to mention the math needed to generate each trace). [editline]29th May 2015[/editline] Arrgg. Found out I just needed ignoreworld = true
[QUOTE=Noi;47859691]I won't mind if you use my code in your script [url]https://gist.github.com/Noiwex/9931437[/url] .[/QUOTE] I don't see anything in it that would improve mine. Sorry.
Sorry, you need to Log In to post a reply to this thread.