meetric1/GMod-Seamless-Portals

Idea for a fix for the portals that are right up the wall..?

Closed this issue · 4 comments

I haven't followed up with the recent videos and I don't know if you have mentioned anything about it, but whatever.
I don't remember if you can get the world entity the same way you can get the player entity, but if you can these tricks might work.
I looked at the glua wiki and found these functions:
https://wiki.facepunch.com/gmod/Entity:SetCustomCollisionCheck
https://wiki.facepunch.com/gmod/GM:ShouldCollide
You can maybe disable collisions for the player with everything in the map except for a certain prop that imitates the ground you'd be standing on.
Alternatively https://wiki.facepunch.com/gmod/Entity:SetCollisionGroup with COLLISION_GROUP_PASSABLE_DOOR could do the same effect maybe?

If I recall correctly, it's not entirely possible to disable collisions with the map without rewriting the movement system, which is what the Portal developers opted with. For instance, setting the map to COLLISION_GROUP_PASSABLE_DOOR doesn't change anything, although it does make it easier for you to get stuck in map geometry. When you die, your ragdoll can pass through it no problem. This is because the vanilla movement system is not entirely physics-based, and takes for granted that you will never move through map geometry. Feel free to prove this to yourself with lua run game.GetWorld():SetCollisionGroup(COLLISION_GROUP_PASSABLE_DOOR). I believe that the HL2 devs have spoken on this somewhere, that their intent was to make the movement system 100% physics based, however it did not turn out well. One can only imagine...

So that leaves the option of rewriting the movement system, while theoretically possible, will take a lot of effort and probably produce a lot of conflicts. It can be alleviated by localizing it only to portal environments, but still. The crouching workaround is fine enough for now I think.

Or you could do what Mee just did in the latest commit. It's kind of a little bit of both. Clever or jank? Great work as usual regardless

2 steps ahead of ya, been working on this for a couple days.. last thing to do is floor portals

Great then :)