Collision Hooks

From looking at the bug tracker, it looks like Garry intends to eventually add collision hooks. Anyway, I made a module to add collision hooks on the server (calls into Lua). The only side-effect is that you need to set it SOLID_NONE on the client to produce proper prediction when walking through an entity.

You can use this to make a proper version of UClip or something, or do TF2 style doors.

How to use:

  1. copy Release/gm_guardian to lua/includes/modules
  2. modify ShouldEntitiesCollide to fit your needs

http://www.garrysmod.org/img/?t=dll&id=49632

This looks useful.

Can you explain more about the collision hooks and it’s uses, I just want to have an idea of what is possible with this.

Can you control which exact entities can/cannot collide?

Yes, it gives you the two entities that are colliding, and you can return true to make them pass through eachother.

Great, too bad this isn’t in vanilla gmod.

Hmmm, I might have a play with this. This could be utterly incredible for stuff like making a dual-universe thing within a single area (players only seeing and being able to interact with certain objects within their version of the universe).

Now I can finally make players not collide with eachother without fucking melee attacks up. :smiley:

May I ask which disassembler you used to find the signatures?

I use ollydbg.



/* There is no ANSI ustrncpy */
unsigned char* ustrncpy(unsigned char *dest, const unsigned char *src, int len) {
    while(len--)
        dest[len] = src[len];
 
    return dest;
}


‘memcpy’ anyone? That doesn’t do the work of ‘ustrncpy’ anyway. If ‘src’ is smaller than ‘len’ it’s supposed to pad ‘dest’ with zeros, in which case, this piece of code could generate an access violation exception.

But then again that class was just pulled out of a wiki.

Can you simplify that for us stupid people? (Me)

I don’t really care how he wrote it. You can only generate an exception if you’re an idiot and use the wrong length.

I tried to get Garry to do this to help me out on PSW.

intriguing :monocle:

Is it okay if I use this for Pirate Ship Wars 2?

If you want to.

I really need this! Can someone re upload it pleeasse! :slight_smile:

Here, Sippe.

Ignore me.

So apparently this thing reroutes a function to it’s own… Isn’t that VACBAN prone?